:root {
    color-scheme: light;
    --background: #f7f4ef;
    --surface: #ffffff;
    --text: #201f1d;
    --muted: #6b6862;
    --border: #dcd7cf;
    --accent: #295f4e;
    --accent-dark: #1f493c;
    --accent-soft: #e8f0ed;
    --error: #9e2f2f;
    --error-soft: #faeaea;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    width: 100%;
    min-height: 100vh;
    padding: clamp(16px, 4vw, 48px);
}

.reservation-card {
    width: min(100%, 680px);
    margin-inline: auto;
    padding: clamp(22px, 5vw, 42px);
    background: #ffffff;
    border: 1px solid #e8e1d8;
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.restaurant-header {
    margin-bottom: 34px;
    text-align: center;
}

.restaurant-header h1,
.confirmation h2 {
    margin: 5px 0 8px;
    line-height: 1.15;
}

.restaurant-header h1 {
    font-size: clamp(2rem, 7vw, 3rem);
    font-family: Georgia, "Times New Roman", serif;
}

.restaurant-header p,
.section-heading p,
.helper-text {
    color: var(--muted);
}

.restaurant-header p,
.section-heading p {
    margin: 0;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.form-section {
    padding-block: 28px;
    border-top: 1px solid var(--border);
}

.section-heading {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0 0 2px;
    font-size: 1.2rem;
}

.step-number {
    display: grid;
    flex: 0 0 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 750;
}

.field-grid {
    display: grid;
    gap: 16px;
}

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

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 18px;
    font-weight: 650;
}

.field small {
    color: var(--muted);
    font-weight: 400;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    padding: 12px 13px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: 3px solid rgba(41, 95, 78, 0.22);
    outline-offset: 2px;
    border-color: var(--accent);
}

.time-fieldset {
    margin: 3px 0 0;
    padding: 0;
    border: 0;
}

.time-fieldset legend {
    margin-bottom: 8px;
    font-weight: 650;
}

.helper-text {
    min-height: 24px;
    margin-bottom: 10px;
    font-size: 0.92rem;
}

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

.time-button {
    min-height: 44px;
    padding: 9px 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.time-button:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.time-button.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.time-button:disabled {
    color: #aaa59d;
    text-decoration: line-through;
    cursor: not-allowed;
    background: #f5f4f2;
}

.primary-button,
.secondary-button {
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    font-weight: 750;
    cursor: pointer;
}

.primary-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
}

.primary-button:hover:not(:disabled) {
    background: var(--accent-dark);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.secondary-button {
    border: 1px solid var(--accent);
    background: #fff;
    color: var(--accent);
}

.message {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
}

.message-error {
    background: var(--error-soft);
    color: var(--error);
}

.confirmation {
    padding: 34px 0 12px;
    text-align: center;
}

.confirmation-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
}

.confirmation-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 26px 0;
    text-align: start;
}

.confirmation-details div {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.confirmation-details dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.confirmation-details dd {
    margin: 3px 0 0;
    font-weight: 750;
}

footer {
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

@media (max-width: 600px) {
    .page-shell {
        padding: 0;
    }

    .reservation-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .field-grid-two {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

@media (max-width: 380px) {
    .time-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

button.primary {
    background: #8b3a2b;
}

/* RTL support */
html[dir="rtl"] .confirmation-details {
    text-align: start;
}

html[dir="rtl"] #confirmation-code {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: end;
}
