/* LuckyDorm base styles: tokens, type, buttons, fields, modals, drawers, toasts.
   Brand: the logo's violet to blue gradient on a lilac-white ground, navy ink.
   Fonts: Bricolage Grotesque (headlines), Figtree (text), DM Mono (labels, prices). */
:root {
  --bg: #f8f7ff;
  --surface: #ffffff;
  --sunken: #efecfc;
  --ink: #1b1e4b;
  --ink-2: #555a86;
  --line: #e1ddf4;
  --line-strong: #8e90b8;
  --violet: #6a4ee6;
  --blue: #3450b7;
  --navy: #2f368c;
  --deep: #1d2163;
  --on-deep: #f4f2ff;
  --on-deep-2: #c9c6f0;
  --tint: #e9e3ff;
  --ok: #1f7a55;
  --ok-soft: #dcf3e8;
  --warn: #8a5a00;
  --warn-soft: #fcefd2;
  --bad: #b3372b;
  --bad-soft: #fbe3df;
  --glow: rgba(124, 92, 243, .28);
  --g1: #9a5ef8; --g2: #6f63ef; --g3: #3450b7;
  --grad: linear-gradient(115deg, var(--g1), var(--g2) 48%, var(--g3));
  --shadow: 0 1px 2px rgba(27, 30, 75, .06), 0 8px 24px -8px rgba(27, 30, 75, .14);
  --shadow-lg: 0 24px 60px -18px rgba(47, 54, 140, .35);
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-lg: 26px; --r-xs: 4px; --r-md: 14px;
  --leaf: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-xs);
  --max: 1200px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d21; --surface: #14163a; --sunken: #0f1030; --ink: #eeecff; --ink-2: #a9abd6; --line: #282a5a; --line-strong: #5f6299;
    --violet: #a891ff; --blue: #8aa0f7; --navy: #c6cbff; --deep: #191c58; --tint: #221f52;
    --ok: #7fd8ac; --ok-soft: #12352a; --warn: #f2c56b; --warn-soft: #3a2e12; --bad: #ff9e8a; --bad-soft: #3d1f17;
    --glow: rgba(150, 120, 255, .32); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0d21; --surface: #14163a; --sunken: #0f1030; --ink: #eeecff; --ink-2: #a9abd6; --line: #282a5a; --line-strong: #5f6299;
  --violet: #a891ff; --blue: #8aa0f7; --navy: #c6cbff; --deep: #191c58; --tint: #221f52;
  --ok: #7fd8ac; --ok-soft: #12352a; --warn: #f2c56b; --warn-soft: #3a2e12; --bad: #ff9e8a; --bad-soft: #3d1f17;
  --glow: rgba(150, 120, 255, .32); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
html.locked { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.02; letter-spacing: -.03em; margin: 0; text-wrap: balance; font-weight: 800; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--violet); }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ico { display: inline-block; width: 1em; height: 1em; flex: none; line-height: 0; }
.ico svg { width: 100%; height: 100%; display: block; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 34px; width: auto; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand b { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; display: block; line-height: 1.1; }
.brand small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; color: var(--ink-2); }

/* buttons */
.btn { --bh: 48px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: var(--bh); padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; border: 0; cursor: pointer; overflow: hidden; isolation: isolate; white-space: nowrap; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s, opacity .3s; }
.btn .ico { font-size: 18px; transition: transform .35s var(--ease); }
.btn:hover .ico.mv { transform: translateX(4px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 10px 26px -10px var(--glow); }
.btn-grad::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn-grad:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 34px -10px var(--glow); }
.btn-grad:hover:not(:disabled)::before { transform: translateX(120%); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--violet); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover:not(:disabled) { transform: translateY(-2px); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 40%, transparent); }
.btn-ok:hover:not(:disabled), .btn-bad:hover:not(:disabled) { transform: translateY(-2px); }
.btn-sm { --bh: 40px; padding: 0 18px; font-size: 15px; }
.btn-xs { --bh: 34px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; font-size: 19px; color: var(--ink); position: relative; transition: border-color .3s, transform .3s var(--ease); }
.icon-btn:hover { border-color: var(--violet); transform: translateY(-1px); }

/* chips and status pills */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chip .ico { color: var(--violet); font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pending, .st-new { background: var(--warn-soft); color: var(--warn); }
.st-accepted, .st-available, .st-delivered { background: var(--ok-soft); color: var(--ok); }
.st-denied, .st-cancelled, .st-removed { background: var(--bad-soft); color: var(--bad); }
.st-reserved, .st-scheduled { background: var(--tint); color: var(--violet); }
.st-sold { background: var(--sunken); color: var(--ink-2); }

/* fields */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .flabel { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-2); }
.input, .select, .textarea { font: inherit; font-size: 16px; width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .25s, box-shadow .25s; }
.textarea { min-height: 96px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 18%, transparent); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--bad); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.err { font-size: 13.5px; color: var(--bad); min-height: 20px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--violet); flex: none; }

/* choice tiles (radio cards) */
.choices { display: grid; gap: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px 16px 16px 4px; cursor: pointer; background: var(--surface); transition: border-color .25s, background .25s, transform .3s var(--ease); }
.choice:hover { border-color: var(--line-strong); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; transition: border-color .25s, box-shadow .25s; }
.choice:has(input:checked) { border-color: var(--violet); background: color-mix(in srgb, var(--tint) 60%, var(--surface)); }
.choice:has(input:checked) .dot { border-color: var(--violet); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--violet); }
.choice:has(input:focus-visible) { outline: 2px solid var(--violet); outline-offset: 2px; }
.choice b { display: block; font-weight: 600; font-size: 15px; }
.choice small { display: block; font-size: 13px; color: var(--ink-2); }
.choice .ico.big { font-size: 22px; color: var(--violet); margin-left: auto; }

/* layers: modal and drawer */
.layer { position: fixed; inset: 0; z-index: 100; background: rgba(12, 13, 40, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .3s var(--ease); }
.layer.on { opacity: 1; }
.modal { position: relative; width: min(680px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg); border-radius: 28px 28px 28px 8px; box-shadow: var(--shadow-lg); padding: clamp(22px, 4vw, 36px); transform: translateY(24px) scale(.98); transition: transform .4s var(--ease); }
.modal.wide { width: min(900px, 100%); }
.layer.on .modal { transform: none; }
.layer-x { position: absolute; top: 16px; right: 16px; z-index: 2; }
.modal h2 { font-size: clamp(28px, 4vw, 38px); padding-right: 48px; }
.modal .lead { color: var(--ink-2); margin-top: 8px; }
.drawer-layer { place-items: stretch end; padding: 0; }
.drawer { width: min(440px, 100%); height: 100%; background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .45s var(--ease); }
.layer.on .drawer { transform: none; }

/* toasts */
.toasts { position: fixed; right: 16px; top: calc(var(--toast-top, 84px) + env(safe-area-inset-top, 0px)); z-index: 200; display: grid; gap: 8px; width: min(400px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-radius: 16px 16px 16px 4px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 15px; font-weight: 500; animation: toastIn .45s var(--ease) both; }
.toast .ico { font-size: 18px; color: #a891ff; }
.toast.error .ico { color: #ff9e8a; }
.toast.out { animation: toastOut .4s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(.45em) rotate(2deg); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: none; opacity: 1; } }

@media (max-width: 560px) {
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .modal { border-radius: 24px 24px 24px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
