:root {
    --bg: #0E0E10;
    --surface: #18181B;
    --line: #27272A;
    --line-strong: #3F3F46;
    --text: #F4F4F5;
    --muted: #A1A1AA;
    --placeholder: #71717A;
    --accent: #E8B04A;
    --accent-soft: #1F1A10;
    --on-accent: #141414;
    --radius: 14px;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--text); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    font-family: Manrope, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.screen {
    max-width: 440px;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 28px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    gap: 24px;
}

h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
h2, .h2 { margin: 0; font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.head { display: flex; flex-direction: column; gap: 6px; }
.brand { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.accent { color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h2.muted { font-size: 14px; font-weight: 600; color: var(--muted); }

.alert {
    background: #2A1414;
    border: 1px solid #7F2A2A;
    color: #FCA5A5;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
}

/* Day picker */
.days {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
    scroll-snap-type: x proximity; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.days::-webkit-scrollbar { display: none; }
.day {
    flex: 1 0 52px;
    height: 72px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
}
.day-name { font-size: 12px; font-weight: 600; color: var(--muted); }
.day-num { font-size: 20px; font-weight: 800; }
.day.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.day.is-active .day-name { color: var(--on-accent); }

/* Time slots: radio buttons styled as tiles */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; width: 100%; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.slot span {
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600;
}
.slot input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.slot input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.booking { display: flex; flex-direction: column; gap: 24px; flex: 1; }
.booking .card { margin-top: auto; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
    height: 46px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}
.field input[type="date"], .field input[type="time"] { display: flex; align-items: center; }
.field input::-webkit-date-and-time-value { text-align: left; }
.field input::placeholder { color: var(--placeholder); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* Buttons */
.btn {
    height: 52px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn, .slot, .icon-btn { -webkit-tap-highlight-color: transparent; }
.btn-light { background: var(--text); color: var(--on-accent); font-weight: 700; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); font-weight: 700; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.icon-btn {
    width: 44px; height: 44px;
    border: 0; background: transparent; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; cursor: pointer;
}

.icon-btn.accent { color: var(--accent); }

.footer-link { margin-top: auto; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; padding: 12px; }
.push-down { margin-top: auto; }
.empty { padding: 24px 0; }

/* Confirmation */
.confirm { margin-top: 64px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.confirm p { max-width: 300px; }
.check {
    width: 88px; height: 88px; border-radius: 50%;
    border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.details { margin: 0; padding: 4px 18px; }
.details div { display: flex; justify-content: space-between; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); }
.details div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); font-size: 14px; }
.details dd { margin: 0; font-weight: 700; font-size: 16px; }

.admin, .admin-list { display: flex; flex-direction: column; gap: 24px; }

/* Login */
.login { margin-top: 120px; gap: 16px; }
.login h1 { font-size: 34px; }

/* Admin list */
.day-title { font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0 6px 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row form { margin: 0; }
.time { width: 52px; font-size: 16px; font-weight: 700; }
.who { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-width: 0; padding: 8px 0; }
.who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.contact { font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* Hover only on devices with a mouse (no sticky hover on phones) */
@media (hover: hover) {
    .btn-accent:hover { background: #F3C870; }
    .btn-light:hover { background: #FFFFFF; }
    .btn-ghost:hover { border-color: var(--muted); }
    .icon-btn:hover { background: var(--line); }
    .day:not(.is-active):hover, .slot input:not(:checked):hover + span { border-color: var(--line-strong); }
    .footer-link:hover, .link-btn:hover { color: var(--text); }
}

/* Very small phones */
@media (max-width: 359px) {
    h1 { font-size: 26px; }
    .login h1 { font-size: 30px; }
    .screen { padding-left: 16px; padding-right: 16px; }
    .two-col { grid-template-columns: 1fr; }
    .login { margin-top: 64px; }
}

/* Short screens (landscape phones) */
@media (max-height: 560px) {
    .login { margin-top: 32px; }
    .confirm { margin-top: 16px; }
}

/* Tablets and desktop */
@media (min-width: 820px) {
    body { font-size: 16px; }
    .screen { max-width: 1040px; padding: 56px 40px 40px; gap: 32px; }
    .screen-narrow { max-width: 460px; }
    h1 { font-size: 40px; }

    /* Booking: day + times on the left, details form sticks on the right */
    .booking {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        grid-template-areas: "days side" "slots side";
        grid-template-rows: auto 1fr;
        gap: 28px 40px;
        align-items: start;
    }
    .booking-days { grid-area: days; }
    .booking-slots { grid-area: slots; }
    .booking .booking-side { grid-area: side; margin-top: 0; position: sticky; top: 24px; padding: 20px; }
    .days { flex-wrap: wrap; overflow: visible; }
    .day { flex: 0 0 64px; height: 76px; }
    .slots { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .slot input { cursor: pointer; }

    /* Admin: add form sticks on the left, list on the right */
    .admin {
        display: grid;
        grid-template-columns: 340px minmax(0, 1fr);
        gap: 40px;
        align-items: start;
    }
    .admin-add { position: sticky; top: 24px; padding: 20px; }
    .admin-add .two-col { grid-template-columns: 1fr; }
    .admin-list { display: flex; flex-direction: column; gap: 24px; }
    .admin-list .empty { padding-top: 0; }
    .list { padding-left: 20px; }

    .login, .confirm { margin-top: 12vh; }
}
