/* ==========================================================
   HVS Jewellers · Screen Portal
   World: the showroom display tray. Flat royal-blue velvet,
   ivory card, gold kept for hairlines and the one main action.
   One face (Montserrat), flat colour, no gradients.
   ========================================================== */
:root {
  --navy: #232c8f;        /* brand blue, from the logo */
  --navy-ink: #161c5e;    /* text on light */
  --velvet: #1a2172;      /* hero ground */
  --gold: #c69a3f;        /* emblem gold */
  --gold-ink: #8a6519;    /* gold that passes contrast on ivory */
  --gold-soft: #efe3c6;
  --ivory: #f8f5ee;
  --paper: #ffffff;
  --line: #e4dccb;
  --text: #24264a;
  --muted: #5f6283;       /* 5.9:1 on ivory */
  --ok: #17734a;   --ok-bg: #e7f4ec;
  --bad: #b3261e;  --bad-bg: #fbeceb;
  --warn: #8a5a00; --warn-bg: #fbf1dd;
  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(22,28,94,.06), 0 8px 24px rgba(22,28,94,.07);
  --ease: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivory); color: var(--text);
  font: 16px/1.6 "Montserrat", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold-soft); color: var(--navy-ink); }
a { color: var(--navy); text-decoration-color: var(--gold); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--navy-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
.ic { width: 22px; height: 22px; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.top { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top .inner { max-width: 1160px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand img { height: 46px; width: auto; display: block; }
.brand .wm { display: flex; flex-direction: column; line-height: 1; }
.brand .wm b { font-weight: 700; font-size: 17px; letter-spacing: .42em; margin-right: -.42em; }
.brand .wm i { font-style: normal; font-weight: 300; font-size: 10.5px; letter-spacing: .34em; margin-top: 5px; color: var(--navy-ink); text-transform: uppercase; }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); text-decoration: none; font-size: 14px; font-weight: 600; color: var(--navy-ink); transition: background .2s var(--ease); }
.top nav a:hover { background: var(--ivory); }
.top nav a.on { color: var(--navy); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--gold); color: var(--navy-ink); font-size: 12px; font-weight: 700; }

.wrap { max-width: 520px; margin: 0 auto; padding: 32px 16px 56px; }
.wrap.wide { max-width: 1160px; }

/* ---------- Type ---------- */
h1 { font-size: clamp(28px, 7.4vw, 36px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; color: var(--navy-ink); margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--navy-ink); margin: 40px 0 14px; letter-spacing: -.01em; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 24px; text-wrap: pretty; }
.hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.center { text-align: center; }

/* ---------- Home: velvet hero ---------- */
.hero {
  margin: -32px -16px 0; padding: 40px 24px 36px; background: var(--velvet); color: #fff;
  position: relative; overflow: hidden;
}
.hero .emblem { position: absolute; right: -46px; top: -30px; width: 230px; opacity: .2; pointer-events: none; }
.hero .seal { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--gold-soft); margin: 0 0 18px; }
.hero .seal .ic { width: 18px; height: 18px; color: var(--gold); }
.hero h1 { color: #fff; font-size: clamp(32px, 9vw, 42px); max-width: 12ch; position: relative; }
.hero p.lead { color: #d8dbf4; max-width: 30ch; position: relative; }
.hero .actions { display: grid; gap: 12px; position: relative; }
.hero .actions .btn { margin: 0; }
.hero .rule { height: 1px; background: var(--gold); opacity: .6; margin: 28px 0 0; }
.hero .sub { margin: 14px 0 0; font-size: 14px; color: #c7cbee; position: relative; }
.hero .sub a { color: #fff; font-weight: 600; }

.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.how li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.how li:last-child { border-bottom: 0; }
.how .ic-wrap { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--navy); }
.how b { display: block; font-weight: 700; color: var(--navy-ink); font-size: 16px; }
.how span { display: block; font-size: 15px; color: var(--muted); }

/* ---------- Surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 20px; margin: 20px 0; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 14px; }
.row .grow { flex: 1; min-width: 0; }

/* ---------- Forms ---------- */
.field { margin-top: 20px; }
.field:first-of-type { margin-top: 0; }
label { display: block; font-size: 15px; font-weight: 600; color: var(--navy-ink); margin: 0 0 8px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--paper); border: 1.5px solid #d6ccb6; border-radius: var(--r-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease); caret-color: var(--navy);
}
input::placeholder { color: #8a8ca6; }
input:hover { border-color: #bfb293; }
input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(35,44,143,.12); }
.field-at { position: relative; }
.field-at::before { content: "@"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.field-at input { padding-left: 34px; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; font-size: 15px; color: var(--text); margin: 18px 0 0; cursor: pointer; line-height: 1.5; }
label.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); flex: none; cursor: pointer; }

/* ---------- Buttons: one pair (solid + outline), gold for the one main action ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  margin: 24px 0 0; padding: 0 22px; border: 1.5px solid var(--navy); border-radius: var(--r-sm);
  background: var(--navy); color: #fff; font: 700 16px/1.2 "Montserrat", sans-serif; letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease);
}
button:hover, .btn:hover { background: var(--navy-ink); border-color: var(--navy-ink); color: #fff; box-shadow: 0 6px 16px rgba(22,28,94,.2); }
button:active, .btn:active { transform: translateY(1px) scale(.99); box-shadow: none; }
button:disabled { opacity: .65; cursor: progress; }
.btn .ic, button .ic { width: 20px; height: 20px; }
.btn.big, button.big { width: 100%; }
.btn.gold, button.gold { background: var(--gold); border-color: var(--gold); color: var(--navy-ink); }
.btn.gold:hover, button.gold:hover { background: #d6ad55; border-color: #d6ad55; color: var(--navy-ink); box-shadow: 0 6px 18px rgba(198,154,63,.35); }
.btn.ghost, button.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover, button.ghost:hover { background: rgba(35,44,143,.06); color: var(--navy-ink); box-shadow: none; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn.small, button.small { min-height: 40px; padding: 0 14px; font-size: 14px; margin: 0; }
.btn.ok, button.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover, button.ok:hover { background: #0f5c3a; border-color: #0f5c3a; }
.btn.bad, button.bad { background: var(--paper); color: var(--bad); border-color: #e2b4b0; }
.btn.bad:hover, button.bad:hover { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ---------- Photo picker ---------- */
.picker { position: relative; display: block; margin: 0; padding: 36px 16px; text-align: center; cursor: pointer;
  border: 1.5px dashed #cbbd9c; border-radius: var(--r); background: #fffdf8; font-weight: 500; color: var(--text);
  transition: background .2s var(--ease), border-color .2s var(--ease); }
.picker:hover, .picker.drag { background: #fbf5e6; border-color: var(--gold); }
.picker input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.picker .icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; }
.picker .icon .ic { width: 28px; height: 28px; }
.picker strong { display: block; font-size: 17px; font-weight: 700; color: var(--navy-ink); }
.picker.has-file { padding: 8px; border-style: solid; }
.picker.has-file .empty { display: none; }
.preview { display: none; width: 100%; max-height: 440px; object-fit: contain; background: var(--velvet); border-radius: var(--r-sm); }
.picker.has-file .preview { display: block; }
.change { display: none; font-size: 14px; color: var(--muted); margin-top: 8px; }
.picker.has-file .change { display: block; }

/* ---------- Messages ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; margin: 0 0 20px; border-radius: var(--r-sm); font-size: 15px; font-weight: 500; }
.flash .ic { width: 20px; height: 20px; margin-top: 1px; }
.flash.ok { background: var(--ok-bg); color: #0f5236; }
.flash.error { background: var(--bad-bg); color: #8c1d16; }
.flash.info { background: #eceefb; color: var(--navy-ink); }
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.approved { background: var(--ok-bg); color: var(--ok); }
.pill.rejected, .pill.removed { background: var(--bad-bg); color: var(--bad); }

/* ---------- My photos ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grid figure { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #eae4d6; transition: transform .4s var(--ease); }
.grid figure:hover img { transform: scale(1.02); }
.grid figcaption { padding: 10px 12px 12px; font-size: 14px; display: grid; gap: 6px; }
.or { text-align: center; color: var(--muted); margin: 20px 0 0; font-size: 15px; }
.or a { font-weight: 600; }
.verified { display: inline-flex; gap: 6px; align-items: center; color: var(--ok); font-weight: 600; font-size: 14px; }
.empty-state { text-align: center; padding: 36px 20px; }
.empty-state img { width: 56px; }
.ig { color: #c13584; }
.ig-row .ic { width: 28px; height: 28px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--paper); }
.foot .inner { max-width: 520px; margin: 0 auto; padding: 28px 16px 36px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.foot .brand { margin-bottom: 6px; }
.foot .line { display: flex; gap: 10px; align-items: flex-start; }
.foot .line .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--gold-ink); }
.foot a { color: var(--navy-ink); font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ==========================================================
   Admin (Operate: precise and quiet)
   ========================================================== */
body.admin { background: #f4f2ec; }
.admin .top { background: var(--velvet); border-bottom: 2px solid var(--gold); }
.admin .brand, .admin .brand .wm i { color: #fff; }
.admin .brand .wm i { color: var(--gold-soft); }
.admin .top nav a { color: #e2e4f7; }
.admin .top nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin .top nav a.on { color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.admin h1 { font-size: 26px; }
.admin .lead { font-size: 15px; }
table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #ece6d8; vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: #fbfaf6; }
tr:hover td { background: #fcfbf7; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.card table { border: 1px solid #ece6d8; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 28px; }
.stats div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; font-size: 14px; font-weight: 500; color: var(--muted); }
.stats b { display: block; font-size: 28px; font-weight: 700; color: var(--navy-ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stats .hot { background: var(--velvet); border-color: var(--velvet); color: #d8dbf4; }
.stats .hot b { color: var(--gold); }
.queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.queue .item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s var(--ease); }
.queue .item.active { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.queue .item.flagged { border: 2px solid var(--bad); }
.queue .item.flagged::before { content: "Flagged by the automatic check. Look carefully."; display: block; padding: 8px 14px; background: var(--bad); color: #fff; font-size: 13px; font-weight: 600; }
.queue .item img { width: 100%; height: 300px; object-fit: contain; background: var(--velvet); display: block; cursor: zoom-in; }
.queue .meta { padding: 14px; font-size: 14px; display: grid; gap: 4px; flex: 1; }
.queue .meta b { color: var(--navy-ink); }
.queue .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 14px 14px; }
.queue .actions input[type=text] { flex: 1; min-width: 110px; min-height: 40px; padding: 8px 10px; font-size: 14px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.filters input, .filters select { width: auto; flex: 1; min-width: 140px; min-height: 44px; padding: 8px 12px; font-size: 15px; }
.filters button, .filters .btn { margin: 0; }
.score-hi { color: var(--bad); font-weight: 600; }
.score-mid { color: var(--warn); font-weight: 600; }
.kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--paper); font: 600 13px ui-monospace, monospace; color: var(--navy-ink); }

@media (max-width: 420px) {
  .top nav a { padding: 0 7px; font-size: 13px; }
  .top nav { gap: 0; }
  .brand img { height: 40px; }
  .brand .wm b { font-size: 15px; }
  .brand .wm i { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Admin sign-in and two-step set-up */
.narrow { max-width: 460px; margin: 0 auto; }
.steps-plain { margin: 0 0 12px; padding-left: 20px; line-height: 1.6; }
.totp-qr { width: 220px; max-width: 100%; margin: 8px auto 12px; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.totp-qr svg { display: block; width: 100%; height: auto; }
code.secret { font-size: 15px; letter-spacing: .08em; background: var(--ivory); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
