/* QuickSig — warm & vibey, soft shapes, switchable dark/light theme (persisted in localStorage). */
:root {
  --amber: #FF8A3D;
  --coral: #FF5D5D;
  --plum: #C6316B;
  --cream: #FFF6EC;
  --ink: #2A1130;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 12px 32px rgba(42, 17, 48, 0.16);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --max-width: 1180px;

  --bg: #FFF6EC;
  --bg-alt: #FFEBD8;
  --surface: #FFFFFF;
  --text: #2A1130;
  --text-muted: #6B5468;
  --border: rgba(42, 17, 48, 0.10);
  --header-bg: #2A1130;
  --header-text: #FFF6EC;
}

html[data-theme="dark"] {
  --bg: #1B1023;
  --bg-alt: #241531;
  --surface: #2A1B36;
  --text: #F5E9F0;
  --text-muted: #C8AFCB;
  --border: rgba(255, 246, 236, 0.12);
  --header-bg: #150B1B;
  --header-text: #FFF6EC;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.money, .price {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Header / nav ─────────────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg); color: var(--header-text);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem var(--space-3);
  gap: var(--space-2);
  box-shadow: 0 2px 18px rgba(0,0,0,0.18);
}
.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.brand img { height: 40px; width: auto; flex-shrink: 0; }
.admin-badge {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--amber); color: #2A1130; padding: 3px 10px; border-radius: 999px; font-weight: 700;
  display: inline-block;
}
.nav-links { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.nav-links a, .nav-links button.linklike {
  color: var(--header-text); opacity: 0.88; font-weight: 600; font-size: 0.95rem;
  padding: 0.5rem 0.2rem; min-height: 44px; display: inline-flex; align-items: center;
  border: none; background: none; cursor: pointer;
}
.nav-links a:hover, .nav-links a.active, .nav-links button.linklike:hover { opacity: 1; color: var(--amber); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.theme-toggle {
  border: 1px solid rgba(255,246,236,0.3); background: transparent; color: var(--header-text);
  border-radius: 999px; padding: 0.5rem 0.9rem; cursor: pointer; min-height: 44px; font-size: 0.9rem;
}
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--amber); color: var(--amber); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px; padding: 0.75rem 1.4rem; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; border: none; min-height: 44px; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 2px;
}
.btn-primary { background: linear-gradient(135deg, var(--amber), var(--coral)); color: #2A1130; box-shadow: var(--shadow-soft); }
.btn-ghost { background: transparent; color: var(--header-text); border: 1.5px solid rgba(255,246,236,0.4); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-danger { background: #E63946; color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.82rem; min-height: 38px; }

.mobile-toggle { display: none; }

/* ── Hero ─────────────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; background-image:
    linear-gradient(120deg, rgba(42,17,48,0.88), rgba(198,49,107,0.55) 55%, rgba(255,138,61,0.35)),
    url('/assets/stock-1.jpg');
  background-size: cover; background-position: center;
  color: var(--cream); padding: var(--space-5) var(--space-3) var(--space-4);
}
.hero-inner { max-width: var(--max-width); margin: 0 auto; display: grid; gap: var(--space-3); max-width: 720px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1.08; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.hero p.lead { font-size: 1.15rem; color: #FFE9D6; max-width: 560px; margin: 0; }
.hero .cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: var(--space-2); }
.hero .trust-row { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: var(--space-3); font-size: 0.88rem; color: #FFE9D6; }
.hero .trust-row strong { color: var(--cream); }

/* ── Sections / layout ────────────────────────────────────────────────────────────────────── */
.section { padding: var(--space-5) var(--space-3); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-header { margin-bottom: var(--space-4); max-width: 640px; }
.section-header h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 0.6rem; }
.section-header p { color: var(--text-muted); margin: 0; font-size: 1.02rem; }
.section-alt { background: var(--bg-alt); }

.grid { display: grid; gap: var(--space-3); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--surface); border-radius: var(--radius-md); padding: var(--space-3);
  border: 1px solid var(--border); box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; height: 100%;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.card .card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-top: auto; padding-top: 0.8rem; }
.card .card-price-row .price { font-size: 1.3rem; font-weight: 800; color: var(--plum); }

.pill { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--bg-alt); color: var(--text); border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.8rem; font-weight: 700; }
.pill.warn { background: #FFE3B0; color: #7A4B00; }
.pill.ok { background: #D8F0DA; color: #1E5C24; }
.pill.danger { background: #FBD8D8; color: #7A1717; }
.pill.info { background: #DCE8FB; color: #1D3E7A; }

.step-imagery { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); }
.step-imagery img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Footer ───────────────────────────────────────────────────────────────────────────────── */
.site-footer { background: var(--header-bg); color: var(--header-text); padding: var(--space-4) var(--space-3) var(--space-3); margin-top: auto; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-inner h4 { margin: 0 0 0.6rem; font-size: 0.95rem; color: var(--amber); }
.footer-inner a { display: block; opacity: 0.85; padding: 0.25rem 0; font-size: 0.92rem; }
.footer-bottom { max-width: var(--max-width); margin: var(--space-3) auto 0; border-top: 1px solid rgba(255,246,236,0.15); padding-top: var(--space-2); font-size: 0.78rem; opacity: 0.7; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; justify-content: space-between; }

/* ── Forms ────────────────────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: var(--space-2); }
.field label { font-weight: 700; font-size: 0.88rem; }
.field .hint { font-size: 0.78rem; color: var(--text-muted); }
input, select, textarea {
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; font-size: 0.98rem; min-height: 44px;
  width: 100%; font-family: inherit;
}
textarea { min-height: 88px; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: unset; accent-color: var(--coral); }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 44px; }
form.stacked { max-width: 480px; }
.form-card { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-soft); border: 1px solid var(--border); }
.alert { border-radius: var(--radius-sm); padding: 0.8rem 1rem; font-size: 0.92rem; margin-bottom: var(--space-2); }
.alert-error { background: #FBD8D8; color: #7A1717; }
.alert-ok { background: #D8F0DA; color: #1E5C24; }
.alert-info { background: #DCE8FB; color: #1D3E7A; }

/* ── Tables ───────────────────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 560px; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: none; }

/* ── App shell layout (customer + admin share small utility classes, never nav/header/footer) ── */
.page { flex: 1; }
.container { max-width: var(--max-width); margin: 0 auto; padding: var(--space-4) var(--space-3); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

/* ── Admin console — a DISTINCT application shell/visual identity, never the customer chrome ── */
.admin-shell { background: var(--bg); min-height: 100vh; }
.admin-header {
  background: linear-gradient(120deg, #1B1023, #3A1440);
  color: var(--cream); padding: 0.9rem var(--space-3);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 18px rgba(0,0,0,0.25);
}
.admin-layout { display: flex; min-height: calc(100vh - 68px); }
.admin-sidebar {
  width: 230px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--space-3) var(--space-2);
}
.admin-sidebar a {
  display: block; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.92rem;
  color: var(--text); margin-bottom: 0.3rem; min-height: 44px; display: flex; align-items: center;
}
.admin-sidebar a:hover { background: var(--bg-alt); }
.admin-sidebar a.active { background: var(--coral); color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: var(--space-3); }
.stat-card { background: var(--surface); border-radius: var(--radius-md); padding: var(--space-3); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; color: var(--plum); }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }

/* Operator sign-in gate — the FIRST thing an anonymous /admin visitor sees: a full-bleed, dark
   plum/ink screen wholly unlike the customer hero (warm cream + photographic hero), proving /admin
   is a genuinely separate application before any dashboard content is ever unlocked. */
.admin-login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(198,49,107,0.35), transparent 55%), linear-gradient(160deg, #150B1B, #1B1023 45%, #3A1440);
  padding: var(--space-3);
}
.admin-login-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-4);
  max-width: 440px; width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,0.45); text-align: center;
}
.admin-login-card img { margin-left: auto; margin-right: auto; }
.admin-login-card form { text-align: left; }

/* Flow renderer (membership onboarding) */
.flow-steps { display: flex; gap: 0.6rem; margin-bottom: var(--space-3); flex-wrap: wrap; }
.flow-step-dot {
  flex: 1; min-width: 70px; text-align: center; padding: 0.5rem 0.4rem; border-radius: var(--radius-sm);
  background: var(--bg-alt); font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
}
.flow-step-dot.active { background: var(--coral); color: #fff; }
.flow-step-dot.done { background: #D8F0DA; color: #1E5C24; }

/* Chat / support widget */
.chat-window { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; padding: var(--space-2); background: var(--bg-alt); border-radius: var(--radius-md); }
.chat-bubble { padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); max-width: 85%; font-size: 0.92rem; }
.chat-bubble.me { align-self: flex-end; background: var(--coral); color: #fff; }
.chat-bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }

/* Cart drawer */
.cart-line { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--border); }
.qty-control { display: flex; align-items: center; gap: 0.4rem; }
.qty-control button {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1.1rem;
}

@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 0.4rem; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-sidebar a { white-space: nowrap; margin-bottom: 0; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; background: var(--header-bg); flex-direction: column; padding: var(--space-2) var(--space-3); gap: 0.2rem; }
  .mobile-toggle {
    display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: var(--header-text);
    font-size: 1.4rem; cursor: pointer; min-width: 44px; min-height: 44px;
  }
  .site-header { position: sticky; flex-wrap: wrap; }
  .hero { padding: var(--space-4) var(--space-2); }
  .container { padding: var(--space-3) var(--space-2); }
}

@media (max-width: 400px) {
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  table { min-width: 520px; }
}
