/* ==========================================================
   N.S Gestion — Admin Console
   Apple-ish: SF Pro stack, soft shadows, generous whitespace
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&display=swap');

:root {
  /* Inherit palette */
  --forest:        oklch(0.32 0.006 70);
  --forest-light:  oklch(0.44 0.008 70);
  --forest-dark:   oklch(0.20 0.005 70);
  --forest-deep:   oklch(0.13 0.005 70);
  --amber:         oklch(0.42 0.13 22);
  --amber-deep:    oklch(0.34 0.15 18);
  --amber-light:   oklch(0.78 0.06 22);
  --amber-glow:    oklch(0.52 0.16 22);
  --rust:          oklch(0.48 0.14 25);
  --charcoal:      oklch(0.22 0.005 60);
  --ink:           oklch(0.16 0.005 60);
  --stone:         oklch(0.48 0.005 60);
  --stone-light:   oklch(0.65 0.005 60);
  --warm-white:    oklch(0.975 0.004 70);
  --warm-gray:     oklch(0.93 0.006 70);
  --paper:         oklch(0.99 0.003 70);

  /* Apple-system stack */
  --font-sf: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
             'Segoe UI', system-ui, sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'SF Mono', ui-monospace, 'JetBrains Mono', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);

  --bg:           oklch(0.97 0.003 70);
  --bg-elevated:  #ffffff;
  --bg-sidebar:   oklch(0.95 0.004 70);
  --border:       rgba(40,30,20,0.08);
  --border-strong:rgba(40,30,20,0.14);

  --shadow-card:  0 1px 2px rgba(20,15,10,0.04), 0 8px 24px -12px rgba(20,15,10,0.08);
  --shadow-pop:   0 2px 6px rgba(20,15,10,0.06), 0 20px 40px -16px rgba(20,15,10,0.14);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
}

* { box-sizing: border-box; }

.nsg-admin-host {
  font-family: var(--font-sf);
  font-size: 14px;
  line-height: 1.45;
  color: var(--charcoal);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'ss01' 1;
  letter-spacing: -0.005em;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   App shell — sidebar + main
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 244px 1fr;
  height: 100vh;
  background: var(--bg);
}

/* Sidebar */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 6px;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar .brand .mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar .brand .mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sidebar .brand .nm {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.sidebar .brand .sub {
  font-size: 11px;
  color: var(--stone);
  letter-spacing: 0;
}
.sidebar .sec-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--stone-light);
  padding: 12px 10px 4px;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal);
  letter-spacing: -0.005em;
  transition: background 140ms var(--ease-out);
}
.sidebar .nav-item .ico { color: var(--stone); flex-shrink: 0; transition: color 140ms; }
.sidebar .nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--stone-light);
  font-feature-settings: 'tnum';
  font-weight: 500;
}
.sidebar .nav-item:hover { background: rgba(40,30,20,0.04); }
.sidebar .nav-item.active {
  background: var(--bg-elevated);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20,15,10,0.04), 0 1px 0 var(--border);
}
.sidebar .nav-item.active .ico { color: var(--amber); }
.sidebar .footer {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .footer .av {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar .footer .av img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sidebar .footer .nm { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.sidebar .footer .role { font-size: 10.5px; color: var(--stone); }

/* Main */
.main {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: rgba(40,30,20,0.15); border-radius: 5px; border: 2px solid var(--bg); }

.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247,245,238,0.78);
  backdrop-filter: saturate(140%) blur(20px);
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.topnav .crumb {
  font-size: 12px;
  color: var(--stone);
  letter-spacing: 0.005em;
}
.topnav h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0;
}
.topnav .spacer { flex: 1; }
.topnav .range {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  font-size: 12px;
  font-weight: 500;
}
.topnav .range button {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--stone);
  letter-spacing: -0.005em;
  transition: all 140ms var(--ease-out);
}
.topnav .range button.on {
  background: rgba(40,30,20,0.06);
  color: var(--ink);
}
.topnav .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--charcoal);
  font-weight: 500;
}
.topnav .pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: oklch(0.65 0.16 145);
  box-shadow: 0 0 0 3px oklch(0.65 0.16 145 / 0.18);
}

.content {
  padding: 24px 28px 48px;
  max-width: 1280px;
}

/* ============================================================
   Stat cards
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.stat .k {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--stone);
  letter-spacing: -0.005em;
  margin-bottom: 8px;
}
.stat .v {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
}
.stat .v .u {
  font-size: 14px;
  font-weight: 500;
  color: var(--stone);
  margin-left: 4px;
  letter-spacing: -0.005em;
}
.stat .delta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.stat .delta.up { color: oklch(0.50 0.14 155); }
.stat .delta.down { color: var(--rust); }
.stat .delta .arr {
  font-size: 10px;
}
.stat .delta .vs { color: var(--stone-light); margin-left: 2px; }

/* Mini sparkline */
.stat .spark {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 64px;
  height: 28px;
  pointer-events: none;
  opacity: 0.85;
}

/* ============================================================
   Cards & layout
   ============================================================ */

.card {
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}
.card .h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card .h h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 2px;
}
.card .h .sub {
  font-size: 12px;
  color: var(--stone);
}
.card .h .act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--amber);
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 140ms;
}
.card .h .act:hover { background: oklch(0.42 0.13 22 / 0.06); }

/* Two-col grid */
.row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ============================================================
   Funnel
   ============================================================ */

.funnel { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.f-row {
  display: grid;
  grid-template-columns: 28px 1fr 80px 64px;
  gap: 14px;
  align-items: center;
}
.f-row .num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--stone-light);
  letter-spacing: 0.05em;
}
.f-row .bar {
  height: 32px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.f-row .bar .fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--forest) 0%, var(--forest-light) 70%, var(--amber) 100%);
  transform-origin: left;
  border-radius: 6px;
  transition: width 700ms var(--ease-out);
}
.f-row .bar .lbl {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--warm-white);
  letter-spacing: -0.005em;
  text-shadow: 0 1px 0 rgba(20,15,10,0.15);
}
.f-row .bar.empty .lbl { color: var(--charcoal); text-shadow: none; }
.f-row .count {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.f-row .pct {
  text-align: right;
  font-size: 11px;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.f-row .pct.drop { color: var(--rust); }

/* ============================================================
   Cities chart
   ============================================================ */
.cities { display: flex; flex-direction: column; gap: 10px; }
.city-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  gap: 12px;
  align-items: center;
}
.city-row .nm {
  font-size: 12.5px;
  color: var(--charcoal);
  font-weight: 500;
}
.city-row .nm small { color: var(--stone-light); font-weight: 400; margin-left: 6px; }
.city-row .bar {
  height: 6px;
  background: rgba(40,30,20,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.city-row .bar .fill {
  height: 100%;
  background: var(--forest);
  border-radius: 3px;
  transition: width 600ms var(--ease-out);
}
.city-row .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Leads table
   ============================================================ */
.leads { display: flex; flex-direction: column; }
.leads-head {
  display: grid;
  grid-template-columns: 24px 1.4fr 1fr 0.6fr 0.6fr 0.8fr 0.6fr;
  gap: 12px;
  padding: 6px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone-light);
  border-bottom: 1px solid var(--border);
}
.lead-row {
  display: grid;
  grid-template-columns: 24px 1.4fr 1fr 0.6fr 0.6fr 0.8fr 0.6fr;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
  transition: background 120ms;
  cursor: pointer;
}
.lead-row:hover { background: rgba(40,30,20,0.025); }
.lead-row:last-child { border-bottom: 0; }
.lead-row .av {
  width: 24px; height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, oklch(0.62 0.04 70) 0%, oklch(0.50 0.02 70) 100%);
  color: var(--warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
}
.lead-row .nm {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.lead-row .em {
  color: var(--stone);
  font-size: 12.5px;
}
.lead-row .city, .lead-row .units {
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
}
.lead-row .units {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--stone);
}
.lead-row .when {
  color: var(--stone);
  font-size: 12px;
}
.lead-row .stat-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
}
.stat-badge.new { background: oklch(0.42 0.13 22 / 0.10); color: var(--amber); }
.stat-badge.contacted { background: oklch(0.65 0.16 145 / 0.10); color: oklch(0.45 0.12 155); }
.stat-badge.qualified { background: oklch(0.55 0.12 240 / 0.10); color: oklch(0.40 0.12 240); }
.stat-badge.waiting { background: rgba(40,30,20,0.06); color: var(--stone); }

/* ============================================================
   Email preview panel
   ============================================================ */
.mail-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  margin-top: 4px;
}
.mail-list {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.mail-list .lhead {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.mail-list .lhead .t {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.mail-list .lhead .c {
  font-size: 11px;
  color: var(--stone);
  margin-top: 2px;
}
.mail-list .item {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 140ms;
  border-left: 3px solid transparent;
}
.mail-list .item:hover { background: rgba(40,30,20,0.03); }
.mail-list .item.active {
  background: var(--bg-elevated);
  border-left-color: var(--amber);
}
.mail-list .item .from {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.mail-list .item .nm {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-list .item .ts {
  font-size: 10.5px;
  color: var(--stone-light);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.mail-list .item .subj {
  font-size: 12px;
  color: var(--charcoal);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-list .item .prev {
  font-size: 11.5px;
  color: var(--stone);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-pane {
  padding: 24px 32px 32px;
  overflow-y: auto;
}
.mail-pane .mp-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.mail-pane .mp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--charcoal);
  transition: all 140ms;
}
.mail-pane .mp-btn:hover { background: rgba(40,30,20,0.05); }
.mail-pane .mp-subj {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.15;
}
.mail-pane .mp-meta {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.mail-pane .mp-meta .av {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--warm-gray);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.mail-pane .mp-meta .av img { width: 100%; height: 100%; display: block; object-fit: cover; }
.mail-pane .mp-meta .who { font-size: 13px; font-weight: 600; color: var(--ink); }
.mail-pane .mp-meta .addr { font-size: 11.5px; color: var(--stone); }
.mail-pane .mp-meta .to {
  font-size: 11.5px;
  color: var(--stone);
  margin-top: 2px;
}
.mail-pane .mp-meta .to b { color: var(--charcoal); font-weight: 500; }
.mail-pane .mp-meta .when {
  font-size: 11.5px;
  color: var(--stone);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The actual email body — renders the "real" email */
.mail-.nsg-admin-host {
  font-family: 'Source Sans 3', var(--font-sf);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--charcoal);
  max-width: 640px;
}
.mail-body .salut {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 14px;
}
.mail-body p { margin: 0 0 14px; }
.mail-body p em { color: var(--forest-dark); font-style: italic; }
.mail-body p b { color: var(--ink); font-weight: 600; }
.mail-body .figbox {
  background: linear-gradient(180deg, oklch(0.42 0.13 22 / 0.06) 0%, oklch(0.42 0.13 22 / 0.02) 100%);
  border-left: 3px solid var(--amber);
  padding: 18px 22px;
  margin: 18px 0;
  border-radius: 0 8px 8px 0;
}
.mail-body .figbox .k {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 4px;
  font-weight: 600;
}
.mail-body .figbox .v {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--forest-dark);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.mail-body .figbox .v .pl { color: var(--amber); }
.mail-body .figbox .sub {
  font-size: 12.5px;
  color: var(--stone);
  margin-top: 6px;
}
.mail-body .answers {
  margin: 18px 0;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.mail-body .answers .ttl {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 8px;
  font-weight: 600;
}
.mail-body .answers .row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.mail-body .answers .row:first-of-type { border-top: 0; }
.mail-body .answers .k { color: var(--stone); }
.mail-body .answers .v { color: var(--ink); font-weight: 500; }
.mail-body .sig {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.mail-body .sig .name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--forest-dark);
}
.mail-body .sig .role { font-size: 12px; color: var(--stone); margin-top: 2px; }
.mail-body .sig .tel {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--amber);
  font-weight: 500;
}

/* Section header */
.section-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 28px 0 12px;
}
.section-h .t {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.section-h .desc { font-size: 12px; color: var(--stone); margin-top: 2px; }

/* ============================================================
   View transitions
   ============================================================ */
.view {
  /* Resilient: baseline opacity 1 — only animate transform.
     Some iframe contexts don't re-trigger opacity keyframes. */
  animation: view-in 360ms var(--ease-out) both;
}
@keyframes view-in {
  0%   { opacity: 0.6; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Lock screen — Apple System-Settings inspired
   ============================================================ */
.lock-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(60% 40% at 50% 30%, oklch(0.42 0.13 22 / 0.06) 0%, transparent 70%),
    var(--bg);
}
.lock-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 44px 40px 32px;
  box-shadow:
    inset 0 1px 0 rgba(245,242,236,0.6),
    var(--shadow-pop);
  text-align: center;
  position: relative;
  animation: lock-in 600ms var(--ease-out) both;
}
.lock-card::before {
  /* Subtle glow behind the card */
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  background: linear-gradient(180deg,
    oklch(0.42 0.13 22 / 0.06) 0%,
    transparent 40%);
  z-index: -1;
  pointer-events: none;
}
@keyframes lock-in {
  0%   { opacity: 0.6; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.lock-card.shake { animation: shake 420ms cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* Logo */
.lock-card .logo-ring {
  width: 88px; height: 88px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 24px;
  background: var(--warm-gray);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(245,242,236,0.7),
    0 8px 24px -8px rgba(20,15,10,0.20);
  position: relative;
}
.lock-card .logo-ring img {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
}

/* Headings */
.lock-card .who .name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-bottom: 6px;
}
.lock-card .who .sub {
  font-size: 13px;
  color: var(--stone);
  margin-bottom: 28px;
  letter-spacing: -0.005em;
}

/* Form — pill input with arrow positioned absolutely inside */
.lock-form {
  position: relative;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: border-color 220ms, box-shadow 280ms;
  margin-bottom: 14px;
  height: 52px;
  display: flex;
  align-items: center;
}
.lock-form:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px oklch(0.42 0.13 22 / 0.12);
}
.lock-form input {
  background: transparent;
  border: none;
  outline: none;
  padding: 0 56px 0 20px;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--ink);
  font-family: var(--font-sf);
  width: 100%;
  height: 100%;
  border-radius: 999px;
}
.lock-form input::placeholder {
  color: var(--stone-light);
  font-style: italic;
  letter-spacing: 0;
  font-size: 14px;
}
.lock-form .unlock {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  background: var(--forest-dark);
  border: none;
  border-radius: 50%;
  color: var(--amber-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 200ms, transform 200ms var(--ease-out);
  box-shadow:
    inset 0 1px 0 rgba(245,242,236,0.12),
    0 2px 6px -2px rgba(20,15,10,0.25);
  padding: 0;
}
.lock-form .unlock:hover {
  background: var(--ink);
  transform: translateY(-50%) translateX(2px);
}
.lock-form .unlock:active {
  transform: translateY(-50%) translateX(0);
}

/* Hint */
.lock-card .hint {
  font-size: 12.5px;
  color: var(--stone);
  letter-spacing: -0.005em;
  transition: color 220ms;
  margin-top: 4px;
  line-height: 1.45;
}
.lock-card .hint.err {
  color: var(--rust);
  font-weight: 500;
}

/* Footer chip showing where you are */
.lock-card .footer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--stone);
  letter-spacing: 0.005em;
}
.lock-card .footer-chip .dot {
  width: 5px; height: 5px;
  background: oklch(0.65 0.16 145);
  border-radius: 50%;
  box-shadow: 0 0 0 2px oklch(0.65 0.16 145 / 0.18);
}

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