:root {
    color-scheme: light;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --bg: linear-gradient(180deg, #f8ede1 0%, #fdfaf6 52%, #f6efe8 100%);
    --surface: #ffffff;
    --surface-soft: #fff7ed;
    --surface-quiet: #f8fafc;
    --border: #e5d3c0;
    --text: #3c2f2f;
    --text-muted: #6f5848;
    --primary: #dd6b20;
    --primary-dark: #9c4221;
    --accent: #dbeafe;
    --accent-dark: #7dd3fc;
    --success: #0f766e;
    --shadow: 0 24px 60px rgba(92, 57, 35, 0.12);
    --page-gap: clamp(10px, 1.8vh, 20px);
    --card-padding: clamp(16px, 2.2vh, 28px);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100dvh;
    padding: var(--page-gap);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
}

.page-shell {
    width: min(1520px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--page-gap);
    min-height: calc(100dvh - (var(--page-gap) * 2));
}

.page-header {
    text-align: center;
    padding-inline: clamp(4px, 1vw, 16px);
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 1.4vw, 16px);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(156, 82, 33, 0.14);
    box-shadow: 0 16px 32px rgba(92, 57, 35, 0.1);
}

.brand-logo {
    display: block;
    width: min(190px, 40vw);
    height: auto;
}

.brand-copy {
    display: grid;
    gap: 8px;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2.2vw, 2.5rem);
    line-height: 1.05;
}

.page-header p {
    margin: 0 auto;
    max-width: 700px;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.flow-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: var(--card-padding);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.promotion-banner,
.site-confirmation-banner {
    border: 1px solid rgba(15, 118, 110, 0.26);
    background: #ecfdf5;
    border-radius: 18px;
    padding: 14px 16px;
    color: #134e4a;
}

.promotion-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.promotion-banner p,
.site-confirmation-banner p {
    margin: 0;
}

.promotion-banner strong,
.site-confirmation-banner strong {
    display: block;
    font-size: 1.04rem;
}

.promotion-eyebrow {
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.promotion-banner > p {
    max-width: 34ch;
    color: #315c57;
}

.site-confirmation-banner {
    display: grid;
    gap: 4px;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    min-height: 0;
}

.step {
    padding: 12px 10px;
    border-radius: 14px;
    background: var(--surface-soft);
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-muted);
    border: 1px solid rgba(156, 82, 33, 0.16);
}

.step.active {
    background: linear-gradient(135deg, #f6ad55 0%, #c05621 100%);
    color: white;
    box-shadow: 0 12px 30px rgba(192, 95, 21, 0.18);
}

.panel {
    display: none;
}

.panel.active {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
    padding-right: 0;
}

.panel h2,
.panel > p {
    margin: 0;
}

.panel > p {
    max-width: 72ch;
}

.form-grid,
.summary-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-box,
.details-summary,
.calendar-shell {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface-soft);
    padding: 18px;
}

.details-summary {
    margin-bottom: 20px;
}

.payment-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
    min-width: 0;
    width: 100%;
}

.details-summary-inline {
    margin-bottom: 0;
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
}

.summary-header,
.payment-header,
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.summary-header h3,
.calendar-header h3 {
    margin: 2px 0 0;
    font-size: 1.05rem;
}

.summary-grid p {
    margin: 0;
}

.summary-grid-inline {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px 16px;
    align-items: center;
    flex: 1 1 520px;
}

.summary-grid-inline p {
    white-space: nowrap;
}

.eyebrow {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.helper-text,
.calendar-caption {
    color: var(--text-muted);
}

.helper-text {
    margin-bottom: 0;
    font-size: 0.88rem;
    line-height: 1.35;
}

.payment-intro {
    margin: 0 0 10px;
}

.badge {
    display: inline-flex;
    background: var(--accent);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

.payment-embed {
    position: relative;
    border-radius: 18px;
    background: white;
    border: 1px solid #cbd5e1;
    overflow: hidden;
}

.payment-box-main {
    padding: 16px 18px;
    display: grid;
    gap: 14px;
}

.payment-embed iframe {
    display: block;
    width: 100%;
    min-height: clamp(320px, 56vh, 720px);
    border: 0;
}

.payment-header {
    align-items: flex-start;
}

.payment-box-main .payment-header h3 {
    margin: 4px 0 0;
}

.payment-header-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.payment-helper-inline {
    margin-top: 0;
}

.payment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.payment-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    color: #475569;
    text-align: center;
    padding: 24px;
}

.payment-placeholder strong {
    display: block;
    margin-bottom: 8px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 14px;
    font-size: 0.94rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid #d8c1a7;
    background: #fffdfa;
    font-size: max(16px, 0.96rem);
    color: var(--text);
}

input.input-error {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

.field-error {
    min-height: 18px;
    margin: 6px 0 0;
    color: #b91c1c;
    font-size: 0.86rem;
    font-weight: 700;
}

.form-notice {
    min-height: 20px;
    margin: 12px 0 0;
    color: #b91c1c;
    font-size: 0.94rem;
    font-weight: 700;
}

textarea {
    resize: vertical;
    min-height: 84px;
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.calendar-shell {
    margin-bottom: 14px;
}

.schedule-layout .calendar-shell {
    margin-bottom: 0;
}

.schedule-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.slots-shell {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface-quiet);
    padding: 18px;
}

.slots-shell label {
    margin-top: 0;
}

.slots-helper {
    margin-top: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.calendar-day {
    border: 1px solid #d8c1a7;
    background: white;
    border-radius: 15px;
    min-height: 64px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.calendar-day:hover {
    transform: translateY(-2px);
    border-color: #f6ad55;
    box-shadow: 0 12px 24px rgba(221, 107, 32, 0.12);
}

.calendar-day.disabled,
.calendar-day:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.calendar-day.disabled:hover,
.calendar-day:disabled:hover {
    transform: none;
    border-color: #d8c1a7;
    box-shadow: none;
}

.calendar-day.active {
    background: linear-gradient(135deg, #fff1dd 0%, #ffe4c4 100%);
    border-color: var(--primary);
    box-shadow: 0 14px 30px rgba(221, 107, 32, 0.18);
}

.calendar-day-weekday,
.calendar-day-month {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.calendar-day-number {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
}

.time-slot-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
    max-height: min(430px, 52vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.time-slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: white;
    cursor: pointer;
    color: #0f172a;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.time-slot-item:hover {
    transform: translateY(-1px);
    border-color: var(--accent-dark);
}

.time-slot-item.active {
    border-color: #0ea5e9;
    background: #f0f9ff;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.12);
}

.time-slot-item.saved {
    border-color: var(--success);
    background: #ecfdf5;
}

.time-slot-item input {
    accent-color: #2563eb;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.time-slot-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-slot-status {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.time-slot-item.disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.time-slot-item.disabled:hover {
    transform: none;
    box-shadow: none;
}

.error-message {
    margin: 0;
    color: #b91c1c;
    font-weight: 600;
}

.status-message {
    margin: 0;
    color: var(--text-muted);
    font-weight: 600;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.primary-button,
.secondary-button {
    border: none;
    border-radius: 14px;
    padding: 11px 18px;
    min-height: 48px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    font-size: 1rem;
    line-height: 1.2;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.time-slot-item:focus-within {
    outline: 3px solid rgba(14, 165, 233, 0.45);
    outline-offset: 3px;
}

.primary-button {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 22px rgba(221, 107, 32, 0.22);
}

.primary-button:hover {
    transform: translateY(-1px);
    background: var(--primary-dark);
}

.secondary-button {
    background: var(--accent);
    color: var(--text);
}

.secondary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(45, 118, 212, 0.12);
}

.confirmation-panel {
    border: 1px solid #e2e8f0;
    background: var(--surface-quiet);
    padding: 18px;
    border-radius: 20px;
    line-height: 1.6;
}

.confirmation-page-shell {
    justify-content: center;
}

.confirmation-page-card {
    width: min(760px, 100%);
    margin: 0 auto;
}

.confirmation-page-panel {
    display: grid;
    gap: 14px;
}

.confirmation-page-panel h2,
.confirmation-page-panel p {
    margin: 0;
}

.confirmation-email-panel p {
    margin: 0;
    overflow-wrap: anywhere;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.confirmation-page-actions {
    margin-top: 4px;
}

@media (min-width: 980px) {
    .brand-lockup {
        flex-direction: row;
        align-items: center;
        gap: 24px;
    }

    .brand-copy {
        text-align: left;
    }

    .page-header p {
        margin-inline: 0;
    }

    .payment-layout {
        grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    }

    .details-summary-inline {
        position: sticky;
        top: 18px;
        display: grid;
        gap: 16px;
        align-items: start;
    }

    .summary-grid-inline {
        grid-template-columns: 1fr;
        flex-basis: auto;
    }

    .schedule-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
    }

    .slots-shell {
        position: sticky;
        top: 18px;
    }

    .time-slot-list {
        grid-template-columns: 1fr;
        max-height: min(360px, 48vh);
    }
}

@media (max-width: 820px) {
    .calendar-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .details-summary-inline {
        align-items: flex-start;
    }

    .summary-grid-inline {
        grid-template-columns: 1fr;
        flex-basis: 100%;
    }

    .summary-grid-inline p {
        white-space: normal;
    }

    .time-slot-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    body {
        padding: 10px;
    }

    .page-shell {
        gap: 10px;
        width: 100%;
        min-height: calc(100dvh - 20px);
    }

    .form-grid,
    .summary-grid,
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .stepper {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
    }

    .step {
        flex: 0 0 min(220px, 72vw);
        padding: 10px;
        font-size: 0.9rem;
        scroll-snap-align: start;
    }

    .promotion-banner {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .promotion-banner > p {
        max-width: none;
    }

    .payment-actions {
        justify-content: stretch;
    }

    .payment-actions .primary-button,
    .payment-actions .secondary-button {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .primary-button,
    .form-actions .secondary-button {
        width: 100%;
    }

    .flow-card {
        border-radius: 20px;
    }

    .page-header h1 {
        font-size: 1.45rem;
    }

    .page-header p {
        font-size: 0.88rem;
    }

    .brand-logo {
        width: min(160px, 48vw);
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-day {
        min-height: 58px;
        padding: 7px 8px;
    }

    .calendar-day-number {
        font-size: 1.05rem;
    }

    .payment-box,
    .details-summary,
    .calendar-shell,
    .payment-box-main,
    .slots-shell {
        padding: 12px;
    }

    .panel.active {
        padding-right: 0;
    }

    .payment-embed {
        padding: 0;
    }

    .payment-embed iframe {
        min-height: 280px;
    }

    .time-slot-list {
        grid-template-columns: 1fr;
    }
}
