/* ==========================================================================
   TERMINBUCHUNG - STYLESHEET
   Dipl.-Ing. Andreas Flatau - Moderne Direkt-Terminbuchung
   ========================================================================== */

:root {
    --tb-primary: #0284c7;
    --tb-primary-hover: #0369a1;
    --tb-primary-light: #e0f2fe;
    --tb-success: #16a34a;
    --tb-success-light: #dcfce7;
    --tb-warning: #d97706;
    --tb-warning-light: #fef3c7;
    --tb-danger: #dc2626;
    --tb-danger-light: #fee2e2;
    --tb-dark: #0f172a;
    --tb-text: #1e293b;
    --tb-text-muted: #64748b;
    --tb-border: #e2e8f0;
    --tb-bg: #ffffff;
    --tb-card-bg: #ffffff;
    --tb-radius: 12px;
    --tb-radius-sm: 8px;
    --tb-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
    --tb-shadow-hover: 0 10px 30px -4px rgba(15, 23, 42, 0.12);
    --tb-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tb-page {
    padding: 3rem 0 5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    min-height: 85vh;
}

.tb-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 2.5rem;
}

.tb-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: var(--tb-primary-light);
    color: var(--tb-primary-hover);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.tb-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--tb-dark);
    line-height: 1.25;
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
}

.tb-subtitle {
    font-size: 1.1rem;
    color: var(--tb-text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tb-usps {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.9rem;
    color: var(--tb-text);
}

.tb-usp-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tb-usp-icon {
    color: var(--tb-success);
    font-weight: bold;
}

/* Card Container */
.tb-container {
    max-width: 760px;
    margin: 0 auto;
    background: var(--tb-card-bg);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    box-shadow: var(--tb-shadow);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

@media (max-width: 640px) {
    .tb-container {
        padding: 1.5rem 1.25rem;
        border-radius: var(--tb-radius-sm);
    }
    .tb-title {
        font-size: 1.75rem;
    }
}

/* Form Sections */
.tb-section {
    margin-bottom: 2.25rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--tb-border);
}

.tb-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.tb-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--tb-dark);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tb-section-sub {
    font-size: 0.875rem;
    color: var(--tb-text-muted);
    margin-bottom: 1.25rem;
}

/* Meeting Type Selector (Video-Call vs. Telefonat) */
.tb-meeting-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.tb-meeting-card {
    position: relative;
    border: 2px solid var(--tb-border);
    border-radius: var(--tb-radius-sm);
    padding: 1.1rem;
    cursor: pointer;
    transition: var(--tb-transition);
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.tb-meeting-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.tb-meeting-card.selected {
    border-color: var(--tb-primary);
    background: #f0f9ff;
    box-shadow: 0 0 0 1px var(--tb-primary);
}

.tb-meeting-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.tb-meeting-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tb-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tb-meeting-badge {
    font-size: 0.725rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #dbeafe;
    color: var(--tb-primary-hover);
    font-weight: 600;
}

.tb-meeting-card-desc {
    font-size: 0.825rem;
    color: var(--tb-text-muted);
    line-height: 1.45;
}

/* Form Fields */
.tb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .tb-form-grid {
        grid-template-columns: 1fr;
    }
}

.tb-field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.1rem;
}

.tb-field-full {
    grid-column: 1 / -1;
}

.tb-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tb-dark);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tb-req {
    color: var(--tb-danger);
    font-weight: bold;
}

.tb-optional {
    font-size: 0.75rem;
    color: var(--tb-text-muted);
    font-weight: normal;
}

.tb-input,
.tb-textarea,
.tb-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--tb-text);
    background: #ffffff;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm);
    transition: var(--tb-transition);
    outline: none;
}

.tb-input:focus,
.tb-textarea:focus,
.tb-select:focus {
    border-color: var(--tb-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.tb-input.is-invalid,
.tb-textarea.is-invalid,
.tb-select.is-invalid {
    border-color: var(--tb-danger);
    background: #fffafa;
}

.tb-textarea {
    resize: vertical;
    min-height: 100px;
}

.tb-hint {
    font-size: 0.775rem;
    color: var(--tb-text-muted);
    margin-top: 0.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tb-typo-alert {
    display: none;
    margin-top: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: var(--tb-warning-light);
    border: 1px solid #fde68a;
    border-radius: var(--tb-radius-sm);
    font-size: 0.825rem;
    color: #92400e;
}

.tb-typo-btn {
    background: #ffffff;
    border: 1px solid #d97706;
    color: #b45309;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 0.4rem;
}

/* Slot Engine & Calendar */
.tb-slots-container {
    background: #f8fafc;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.tb-slots-loading {
    text-align: center;
    padding: 2rem;
    color: var(--tb-text-muted);
    font-size: 0.9rem;
}

.tb-slots-loading .tb-spinner {
    margin: 0 auto 0.75rem;
}

.tb-day-group {
    margin-bottom: 1.25rem;
}

.tb-day-group:last-child {
    margin-bottom: 0;
}

.tb-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.tb-day-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--tb-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tb-day-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}

.tb-badge-heute { background: #dcfce7; color: #166534; }
.tb-badge-morgen { background: #e0f2fe; color: #0369a1; }
.tb-badge-uebermorgen { background: #ede9fe; color: #5b21b6; }

.tb-time-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tb-time-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid var(--tb-border);
    border-radius: 6px;
    color: var(--tb-text);
    cursor: pointer;
    transition: var(--tb-transition);
}

.tb-time-btn:hover {
    border-color: var(--tb-primary);
    color: var(--tb-primary);
    background: #f0f9ff;
}

.tb-time-btn.selected {
    background: var(--tb-primary);
    border-color: var(--tb-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* Custom Appointment Wish Section */
.tb-custom-toggle-wrap {
    margin-top: 1rem;
    border-top: 1px dashed var(--tb-border);
    padding-top: 1rem;
}

.tb-custom-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm);
    color: var(--tb-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.65rem 1.15rem;
    transition: var(--tb-transition);
    width: 100%;
}

.tb-custom-toggle-btn:hover {
    background: var(--tb-primary-light);
    border-color: var(--tb-primary);
    color: var(--tb-primary-hover);
    text-decoration: none;
}

.tb-custom-box {
    display: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--tb-radius-sm);
    padding: 1.25rem;
    margin-top: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.tb-custom-box.is-open {
    display: block;
    animation: tbFadeDown 0.25s ease-out;
}

@keyframes tbFadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tb-custom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .tb-custom-grid {
        grid-template-columns: 1fr;
    }
}

/* Selected Summary Banner */
.tb-selected-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--tb-radius-sm);
    padding: 0.85rem 1rem;
    margin-top: 1rem;
}

.tb-selected-icon {
    font-size: 1.25rem;
    color: var(--tb-success);
    font-weight: bold;
}

.tb-selected-text {
    font-size: 0.875rem;
    color: #14532d;
}

.tb-selected-val {
    font-weight: 700;
    color: #166534;
}

/* Checkboxes */
.tb-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--tb-text);
    line-height: 1.5;
}

.tb-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    accent-color: var(--tb-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.tb-checkbox-sub {
    display: block;
    font-size: 0.775rem;
    color: var(--tb-text-muted);
    margin-top: 0.15rem;
}

/* Honeypot for Anti-Spam */
.tb-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
}

/* Submit Area */
.tb-submit-wrap {
    margin-top: 1.5rem;
    text-align: center;
}

.tb-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 360px;
    padding: 0.9rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--tb-primary);
    border: none;
    border-radius: var(--tb-radius-sm);
    cursor: pointer;
    transition: var(--tb-transition);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.tb-submit-btn:hover:not(:disabled) {
    background: var(--tb-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.tb-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tb-error-banner {
    display: none;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: var(--tb-danger-light);
    border: 1px solid #fca5a5;
    border-radius: var(--tb-radius-sm);
    color: #991b1b;
    font-size: 0.875rem;
    text-align: left;
}

/* Spinner */
.tb-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tbSpin 0.7s linear infinite;
    display: none;
}

.tb-spinner.is-dark {
    border-color: #cbd5e1;
    border-top-color: var(--tb-primary);
    display: block;
}

@keyframes tbSpin {
    to { transform: rotate(360deg); }
}

/* Success View / Thank You Screen */
.tb-success-view {
    display: none;
    text-align: center;
    padding: 1.5rem 0;
    animation: tbFadeIn 0.3s ease;
}

@keyframes tbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tb-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: var(--tb-success-light);
    color: var(--tb-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.tb-success-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--tb-dark);
    margin-bottom: 0.5rem;
}

.tb-success-sub {
    font-size: 1rem;
    color: var(--tb-text-muted);
    max-width: 540px;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}

.tb-details-box {
    background: #f8fafc;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm);
    padding: 1.25rem 1.5rem;
    max-width: 540px;
    margin: 0 auto 2rem;
    text-align: left;
}

.tb-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.9rem;
}

.tb-detail-row:last-child {
    border-bottom: none;
}

.tb-detail-lbl {
    color: var(--tb-text-muted);
    font-weight: 500;
}

.tb-detail-val {
    color: var(--tb-dark);
    font-weight: 700;
    text-align: right;
}

/* Jitsi Callout in Success Screen */
.tb-jitsi-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--tb-radius-sm);
    padding: 1.25rem;
    max-width: 540px;
    margin: 0 auto 2rem;
    text-align: center;
}

.tb-jitsi-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 0.35rem;
}

.tb-jitsi-link {
    display: inline-block;
    color: var(--tb-primary);
    word-break: break-all;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}

.tb-jitsi-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--tb-primary);
    color: #ffffff;
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--tb-transition);
}

.tb-jitsi-btn:hover {
    background: var(--tb-primary-hover);
}

/* The 3 Calendar Buttons */
.tb-cal-buttons-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tb-dark);
    margin-bottom: 0.85rem;
}

.tb-cal-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    max-width: 540px;
    margin: 0 auto 2rem;
}

.tb-cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--tb-transition);
    border: 1px solid var(--tb-border);
    background: #ffffff;
    color: var(--tb-dark);
    cursor: pointer;
}

.tb-cal-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.tb-cal-btn-google:hover {
    border-color: #4285f4;
    color: #1a73e8;
    background: #f1f7fe;
}

.tb-cal-btn-outlook:hover {
    border-color: #0078d4;
    color: #0078d4;
    background: #eff6fc;
}

.tb-cal-btn-ics {
    background: #f8fafc;
}

.tb-cal-btn-ics:hover {
    border-color: var(--tb-success);
    color: var(--tb-success);
    background: var(--tb-success-light);
}

.tb-back-home {
    display: inline-block;
    color: var(--tb-text-muted);
    font-size: 0.875rem;
    text-decoration: underline;
    margin-top: 1rem;
}

.tb-back-home:hover {
    color: var(--tb-dark);
}
