/* ═══════════════════════════════════════════════════════════════
   AS SCENTS — design system v2 ("dark luxury, evolved")
   Espresso black, metallic champagne gold, editorial serif + Manrope.
   Shared by every page: login, catalogs, admin, legal, 404.
   Token names are stable (pages and scripts use them inline).
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* theme channels (r, g, b) – every translucent colour is built from these, so a theme only has to override the tokens
     (see css/admin-themes.css; other pages keep these defaults) */
  --gold-rgb: 207, 174, 90; --gold-deep-rgb: 155, 116, 40; --gold-light-rgb: 236, 208, 138;
  --ink-rgb: 255, 245, 225; --line-rgb: 236, 218, 180;
  --bg-rgb: 11, 10, 9; --bg-d1-rgb: 8, 7, 6; --bg-d2-rgb: 5, 4, 3; --bg-l1-rgb: 17, 15, 12;
  --surface-rgb: 21, 18, 15; --glass-rgb: 24, 21, 17; --panel-rgb: 34, 29, 23;
  --ok-rgb: 116, 214, 160; --danger-rgb: 242, 119, 111; --danger2-rgb: 240, 128, 116; --violet-rgb: 188, 158, 246; --info-rgb: 134, 189, 242;
  --panel-a: #13110e; --panel-b: #0e0c0a; --dlg-a: #221d17; --dlg-b: #17140f; --drw-a: #17130f; --drw-b: #110f0c; --scroll: #3a322a;

  /* surfaces — warm, layered */
  --bg: #0b0a09;
  --bg-2: #100e0c;
  --surface: #15120f;
  --surface-2: #1c1814;
  --surface-3: #25201a;
  --glass: rgba(var(--glass-rgb), 0.72);
  --line: rgba(var(--line-rgb), 0.08);
  --line-strong: rgba(var(--line-rgb), 0.15);
  --hairline: inset 0 1px 0 rgba(255, 241, 214, 0.05);

  /* gold */
  --gold: #cfae5a;
  --gold-light: #ecd08a;
  --gold-deep: #9b7428;
  --gold-soft: rgba(var(--gold-rgb), 0.13);
  --gold-softer: rgba(var(--gold-rgb), 0.065);
  --gold-line: rgba(var(--gold-rgb), 0.34);
  --gold-grad: linear-gradient(120deg, #8f6a22 0%, #c9a24e 30%, #f1d88f 52%, #c29a45 72%, #8f6a22 100%);
  --gold-text: linear-gradient(100deg, #b98f3c 0%, #f3dd9c 45%, #c9a24e 70%, #a37a2c 100%);

  /* text (all ≥ 4.5:1 on --bg / --surface, --dim only for secondary hints) */
  --text: #f4eee3;
  --muted: #b7ad9c;
  --dim: #8d8474;

  /* semantic */
  --danger: #f2776f;
  --danger-soft: rgba(var(--danger-rgb), 0.12);
  --danger-line: rgba(var(--danger-rgb), 0.36);
  --ok: #74d6a0;
  --ok-soft: rgba(var(--ok-rgb), 0.12);
  --info: #86bdf2;
  --violet: #bc9ef6;

  /* type */
  --font-display: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  /* shape / depth / motion */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.22s;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.62);
  --glow: 0 0 0 1px var(--gold-line), 0 10px 40px rgba(var(--gold-rgb), 0.14);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(var(--gold-rgb), 0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(var(--gold-deep-rgb), 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
  overflow-x: clip; /* clip, not hidden: keeps sticky headers working while a popup locks page scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* film grain: gives the black depth, like printed matte paper */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
b, strong { font-weight: 700; }

:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.i { width: 1.15em; height: 1.15em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── brand ── */
.wordmark {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase;
  background: var(--gold-text); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.gold-text { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.eyebrow-line { display: inline-flex; align-items: center; gap: 12px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.eyebrow-line::before { content: ''; width: 28px; height: 1px; background: var(--gold-line); }

/* ── buttons ── */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.01em; color: #16110a; text-decoration: none; white-space: nowrap;
  background: var(--gold-grad); background-size: 180% 100%; background-position: 20% 0;
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.45), 0 8px 24px rgba(var(--gold-rgb), 0.22);
  transition: background-position 0.6s var(--ease), box-shadow var(--dur), transform 0.12s, opacity var(--dur);
}
.btn::after { /* light sweep on hover */
  content: ''; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: transform 0.7s var(--ease);
}
.btn:hover { background-position: 80% 0; box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.5), 0 12px 32px rgba(var(--gold-rgb), 0.32); }
.btn:hover::after { transform: translateX(120%) skewX(-20deg); }
.btn:active { transform: scale(0.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:disabled::after { display: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 13.5px; }
.btn-ghost { color: var(--text); background: rgba(var(--ink-rgb), 0.03); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost::after { display: none; }
.btn-ghost:hover { color: var(--gold-light); background: var(--gold-softer); box-shadow: inset 0 0 0 1px var(--gold-line); }
.btn-danger { color: var(--danger); background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger-line); }
.btn-danger::after { display: none; }
.btn-danger:hover { background: rgba(var(--danger-rgb), 0.2); box-shadow: inset 0 0 0 1px var(--danger); }
.btn-icon {
  width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: rgba(var(--ink-rgb), 0.035); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: color var(--dur), background var(--dur), box-shadow var(--dur), transform 0.12s;
}
.btn-icon:hover { color: var(--gold-light); background: var(--gold-softer); box-shadow: inset 0 0 0 1px var(--gold-line); }
.btn-icon:active { transform: scale(0.94); }

.spinner { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.22); border-top-color: currentColor; animation: spin 0.7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── fields ── */
.field { display: block; margin-bottom: 16px; text-align: left; }
.field > label, .field > .label { display: block; margin-bottom: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field .opt { color: var(--dim); font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.input {
  width: 100%; min-height: 50px; padding: 0 16px;
  background: rgba(var(--ink-rgb), 0.035); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 16px; /* ≥16px: no iOS zoom */
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
textarea.input { padding: 13px 16px; min-height: 88px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--dim); }
.input:hover { border-color: rgba(var(--line-rgb), 0.24); }
.input:focus { border-color: var(--gold); background: rgba(var(--ink-rgb), 0.05); box-shadow: 0 0 0 4px var(--gold-soft); }
.input.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 4px var(--danger-soft) !important; }
.input[readonly] { color: var(--muted); background: transparent; cursor: default; }
.field-error { display: none; margin-top: 7px; font-size: 13px; color: var(--danger); }
.field-error.show { display: block; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cfae5a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; }
select.input option { background: var(--surface-2); color: var(--text); }

.alert { display: none; align-items: flex-start; gap: 10px; padding: 13px 15px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.45; background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger-line); color: #ffbab4; }
.alert.show { display: flex; }
.alert .i { margin-top: 2px; }

.divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--dim); font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; border: 1px solid transparent; white-space: nowrap; }
.chip-l1 { color: var(--info); background: rgba(var(--info-rgb), 0.1); border-color: rgba(var(--info-rgb), 0.3); }
.chip-l2 { color: var(--violet); background: rgba(var(--violet-rgb), 0.1); border-color: rgba(var(--violet-rgb), 0.3); }
.chip-ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(var(--ok-rgb), 0.3); }
.chip-bad { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.chip-gold { color: var(--gold-light); background: var(--gold-soft); border-color: var(--gold-line); }

/* ── toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); z-index: 900;
  transform: translate(-50%, 18px) scale(0.98); opacity: 0; pointer-events: none;
  max-width: min(92vw, 440px); padding: 13px 20px; border-radius: 999px;
  background: rgba(var(--panel-rgb), 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 0 0 1px var(--gold-line), 0 18px 50px rgba(0, 0, 0, 0.6);
  font-size: 14px; color: var(--text); text-align: center;
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast b, .toast span.hl { color: var(--gold-light); font-weight: 700; }
.toast.err { box-shadow: 0 0 0 1px var(--danger-line), 0 18px 50px rgba(0, 0, 0, 0.6); }

/* ── cookie notice ── */
.cookie-bar {
  position: fixed; z-index: 800; left: 50%; bottom: calc(16px + var(--safe-b)); width: min(calc(100% - 24px), 740px);
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  background: var(--glass); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: var(--r-lg); box-shadow: var(--glow), var(--shadow-lg), var(--hairline);
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; transition: transform 0.55s var(--ease), opacity 0.3s;
}
.cookie-bar.on { transform: translate(-50%, 0); opacity: 1; }
.cookie-ico { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--gold-light); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); }
.cookie-txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.cookie-txt b { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.cookie-txt a { color: var(--gold-light); }
.cookie-ok { flex-shrink: 0; }
.cookie-btns { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-no { background: transparent; border: 1px solid var(--line, rgba(255,255,255,.25)); color: var(--muted); }
@media (max-width: 560px) { .cookie-bar { flex-wrap: wrap; gap: 12px; padding: 15px; } .cookie-ico { display: none; } .cookie-btns { width: 100%; } .cookie-ok, .cookie-no { flex: 1; } }

/* ── legal links (footers) ── */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-top: 14px; font-size: 13px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--gold-light); }

::selection { background: rgba(var(--gold-rgb), 0.38); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
