/* Hair by Rebecca Ginks — diary
   Palette and feel lifted from the gift voucher: cream/beige watercolour, gold hairlines,
   serif RG monogram, script headings, charcoal text. */

:root {
  --cream: #f7f2ea;
  --cream-deep: #efe6d9;
  --beige: #e6d9c7;
  --beige-deep: #d6c3a9;
  --paper: #fffdf9;
  --gold: #c9a86b;
  --gold-soft: rgba(201, 168, 107, .45);
  --charcoal: #2b2825;
  --muted: #8e8275;
  --danger: #a3473a;
  --row: 18px;              /* height of one 15-minute slot in the day view */
  --tab-h: 64px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Great Vibes", "Brush Script MT", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
  color: var(--charcoal);
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse 60% 45% at 8% 18%,  rgba(214,195,169,.55) 0%, rgba(214,195,169,0) 70%),
    radial-gradient(ellipse 55% 40% at 95% 85%, rgba(214,195,169,.50) 0%, rgba(214,195,169,0) 70%),
    radial-gradient(ellipse 40% 30% at 70% 10%, rgba(239,230,217,.9)  0%, rgba(239,230,217,0) 70%),
    radial-gradient(ellipse 50% 35% at 20% 90%, rgba(230,217,199,.6)  0%, rgba(230,217,199,0) 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, output { font: inherit; color: inherit; }

/* gold hairline frame + faint monogram, like the voucher */
.frame {
  position: fixed; inset: 8px; pointer-events: none; z-index: 5;
  border: 1px solid var(--gold-soft);
}
.monogram {
  position: fixed; left: 50%; top: 48%; transform: translate(-50%, -50%);
  font-family: var(--serif); font-weight: 400; font-size: min(58vw, 420px); line-height: 1;
  letter-spacing: -.04em; color: var(--gold); opacity: .09; pointer-events: none; z-index: 0; user-select: none;
}

.page {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: 22px 20px calc(var(--tab-h) + 28px);
}
body.out .page { padding-bottom: 40px; }

/* ---------- type ---------- */
.script { font-family: var(--script); font-weight: 400; font-size: 2.35rem; line-height: 1.1; margin: 0; letter-spacing: .01em; }
.eyebrow { font-size: .78rem; letter-spacing: .28em; text-transform: uppercase; color: var(--charcoal); margin: 0 0 2px; font-weight: 500; }
h2.eyebrow { margin: 6px 0 10px; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }
.centre { text-align: center; }
.rule {
  display: flex; align-items: center; gap: 12px; margin: 12px 0 18px; color: var(--gold);
}
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--gold-soft); }
.rule span { font-size: 1rem; line-height: 1; }

/* ---------- flash + notices ---------- */
.flash {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--paper); border: 1px solid var(--gold-soft); padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(43,40,37,.08); font-size: .95rem; animation: fade 4s forwards;
}
.flash-error { border-color: var(--danger); color: var(--danger); }
@keyframes fade { 0%,80% { opacity: 1 } 100% { opacity: 0; visibility: hidden } }
.notice { border: 1px solid var(--gold-soft); background: var(--paper); padding: 10px 14px; margin: 0 0 16px; border-radius: 6px; }
.notice p { margin: 4px 0; }
.notice ul { margin: 4px 0 4px 18px; padding: 0; }
.notice.error { border-color: var(--danger); color: var(--danger); }
.notice.warn { border-color: var(--gold); }
.error { color: var(--danger); margin: 8px 0; text-align: center; }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-block; width: 100%; text-align: center; padding: 13px 18px; margin: 6px 0;
  border: 1px solid var(--gold); border-radius: 6px; background: var(--paper); color: var(--charcoal);
  font-size: 1.05rem; letter-spacing: .06em; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn-gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-plain { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.big { padding: 15px 18px; margin-top: 18px; }
.btn:active { transform: translateY(1px); }
.chip {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--gold-soft); border-radius: 999px;
  background: var(--paper); font-size: .9rem; cursor: pointer; margin: 0 6px 6px 0;
}
.chips { margin: -6px 0 14px; }

/* ---------- login ---------- */
.login { text-align: center; padding-top: 12vh; }
.login .script { font-size: 2.9rem; }
.pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 12px 0 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--gold); background: transparent; transition: background .1s; }
.pin-dots i.on { background: var(--gold); }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center; margin: 0 auto; }
.keypad button {
  width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--gold-soft); background: var(--paper);
  font-size: 1.6rem; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.keypad button:active { background: var(--beige); }
.keypad button.dim { color: var(--muted); font-size: 1.2rem; }
.keypad button.gold { background: var(--gold); color: #fff; font-size: 1.1rem; letter-spacing: .1em; }
.login .tiny { margin-top: 28px; }

/* ---------- day / week header ---------- */
.dayhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dayhead-title { text-align: center; flex: 1; min-width: 0; }
.dayhead .script { font-size: 2.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrow {
  flex: 0 0 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--gold-soft); background: var(--paper); font-size: 1.7rem; line-height: 1; padding-bottom: 4px;
}
.dayhead-sub { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; min-height: 28px; }
.dayhead-sub .chip { margin: 0; }

/* ---------- day timeline ---------- */
.timeline { display: grid; grid-template-columns: 46px 1fr; position: relative; user-select: none; -webkit-user-select: none; }
.tl-hours { position: relative; height: calc(var(--rows) * var(--row)); }
.tl-hour {
  position: absolute; top: calc(var(--i) * var(--row)); right: 8px; transform: translateY(-50%);
  font-size: .8rem; color: var(--muted); letter-spacing: .04em;
}
.tl-grid { position: relative; height: calc(var(--rows) * var(--row)); border-left: 1px solid var(--gold-soft); }
.tl-row { height: var(--row); border-top: 1px dotted rgba(201,168,107,.25); }
.tl-row.hour { border-top: 1px solid var(--gold-soft); }
.tl-row.closed { background: repeating-linear-gradient(135deg, rgba(214,195,169,.18) 0 6px, transparent 6px 12px); }
.tl-appt, .tl-off, .tl-now {
  position: absolute; left: 6px; right: 4px;
  top: calc(var(--top) * var(--row));
}
.tl-appt, .tl-off { height: calc(var(--len) * var(--row) - 2px); }
.tl-appt {
  display: flex; flex-direction: column; justify-content: flex-start; padding: 4px 10px 4px 12px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 4px;
  box-shadow: 0 3px 10px rgba(43,40,37,.06); line-height: 1.15; z-index: 2; touch-action: pan-y;
}
.tl-appt strong { font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-appt .svc { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-appt .time { font-size: .78rem; color: var(--muted); letter-spacing: .04em; margin-top: auto; }
.tl-appt .grip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px; cursor: ns-resize; touch-action: none;
}
.tl-appt .grip::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 28px; height: 3px; margin-left: -14px;
  border-radius: 2px; background: var(--gold-soft);
}
.tl-appt.dragging { opacity: .85; box-shadow: 0 10px 24px rgba(43,40,37,.18); z-index: 4; transition: none; }
.tl-appt.short { padding-top: 2px; }
.tl-appt.short .svc, .tl-appt.short .time { display: none; }
.tl-off {
  display: flex; align-items: center; padding: 0 10px; z-index: 1; border-radius: 4px;
  background: repeating-linear-gradient(135deg, rgba(214,195,169,.55) 0 6px, rgba(230,217,199,.35) 6px 12px);
  border: 1px solid var(--gold-soft); color: var(--muted); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase;
}
.tl-now { height: 0; border-top: 1.5px solid #b5533c; z-index: 3; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: #b5533c; }
.timeline + .tiny { margin-top: 14px; }

/* ---------- week ---------- */
.week {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 0 10px; margin: 0 -20px; padding-left: 20px; padding-right: 20px;
  -webkit-overflow-scrolling: touch;
}
.wk-day { flex: 0 0 132px; scroll-snap-align: start; display: flex; flex-direction: column; }
.wk-head {
  display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 6px 0 8px;
  border-bottom: 1px solid var(--gold-soft);
}
.wk-dow { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; }
.wk-num { font-size: 1.5rem; font-weight: 500; }
.wk-day.today .wk-head { border-bottom: 2px solid var(--gold); }
.wk-day.today .wk-num { color: var(--gold); }
.wk-day.off .wk-head { color: var(--muted); }
.wk-items { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; min-height: 120px; }
.wk-appt, .wk-off, .wk-empty {
  display: block; padding: 7px 9px; border-radius: 4px; font-size: .95rem; line-height: 1.2;
}
.wk-appt { background: var(--paper); border: 1px solid var(--gold-soft); border-left: 3px solid var(--gold); }
.wk-appt small { display: block; font-size: .75rem; color: var(--muted); letter-spacing: .05em; }
.wk-off {
  background: repeating-linear-gradient(135deg, rgba(214,195,169,.55) 0 6px, rgba(230,217,199,.35) 6px 12px);
  border: 1px solid var(--gold-soft); color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
}
.wk-off small { display: block; text-transform: none; letter-spacing: 0; }
.wk-empty { color: var(--muted); text-align: center; font-style: italic; border: 1px dashed var(--gold-soft); }

/* ---------- forms ---------- */
.formhead { display: flex; flex-direction: column; gap: 4px; }
.formhead .back { font-size: .95rem; color: var(--muted); letter-spacing: .06em; }
.form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; }
.form input[type=text], .form input[type=tel], .form input[type=date], .form input[type=time], .form input[type=password], .form textarea {
  width: 100%; padding: 9px 2px; background: transparent; border: 0; border-bottom: 1px dotted var(--gold);
  font-size: 1.1rem; letter-spacing: 0; text-transform: none; border-radius: 0; outline: none; -webkit-appearance: none; appearance: none;
  min-height: 44px;
}
.form input:focus, .form textarea:focus { border-bottom: 1px solid var(--gold); }
.form textarea { resize: vertical; line-height: 1.35; }
.form input[type=date], .form input[type=time] { color: var(--charcoal); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .check { flex-direction: row; align-items: center; gap: 10px; text-transform: none; letter-spacing: .03em; font-size: 1.05rem; }
.form .check input { width: 22px; height: 22px; accent-color: var(--gold); margin: 0; }
.form .timefield { justify-content: flex-end; }

.stepper {
  display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px;
  border: 1px solid var(--gold-soft); border-radius: 999px; background: var(--paper); padding: 4px;
}
.stepper button { height: 48px; border-radius: 50%; border: 0; background: var(--cream-deep); font-size: 1.6rem; cursor: pointer; }
.stepper button:active { background: var(--beige); }
.stepper output { text-align: center; font-size: 1.25rem; letter-spacing: 0; text-transform: none; }
#endsLabel { letter-spacing: 0; text-transform: none; }

/* settings hours */
.hours { display: flex; flex-direction: column; gap: 8px; }
.hours-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 48px; }
.hours-row .check span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hours-times { display: flex; align-items: center; gap: 6px; }
.hours-times input { width: 96px; font-size: 1rem; padding-left: 0; padding-right: 0; }
.hours-times.off { opacity: .35; pointer-events: none; }

/* ---------- bottom tab bar + add sheet ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(247,242,234,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--gold-soft);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.tabbar a.on { color: var(--charcoal); }
.tabbar .ico { font-size: 1.25rem; line-height: 1; color: var(--gold); }
.tabbar .plus {
  width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center;
  font-size: 1.7rem; line-height: 1; margin-top: -14px; box-shadow: 0 4px 12px rgba(201,168,107,.4);
}
.sheet { position: fixed; inset: 0; z-index: 15; background: rgba(43,40,37,.25); display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet-card {
  width: 100%; max-width: 560px; margin: 0 auto; background: var(--cream); border-radius: 16px 16px 0 0;
  padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column;
}
.sheet-card .rule { margin: 4px 0 10px; }

@media (min-width: 640px) {
  :root { --row: 20px; }
  .page { padding-top: 32px; }
}
