/* Casa Lola — tokens and shared components (site, guest portal, admin). Brand colours live here. */
:root {
  --ocean: #2F6E9E; --ocean-d: #245a83; --ocean-l: #e4eef6;
  --ink: #141414; --ink-2: #3a3a38; --mut: #6b665e;
  --sand: #E9DCC6; --sand-2: #f3ebdd; --shell: #FBF8F3; --white: #fff;
  --sun: #E58A4E; --sun-d: #a8501f; --sun-l: #fbeadd;
  --line: #e5dccd; --line-2: #d6cab5;
  --ok: #2f7d4f; --ok-l: #e3f2e8; --warn: #9a6400; --warn-l: #fbf0d9; --bad: #b3322b; --bad-l: #fbe5e3;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px; --r-s: 10px;
  --sh: 0 1px 2px rgba(20, 20, 20, .05), 0 12px 32px -16px rgba(20, 20, 20, .22);
  --sh-l: 0 30px 80px -30px rgba(20, 20, 20, .45);
  --pad: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lock { overflow: hidden; }
body { margin: 0; font: 400 16px/1.6 var(--sans); color: var(--ink); background: var(--shell); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid rgba(47, 110, 158, .55); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 999; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; border-radius: 999px; border: 1.5px solid transparent; font: 600 15px/1.2 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .18s, border-color .18s, transform .18s, box-shadow .18s; }
.btn:active { transform: translateY(1px); }
.btn.pri { background: var(--ocean); color: #fff; }
.btn.pri:hover { background: var(--ocean-d); }
.btn.sun { background: var(--sun); color: var(--ink); }
.btn.sun:hover { background: #ec9b65; box-shadow: 0 10px 24px -10px rgba(229, 138, 78, .8); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #2b2b2b; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); background: #fff; }
.btn.light { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); color: #fff; backdrop-filter: blur(6px); }
.btn.light:hover { background: rgba(255, 255, 255, .26); }
.btn.wa { background: #25d366; color: #0b3b1f; }
.btn.wa:hover { background: #2ee374; }
.btn.danger { background: var(--bad-l); color: var(--bad); }
.btn.sm { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.ib { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; }
.ib:hover { border-color: var(--ink); }
.ib[disabled] { opacity: .35; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--ocean); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Forms */
.f { display: grid; gap: 14px; }
.f label, .fl { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.f input:not([type=checkbox]):not([type=radio]), .f select, .f textarea, .inp {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: var(--r-s); background: #fff; font-size: 16px; font-weight: 500; transition: border-color .15s, box-shadow .15s;
}
.f textarea { min-height: 96px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .inp:focus { outline: none; border-color: var(--ocean); box-shadow: 0 0 0 4px rgba(47, 110, 158, .15); }
.f .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chk { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 500 !important; font-size: 14px !important; cursor: pointer; }
.chk input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ocean); flex: none; }
.hint { font-size: 13px; color: var(--mut); font-weight: 400; }
.err { background: var(--bad-l); color: var(--bad); padding: 10px 14px; border-radius: var(--r-s); font-size: 14px; font-weight: 600; }
.ok-box { background: var(--ok-l); color: var(--ok); padding: 10px 14px; border-radius: var(--r-s); font-size: 14px; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.step { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 999px; background: #fff; }
.step button { width: 40px; height: 40px; border: 0; background: none; font-size: 20px; cursor: pointer; border-radius: 50%; }
.step button:disabled { opacity: .3; }
.step output { min-width: 26px; text-align: center; font-weight: 700; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sand-2); color: var(--ink-2); white-space: nowrap; }
.st-pending { background: var(--warn-l); color: var(--warn); }
.st-confirmed { background: var(--ocean-l); color: var(--ocean-d); }
.st-checked-in { background: var(--ok-l); color: var(--ok); }
.st-checked-out { background: #eceae6; color: #55524c; }
.st-cancelled, .st-no-show { background: var(--bad-l); color: var(--bad); }
.st-new { background: var(--sun-l); color: var(--sun-d); }
.st-arranged { background: var(--ocean-l); color: var(--ocean-d); }
.st-done { background: var(--ok-l); color: var(--ok); }
.st-declined { background: #eceae6; color: #55524c; }

/* Image placeholder */
.ph { position: relative; margin: 0; overflow: hidden; background: linear-gradient(135deg, var(--sand) 0%, var(--sand-2) 100%); border-radius: inherit; width: 100%; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-in { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #8c7a5c; padding: 10px; text-align: center; }
.ph-in .ic { width: 28px; height: 28px; opacity: .7; }
.ph-in code { font: 500 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(255, 255, 255, .6); padding: 3px 8px; border-radius: 6px; word-break: break-all; }

/* Dialog */
.dlg { border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--shell); color: var(--ink); box-shadow: var(--sh-l); overflow: hidden; }
.dlg.wide { width: min(980px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(20, 20, 20, .55); backdrop-filter: blur(3px); }
.dlg[open] { animation: dlgIn .22s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dlg-in { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--shell); }
.dlg-h h2 { font: 600 24px/1.2 var(--serif); }
.dlg-b { padding: 20px; overflow: auto; }
.dlg-f { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; flex-wrap: wrap; }
.x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.x:hover { background: var(--sand-2); }
@media (max-width: 640px) {
  .dlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .dlg.rp-dlg, .dlg.sheet { height: auto; margin-top: auto; border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .dlg-in { max-height: 100dvh; height: 100%; }
  .dlg-b { flex: 1; }
  .f .row2, .f .row3 { grid-template-columns: 1fr; }
}

/* Range picker */
.rp { padding: 8px 20px 16px; position: relative; overflow: auto; }
.rp-nav { display: flex; justify-content: space-between; position: absolute; left: 14px; right: 14px; top: 8px; pointer-events: none; }
.rp-nav .ib { pointer-events: auto; width: 40px; height: 40px; }
.rp-ms { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.rp-m h3 { text-align: center; font: 600 15px/40px var(--sans); text-transform: capitalize; margin-bottom: 6px; }
.rp-w, .rp-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.rp-w span { text-align: center; font-size: 12px; color: var(--mut); padding: 4px 0; }
.rp-g button { height: 42px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 14px; border-radius: 10px; position: relative; }
.rp-g button:hover:not(:disabled) { background: var(--sand-2); }
.rp-g button:disabled { color: #c4bcae; cursor: default; }
.rp-g button.busy { text-decoration: line-through; color: #c4bcae; }
.rp-g button.today::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--sun); transform: translateX(-50%); }
.rp-g button.in { background: var(--ocean-l); border-radius: 0; }
.rp-g button.start, .rp-g button.end { background: var(--ocean); color: #fff; }
.rp-sum { margin-right: auto; font-weight: 600; font-size: 14px; }
.rp-dlg { width: min(720px, calc(100vw - 24px)); }
@media (max-width: 640px) { .rp-ms { grid-template-columns: 1fr; } .rp-ms .rp-m + .rp-m { display: none; } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 1000; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; max-width: min(92vw, 460px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

/* Preview mode: TODO_CONFIRM values */
html.preview .todo { text-decoration: underline dotted var(--sun-d) 2px; text-underline-offset: 3px; cursor: help; background: rgba(229, 138, 78, .12); border-radius: 3px; }
html.preview .todo::after { content: '?'; display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 3px; border-radius: 50%; background: var(--sun); color: var(--ink); font: 700 10px/1 var(--sans); vertical-align: super; }
.preview-bar { display: none; }
html.preview .preview-bar { display: flex; position: fixed; left: 12px; bottom: 12px; z-index: 900; gap: 8px; align-items: center; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: var(--sh-l); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media print { .no-print, .toast, .preview-bar { display: none !important; } body { background: #fff; } }
