/* Hospitality web — the shared design tokens and components the Booking Desk
   (index.html/app.js) and guest portal (stay.html/stay.js) actually use.
   Extracted from the RentifyHQ web design system (itself a port of the iOS
   Theme.swift): role-tinted indigo→violet accent, SF-rounded type, 20px
   surface cards with a soft shadow, capsule pills, bottom tab bar.
   This app deliberately carries its OWN copy — it never references the
   property app's assets. Page-specific rules (calendar, tape chart, room
   grid, stay pills) live in the pages' own <style> blocks, as they did in
   the source templates. */

:root {
  /* Tells the browser this page supports both schemes and to theme native
     chrome (form control backgrounds/text, dropdowns, scrollbars) to match —
     without this, Safari/iOS renders that native UI with its OWN default
     (usually light) regardless of the dark overrides below. */
  color-scheme: light dark;
  /* Brand tints */
  --indigo: #4f46e5; --violet: #7c3aed;
  /* Semantic */
  --success: #10b981; --warning: #f59e0b; --danger: #f43f5e; --info: #0ea5e9;
  /* Neutrals — iOS "grouped" light: gray canvas, white cards */
  --canvas: #f2f2f7; --surface: #ffffff; --ink: #1c1c1e; --subtle: #6e6e73;
  --hairline: rgba(60, 60, 67, 0.16);
  --card: var(--surface); --text: var(--ink);
  /* Shape + elevation */
  --r-card: 20px; --r-ctrl: 14px;
  --shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  /* Spacing scale */
  --xs: 4px; --sm: 8px; --md: 16px; --lg: 24px; --xl: 32px;
  /* Role accent — one indigo-violet theme for every role, same as the rest of
     the product family. */
  --role: var(--indigo);
  --role-grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --role-soft: rgba(79, 70, 229, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root { --canvas: #000000; --surface: #1c1c1e; --ink: #ffffff; --subtle: #98989d; --hairline: rgba(255,255,255,0.14); --shadow: 0 6px 16px rgba(0,0,0,0.5); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--canvas); color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Type ramp (the slices these pages use) */
.t-head    { font-size: 18px; font-weight: 600; }
.t-cap     { font-size: 13px; font-weight: 500; }
.subtle    { color: var(--subtle); }

/* ---- Scaffold -------------------------------------------------------------- */
/* The desk renders into #root and constrains its own content with .page. */
.page { max-width: 720px; margin: 0 auto; padding: var(--md); }

.topbar {
  /* No backdrop-filter: position:sticky + backdrop-filter:blur() is a known
     GPU-rendering-corruption trigger on Android WebView/Chrome. A near-opaque
     flat background gives the same effect without the compositor's blur path. */
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--md); background: color-mix(in srgb, var(--canvas) 97%, transparent);
  border-bottom: 1px solid var(--hairline);
}
.brand { font-weight: 800; font-size: 19px; letter-spacing: -0.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 1; max-width: 58%; overflow-x: auto; scrollbar-width: none; }
.topbar-actions::-webkit-scrollbar { display: none; }
.topbar .row-center { min-width: 0; overflow: hidden; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  flex-shrink: 0; border-radius: 50%; border: none; background: transparent; color: var(--ink); cursor: pointer; }
.iconbtn:hover { background: var(--role-soft); }
.iconbtn svg { width: 21px; height: 21px; }

/* ---- Cards ----------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: var(--md);
  box-shadow: var(--shadow); margin-bottom: var(--md); }
.rowcard { background: var(--surface); border-radius: var(--r-card); padding: var(--md); box-shadow: var(--shadow); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sm); }
.row-center { display: flex; align-items: center; gap: var(--sm); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #fff; background: var(--role-grad); }
.pill svg { width: 14px; height: 14px; }

/* Buttons */
.btn { font: inherit; cursor: pointer; border: none; border-radius: var(--r-ctrl); }
.btn-primary { width: 100%; padding: 14px; background: var(--role); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: var(--shadow); }
.btn-primary:disabled { background: #b8b8bf; cursor: default; box-shadow: none; }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-ghost { padding: 9px 14px; background: transparent; border: 1px solid var(--hairline); color: var(--ink); font-weight: 600; }
.btn-link { background: none; border: none; color: var(--role); font-weight: 600; cursor: pointer; padding: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Inputs */
.field { width: 100%; padding: 13px 14px; border-radius: var(--r-ctrl); border: 1px solid var(--hairline);
  background: var(--surface); color: var(--ink); font: inherit; margin: 6px 0; }
.field:focus { outline: none; border-color: var(--role); box-shadow: 0 0 0 3px var(--role-soft); }
textarea.field { min-height: 74px; resize: vertical; font-family: inherit; }
select.field { height: 48px; appearance: none; }
/* Small field labels — the desk writes these on every form control. */
.lbl { font-size: 13px; font-weight: 600; color: var(--subtle); margin: 14px 0 5px; display: block; }

/* Empty state */
.empty { text-align: center; padding: var(--xl) var(--md); color: var(--subtle); }

/* ---- Tab bar --------------------------------------------------------------- */
/* Fixed, visible during every scroll — same backdrop-filter removal as .topbar. */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--canvas) 97%, transparent); border-top: 1px solid var(--hairline);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.tabbar-inner { max-width: 720px; width: 100%; margin: 0 auto; display: flex; justify-content: space-around; }
.tab { flex: 1; background: none; border: none; cursor: pointer; color: var(--subtle); display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 4px 0; font-size: 10px; font-weight: 600; }
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--role); }

/* ---- Sheet (modal form) ---------------------------------------------------- */
.sheet-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10,12,20,.45); display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 560px) { .sheet-overlay { align-items: center; padding: 20px; } }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
@media (min-width: 560px) { .sheet { border-radius: 22px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--hairline); }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.sheet-body { padding: 16px 18px; overflow-y: auto; }
.sheet-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--hairline); }
.sheet-foot .btn { flex: 1; }
.sheet .error { padding: 0 18px; }

/* Checkbox rows on the booking form */
.chk { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.chk input { width: 18px; height: 18px; accent-color: var(--role); flex: none; }

/* ---- Network progress ------------------------------------------------------ */
/* A 3px indeterminate bar at the top of the viewport while any request is in
   flight (api.js owns the counter). Under prefers-reduced-motion the sweep
   becomes a static filled bar — still a signal, no longer an animation. */
#net-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 500;
  pointer-events: none; opacity: 0; transition: opacity .15s ease; overflow: hidden; }
#net-progress.on { opacity: 1; }
#net-progress::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  border-radius: 3px; background: var(--role); animation: netslide 1s ease-in-out infinite; }
@keyframes netslide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
@media (prefers-reduced-motion: reduce) {
  #net-progress::before { animation: none; width: 100%; }
}

/* Inline button spinner for the busy state ("Saving…"). */
.spin { display: inline-block; width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border-right-color: currentColor; opacity: .5; } }

/* Misc */
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
.center { text-align: center; }
a { color: var(--role); }

/* Base icon size: any icon dropped into a plain text row renders as a small
   inline glyph instead of the browser's ~300px SVG default. Per-component
   rules above are more specific and win, so sized icons are unaffected. */
svg { width: 16px; height: 16px; flex: none; vertical-align: -2px; }

/* Product-specific signed-out welcome screen. */
.product-auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(460px, 1fr); }
.product-auth-aside { padding: clamp(34px, 4.5vw, 72px); color: #fff; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, #4338ca 0%, #4f46e5 48%, #7c3aed 100%); position: relative; overflow: hidden; }
.product-auth-aside::after { content: ""; position: absolute; width: 520px; height: 520px; right: -240px; bottom: -250px; border-radius: 50%; border: 90px solid rgba(255,255,255,.07); }
.product-auth-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 23px; font-weight: 800; position: relative; z-index: 1; }
.product-auth-brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 10px 30px rgba(80,25,0,.25); }
.product-auth-promise { position: relative; z-index: 1; max-width: 610px; }
.product-auth-kicker, .product-auth-eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 12px; font-weight: 800; }
.product-auth-kicker { color: rgba(255,255,255,.78); }
.product-auth-promise h1 { font-size: clamp(42px, 4.5vw, 68px); line-height: 1.03; letter-spacing: -.045em; margin: 12px 0 32px; }
.product-auth-promise ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; font-size: clamp(15px, 1.25vw, 18px); }
.product-auth-promise li { display: flex; align-items: flex-start; gap: 13px; }
.auth-check { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border: 2px solid rgba(255,255,255,.8); border-radius: 50%; font-weight: 900; font-size: 14px; }
.product-auth-foot { position: relative; z-index: 1; color: rgba(255,255,255,.75); margin: 0; font-size: 13px; }
.product-auth-main { display: grid; place-items: center; padding: clamp(28px, 5vw, 72px); background: var(--canvas); }
.product-auth-card { width: 100%; max-width: 500px; }
.auth-back { display: inline-block; margin-bottom: 34px; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--subtle); }
.product-auth-eyebrow { color: var(--role); margin: 0 0 9px; }
.product-auth-card h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 12px; }
.product-auth-lead { color: var(--subtle); font-size: 16px; line-height: 1.55; margin: 0 0 24px; }
.auth-google { width: 100%; min-height: 50px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); font-weight: 700; display: flex; justify-content: center; align-items: center; gap: 10px; }
.google-g { font-family: Arial,sans-serif; color: #4285f4; font-size: 20px; font-weight: 900; }
.auth-or { display: flex; align-items: center; gap: 13px; color: var(--subtle); font-size: 13px; margin: 20px 0; }
.auth-or::before,.auth-or::after { content:""; height:1px; background:var(--hairline); flex:1; }
.auth-phone-row { display:flex; gap:8px; }
.auth-trust { display:flex; gap:12px; margin-top:18px; padding:14px 16px; border-radius:15px; background:var(--role-soft); color:var(--ink); font-size:13px; line-height:1.5; }
.auth-trust p { margin:0; }.auth-trust>span { color:var(--role); font-size:18px; }
.auth-submit { width:100%; margin-top:16px; min-height:50px; }.auth-restart { width:100%; margin-top:7px; }
.auth-fineprint,.product-auth-support { text-align:center; color:var(--subtle); font-size:12.5px; line-height:1.5; }
.product-auth-support { margin-top:24px; }.product-auth-support a { font-weight:700; text-decoration:none; }
@media (max-width: 860px) { .product-auth { grid-template-columns:1fr; }.product-auth-aside { display:none; }.product-auth-main { min-height:100dvh; }.auth-back { margin-bottom:24px; } }

/* Defensive: any stray image stays within its container. */
#root img, .sheet img { max-width: 100%; }
