/**
 * The booking page.
 *
 * Stands on its own rather than borrowing the studio's stylesheet: most
 * people who see this have never signed in to anything of ours, and it
 * has to work on a phone held in one hand.
 */

:root {
    --ink: #f3f4f6;
    --quiet: #9ca3af;
    --line: rgba(255, 255, 255, 0.1);
    --panel: rgba(255, 255, 255, 0.035);
    --brand: #1c6d8b;
    --brand-lit: #2a91b8;
    --good: #34d399;
    --bad: #fca5a5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #0b0f14;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ---------- head ---------- */

.page-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.brand {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

/* ---------- layout ---------- */

.book {
    max-width: 680px;
    margin: 0 auto;
    padding: 36px 20px 80px;
}

.book-intro[hidden],
.step[hidden],
.done[hidden],
.book-none[hidden],
.book-busy[hidden],
.book-error[hidden],
.zone-note[hidden],
.field-error[hidden],
.step-hint[hidden],
.you[hidden] {
    display: none;
}

.book-intro h1 {
    margin: 0 0 12px;
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.lede {
    margin: 0 0 8px;
    font-size: 16.5px;
    color: #d1d5db;
}

.lede strong { color: var(--good); }

.lede-sub {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--quiet);
}

/* ---------- steps ---------- */

.step {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

/* A step that cannot be used yet says so by being dim, but stays on the
   page — seeing what is coming is half of knowing how long this takes. */
.step.is-locked {
    opacity: 0.4;
    pointer-events: none;
}

.step-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
}

.step-no {
    flex: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.07);
    font-size: 13px;
    font-weight: 700;
    color: var(--quiet);
}

.step:not(.is-locked) .step-no {
    background: var(--brand);
    color: #fff;
}

.step h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.step-hint {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--quiet);
}

/* ---------- calendar ---------- */

.cal {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 14px;
    background: var(--panel);
}

.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-month {
    font-size: 15px;
    font-weight: 650;
}

.cal-move {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: none;
    color: var(--ink);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.cal-move:hover { background: rgba(255, 255, 255, 0.07); }

.cal-names,
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-names {
    margin-bottom: 6px;
}

.cal-names span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--quiet);
}

.cal-day {
    aspect-ratio: 1 / 1;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.cal-day:hover:not(:disabled) {
    border-color: var(--brand-lit);
}

/* A day with nothing free must not look clickable. */
.cal-day.is-shut {
    background: none;
    color: #4b5563;
    cursor: default;
}

.cal-day.is-picked {
    background: var(--brand);
    border-color: var(--brand-lit);
    color: #fff;
    font-weight: 700;
}

.book-busy,
.book-none {
    margin: 12px 0 0;
    font-size: 13.5px;
    color: var(--quiet);
}

/* ---------- times ---------- */

.times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 7px;
}

.time {
    padding: 11px 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.time:hover { border-color: var(--brand-lit); }

.time.is-picked {
    background: var(--brand);
    border-color: var(--brand-lit);
    color: #fff;
    font-weight: 650;
}

.zone-note {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--quiet);
}

/* ---------- the form ---------- */

.you-known {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    font-size: 14px;
    color: #a7f3d0;
}

.field { margin-bottom: 18px; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #d1d5db;
}

.opt {
    font-weight: 400;
    color: #6b7280;
}

.field input,
.field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

.field textarea {
    resize: vertical;
    line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(28, 109, 139, 0.18);
}

.field-note {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--quiet);
}

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--bad);
}

.book-error {
    margin: 0 0 16px;
    padding: 11px 13px;
    border-radius: 9px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 14px;
    color: var(--bad);
}

.book-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.book-when {
    font-size: 14px;
    color: var(--quiet);
}

.book-go {
    padding: 12px 26px;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
}

.book-go:hover:not(:disabled) { background: var(--brand-lit); }

.book-go:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- done ---------- */

.done {
    margin-top: 20px;
    padding: 34px 26px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.07);
    text-align: center;
}

.done-tick {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(52, 211, 153, 0.16);
    color: var(--good);
}

.done-tick svg { width: 24px; height: 24px; }

.done h2 {
    margin: 0 0 10px;
    font-size: 22px;
    letter-spacing: -0.01em;
}

.done-when {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 650;
    color: var(--good);
}

.done-note {
    margin: 0 auto 18px;
    max-width: 46ch;
    font-size: 14px;
    color: #d1d5db;
}

.done-links a {
    font-size: 13.5px;
    color: #7dd3fc;
}

/* ---------- phone ---------- */

@media (max-width: 560px) {
    .book { padding: 26px 16px 60px; }
    .book-intro h1 { font-size: 25px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .cal-day { min-height: 38px; }
    .book-actions { flex-direction: column; align-items: stretch; }
    .book-go { width: 100%; }
    .book-when { text-align: center; }
}

/* ---------- their own booking ---------- */

.about-said {
    white-space: pre-wrap;
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: #d1d5db;
}

/* Cancelling is not undoable, so it does not look like the happy path. */
.cancel-btn {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--bad);
}

.cancel-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.12);
}

.cancel-btn.is-sure {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.6);
}

.cancel-btn[hidden] { display: none; }

/* The way out of "you already have one booked". */
.again {
    margin-top: 10px;
    padding: 7px 13px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    background: none;
    color: var(--bad);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.again:hover:not(:disabled) { background: rgba(239, 68, 68, 0.14); }

.again:disabled {
    cursor: default;
    font-weight: 400;
    border-color: transparent;
    padding-left: 0;
}
