/* ══════════════════════════════════════════════════════════════
   BeReal Solo  ·  Premium Matte Edition
   ══════════════════════════════════════════════════════════════ */

/* 01  Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 02  Tokens */
:root {
  /* Matte black palette */
  --bg:       #0c0c0c;
  --surface:  #141414;
  --surface2: #1c1c1c;
  --surface3: #242424;
  --border:   rgba(255,255,255,.055);
  --border2:  rgba(255,255,255,.1);

  /* Text */
  --text:   #f2f2f2;
  --sub:    rgba(242,242,242,.58);
  --muted:  rgba(242,242,242,.3);

  /* Accent — used like gold, very sparingly */
  --accent:    #FFFE00;
  --accent-lo: rgba(255,254,0,.08);

  /* Status */
  --danger:   #FF453A;
  --danger-lo: rgba(255,69,58,.08);
  --success:  #34C759;

  /* Radii */
  --r-2xl: 24px;
  --r-xl:  20px;
  --r:     14px;
  --r-sm:  10px;
  --r-xs:   6px;

  /* Shadows */
  --sh-xs:  0 1px 4px rgba(0,0,0,.5);
  --sh-sm:  0 4px 16px rgba(0,0,0,.55);
  --sh:     0 12px 40px rgba(0,0,0,.7);
  --sh-lg:  0 24px 80px rgba(0,0,0,.85);
  --sh-in:  inset 0 1px 0 rgba(255,255,255,.04);   /* inner highlight */

  /* Timing */
  --t-fast: .14s;
  --t:      .22s;
  --t-slow: .38s;
  --ease:   cubic-bezier(.4, 0, .2, 1);

  /* Layout */
  --header-h: 52px;
  --nav-h:    66px;
  --safe-t: env(safe-area-inset-top,    0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* 03  Base */
html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
               'Helvetica Neue', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}

a    { color: inherit; text-decoration: none; }
img  { display: block; max-width: 100%; }
input, button { font: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
strong { font-weight: 600; }
::-webkit-scrollbar { width: 0; height: 0; }

/* 04  Header */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  padding-top: var(--safe-t);
  background: rgba(12,12,12,.88);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 1.25rem;
}

/* Wordmark */
.logo-sm {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.6px;
  display: flex;
  align-items: center;
}
.logo-sm .logo-be   { color: var(--text); }
.logo-sm .logo-dot  { color: var(--accent); margin: 0 .5px; }
.logo-sm .logo-real { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* 05  Avatar */
.avatar, .header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: -.02em;
  flex-shrink: 0;
  color: var(--text);
  transition: border-color var(--t) var(--ease);
}
.header-avatar:hover { border-color: rgba(255,255,255,.22); }

.avatar.lg {
  width: 76px;
  height: 76px;
  font-size: 1.9rem;
  font-weight: 700;
  border-width: 1.5px;
}

/* 06  Buttons */
.btn-ghost {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--sub);
  padding: .38rem .85rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast);
  box-shadow: var(--sh-in);
}
.btn-ghost svg     { width: 14px; height: 14px; }
.btn-ghost:hover   { background: var(--surface3); border-color: var(--border2); color: var(--text); }
.btn-ghost:active  { transform: scale(.93); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: -.01em;
  padding: .78rem 1.75rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast),
              box-shadow var(--t-fast);
  box-shadow: 0 4px 20px rgba(255,254,0,.18);
  text-align: center;
}
.btn-primary:hover  { opacity: .92; box-shadow: 0 6px 28px rgba(255,254,0,.28); }
.btn-primary:active { transform: scale(.96); opacity: .85; }
.btn-primary.wide   { width: 100%; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
  box-shadow: var(--sh-in);
  padding: 0;
  color: var(--sub);
}
.icon-btn svg    { width: 15px; height: 15px; }
.icon-btn:hover  { background: var(--surface3); color: var(--text); }
.icon-btn:active { transform: scale(.9); }

.inline-form { display: contents; }

/* 07  Main layout */
main {
  max-width: 540px;
  margin: 0 auto;
  padding: 1.1rem 1.1rem calc(var(--nav-h) + 1.25rem + var(--safe-b));
}

/* 08  Stats strip */
.stats-strip {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1rem .75rem;
  margin-bottom: .85rem;
  box-shadow: var(--sh-in), var(--sh-xs);
  animation: fadeUp .3s var(--ease) both;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .18rem;
  flex: 1;
}

.stat-val {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1.5px;
  color: var(--text);
}
.stat-pill:first-child .stat-val { color: var(--accent); }

.stat-lbl {
  font-size: .6rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border2);
  flex-shrink: 0;
}

/* 09  Post card */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: .85rem;
  box-shadow: var(--sh-in), var(--sh-sm);
  animation: fadeUp .35s var(--ease) both;
}

.post-header {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1.1rem .8rem;
}

.post-meta   { flex: 1; min-width: 0; }
.post-user   { display: block; font-weight: 600; font-size: .9rem; line-height: 1.2; }
.post-time   { display: block; font-size: .72rem; color: var(--sub); line-height: 1.3; margin-top: .05rem; }

.post-footer {
  padding: .8rem 1.1rem .95rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.post-actions { display: flex; align-items: center; gap: .45rem; }

.react-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), border-color var(--t-fast),
              transform var(--t-fast), color var(--t-fast);
  color: var(--sub);
  box-shadow: var(--sh-in);
}
.react-btn svg     { width: 15px; height: 15px; }
.react-btn:hover   { background: var(--surface3); color: var(--text); }
.react-btn:active  { transform: scale(.88); }
.react-btn.liked   {
  background: rgba(255,69,58,.1);
  border-color: rgba(255,69,58,.25);
  color: var(--danger);
}
.react-btn.liked svg { fill: var(--danger); stroke: var(--danger); }

.post-caption {
  font-size: .85rem;
  color: var(--sub);
  line-height: 1.45;
}
.post-caption strong { color: var(--text); margin-right: .3em; }

/* 10  BeReal composite photo */
.bereal-composite {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: #080808;
  overflow: hidden;
}

.bereal-composite::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.12) 0%,
    transparent 22%,
    transparent 60%,
    rgba(0,0,0,.65) 100%
  );
  pointer-events: none;
  z-index: 1;
}
.bereal-composite.clean::after { display: none; }

.bereal-composite .back-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bereal-composite .front-img {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 27%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 9px;
  border: 1.5px solid rgba(0,0,0,.6);
  box-shadow: 0 4px 20px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06);
  z-index: 2;
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .85rem 1.1rem;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.photo-time {
  font-size: .7rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  letter-spacing: .02em;
}

/* 11  Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge.late   {
  background: var(--danger-lo);
  color: var(--danger);
  border: 1px solid rgba(255,69,58,.22);
}
.badge.ontime {
  background: var(--accent-lo);
  color: var(--accent);
  border: 1px solid rgba(255,254,0,.2);
}
.badge.sm { font-size: .58rem; padding: .15rem .45rem; }

/* 12  Prompt & waiting */
.prompt-body, .waiting-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 1.85rem;
  text-align: center;
  gap: .65rem;
}

/* Camera icon ring animation */
.cam-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--sub);
  flex-shrink: 0;
  animation: ringPulse 2.2s ease-in-out infinite;
}
.cam-ring svg { width: 26px; height: 26px; }
.cam-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.06);
  animation: ringPulse 2.2s ease-in-out infinite .4s;
}

/* Urgent: accent-tinted ring */
.urgent-prompt .cam-ring {
  border-color: rgba(255,254,0,.25);
  color: rgba(255,254,0,.7);
}
.urgent-prompt .cam-ring::before { border-color: rgba(255,254,0,.1); }

/* Waiting icon */
.wait-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  animation: float 3.5s ease-in-out infinite;
}
.wait-icon svg { width: 24px; height: 24px; }

.prompt-label {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--text);
}

.prompt-sub {
  font-size: .82rem;
  color: var(--sub);
  line-height: 1.45;
}

.prompt-timer {
  font-size: .88rem;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: .04em;
}

.ntfy-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .7rem 1rem;
  font-size: .78rem;
  color: var(--muted);
  text-align: left;
  line-height: 1.5;
  width: 100%;
}
.ntfy-row strong { color: var(--sub); font-weight: 600; }
.ntfy-row a { color: var(--sub); text-decoration: underline; text-underline-offset: 2px; }

/* 13  History grid */
.history-section { animation: fadeUp .4s var(--ease) .1s both; }

.section-label {
  font-size: .6rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.history-item {
  cursor: pointer;
  position: relative;
}

.history-item .bereal-composite {
  border-radius: var(--r-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  box-shadow: var(--sh-xs);
}
.history-item:hover  .bereal-composite { transform: scale(1.025); box-shadow: var(--sh); }
.history-item:active .bereal-composite { transform: scale(.97); }

.history-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
}

.history-date {
  text-align: center;
  font-size: .62rem;
  color: var(--muted);
  margin-top: .38rem;
  font-weight: 500;
  letter-spacing: .02em;
}

/* 14  Memory modal */
.memory-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
}
.memory-modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  animation: fadeIn var(--t-fast) ease both;
}

.modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  max-height: 93dvh;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp .28s cubic-bezier(.32,1,.56,1) both;
  padding-bottom: calc(.85rem + var(--safe-b));
  box-shadow: var(--sh-lg);
}

.modal-handle {
  width: 32px;
  height: 3.5px;
  border-radius: 2px;
  background: rgba(255,255,255,.15);
  margin: .7rem auto .45rem;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .35rem 1.1rem .7rem;
  flex-shrink: 0;
}

.modal-meta           { flex: 1; min-width: 0; }
.modal-meta .modal-date { font-weight: 600; font-size: .88rem; }
.modal-meta .modal-time { font-size: .72rem; color: var(--sub); }

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  flex-shrink: 0;
  font-size: .9rem;
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--surface3); color: var(--text); }

.modal-photo { flex-shrink: 0; overflow: hidden; }
.modal-photo .bereal-composite { aspect-ratio: 3/4; max-height: 58dvh; }

.modal-caption-row {
  padding: .75rem 1.1rem .2rem;
  font-size: .85rem;
  color: var(--sub);
  flex-shrink: 0;
}

/* 15  Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: rgba(12,12,12,.92);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
}

.nav-inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--nav-h);
  padding: 0 1.5rem;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  font-size: .56rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--t) var(--ease);
  padding: .35rem .5rem;
  min-width: 52px;
}
.nav-item svg       { width: 21px; height: 21px; transition: transform var(--t-fast); }
.nav-item.active    { color: var(--text); }
.nav-item:active svg { transform: scale(.86); }

/* Camera — premium shutter button */
.nav-camera {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0;
  letter-spacing: 0;
  text-transform: none;
  min-width: unset;
  flex-direction: row;
  gap: 0;
  /* ring + glow */
  box-shadow:
    0 0 0 1.5px rgba(255,254,0,.32),
    0 4px 18px rgba(255,254,0,.18);
  transition: box-shadow var(--t) var(--ease), transform var(--t-fast);
}
.nav-camera svg       { width: 22px; height: 22px; color: #000; }
.nav-camera:hover     { box-shadow: 0 0 0 2.5px rgba(255,254,0,.42), 0 6px 22px rgba(255,254,0,.25); }
.nav-camera:active    { transform: scale(.91); }
/* override nav-item active/hover color for camera */
.nav-camera.nav-item  { color: #000; }

/* 16  Profile page */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .3rem;
  margin-bottom: .7rem;
  box-shadow: var(--sh-in), var(--sh-xs);
  animation: fadeUp .3s var(--ease) both;
}

.profile-name  { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; margin-top: .4rem; }
.profile-since { font-size: .75rem; color: var(--sub); }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  margin-bottom: .7rem;
  animation: fadeUp .32s var(--ease) .06s both;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  box-shadow: var(--sh-in), var(--sh-xs);
}

.sc-val {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--text);
}
.stat-card.hi .sc-val { color: var(--accent); }
.sc-lbl { font-size: .68rem; color: var(--sub); font-weight: 500; margin-top: .1rem; }
.sc-sub { font-size: .62rem; color: var(--muted); letter-spacing: .01em; }

/* Activity heatmap */
.activity-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.1rem 1.25rem 1.2rem;
  margin-bottom: .7rem;
  box-shadow: var(--sh-in), var(--sh-xs);
  animation: fadeUp .35s var(--ease) .12s both;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.activity-dot {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface3);
}
.activity-dot.ontime { background: var(--accent); opacity: .85; }
.activity-dot.late   { background: rgba(255,69,58,.45); }
.activity-dot.missed { background: var(--surface3); outline: 1px solid rgba(255,69,58,.15); }

.activity-legend {
  display: flex;
  gap: 1rem;
  margin-top: .7rem;
  font-size: .62rem;
  color: var(--muted);
}
.legend-item  { display: flex; align-items: center; gap: .3rem; }
.legend-dot   { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.legend-dot.ontime { background: var(--accent); opacity: .85; }
.legend-dot.late   { background: rgba(255,69,58,.45); }
.legend-dot.none   { background: var(--surface3); }

/* Info / settings list */
.info-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: .7rem;
  box-shadow: var(--sh-in), var(--sh-xs);
  animation: fadeUp .4s var(--ease) .18s both;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
}
.info-row:last-child { border-bottom: none; }

.info-label { font-size: .82rem; color: var(--sub); font-weight: 400; }
.info-value {
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  word-break: break-all;
}
.info-value.mono {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: .72rem;
  letter-spacing: -.02em;
}

.danger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .88rem;
  border-radius: var(--r);
  background: var(--danger-lo);
  border: 1px solid rgba(255,69,58,.18);
  color: var(--danger);
  font-weight: 600;
  font-size: .88rem;
  transition: background var(--t-fast), transform var(--t-fast);
  animation: fadeUp .45s var(--ease) .22s both;
}
.danger-btn svg   { width: 16px; height: 16px; }
.danger-btn:hover  { background: rgba(255,69,58,.13); }
.danger-btn:active { transform: scale(.97); }

/* 17  Auth / Login */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 65% 35% at 50% -10%,
      rgba(255,254,0,.04) 0%, transparent 65%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: fadeUp .4s var(--ease) both;
}

.logo {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -2.5px;
  line-height: 1;
  margin-bottom: .3rem;
  color: var(--text);
}
.logo .logo-dot { color: var(--accent); }

.tagline {
  color: var(--muted);
  margin-bottom: 2.75rem;
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .02em;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.auth-card input {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: .9rem 1.15rem;
  border-radius: var(--r-sm);
  width: 100%;
  font-size: .95rem;
  font-weight: 300;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--sh-in);
}
.auth-card input::placeholder { color: var(--muted); }
.auth-card input:focus {
  outline: none;
  border-color: rgba(255,254,0,.35);
  box-shadow: 0 0 0 3px rgba(255,254,0,.07);
}

.alert {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--danger-lo);
  border: 1px solid rgba(255,69,58,.18);
  color: var(--danger);
  padding: .65rem 1rem;
  border-radius: var(--r-xs);
  margin-bottom: .75rem;
  font-size: .82rem;
  text-align: left;
}

/* 18  Capture / Camera */
.capture-body {
  background: #000;
  height: 100dvh;
  overflow: hidden;
}

#app {
  height: 100dvh;
  position: relative;
}

.capture-step {
  display: none;
  flex-direction: column;
  height: 100dvh;
  position: absolute;
  inset: 0;
  animation: fadeIn .18s ease both;
}
.capture-step.active { display: flex; }

.cam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + .9rem) 1.25rem .9rem;
  font-weight: 600;
  font-size: .88rem;
  position: relative;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, transparent 100%);
  letter-spacing: -.01em;
}

.viewfinder-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}
.viewfinder-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.corner-preview {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 27%;
  aspect-ratio: 3/4;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid rgba(0,0,0,.6);
  box-shadow: 0 4px 18px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06);
  z-index: 5;
}
.corner-preview img { width: 100%; height: 100%; object-fit: cover; }

.cam-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 2.25rem calc(var(--safe-b) + 1.5rem);
  position: relative;
  z-index: 10;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, transparent 100%);
}
.cam-footer.col {
  flex-direction: column;
  gap: .75rem;
  align-items: stretch;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.cam-hint {
  color: rgba(255,255,255,.45);
  font-size: .75rem;
  font-weight: 500;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  top: -1.4rem;
  letter-spacing: .02em;
}

/* Shutter */
.shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  border: 2.5px solid rgba(255,255,255,.45);
  box-shadow:
    0 0 0 5px rgba(255,255,255,.1),
    0 8px 24px rgba(0,0,0,.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s, box-shadow .12s, opacity .14s;
  flex-shrink: 0;
}
.shutter-btn:hover:not(:disabled)  {
  box-shadow: 0 0 0 7px rgba(255,255,255,.14), 0 8px 28px rgba(0,0,0,.55);
}
.shutter-btn:active:not(:disabled) {
  transform: scale(.88);
  box-shadow: 0 0 0 2px rgba(255,255,255,.08), 0 4px 12px rgba(0,0,0,.5);
}
.shutter-btn:disabled { opacity: .28; cursor: default; }

.shutter-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.88);
}

/* Preview composite */
.preview-composite {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}
.preview-composite .back-img  {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.preview-composite .front-img {
  position: absolute;
  top: 12px; left: 12px;
  width: 27%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 9px;
  border: 1.5px solid rgba(0,0,0,.6);
  box-shadow: 0 4px 18px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06);
  z-index: 2;
}

#caption-input {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: .8rem 1rem;
  border-radius: var(--r-sm);
  width: 100%;
  font-size: .9rem;
  font-weight: 300;
  transition: background .14s, border-color .14s;
}
#caption-input::placeholder { color: rgba(255,255,255,.28); }
#caption-input:focus {
  outline: none;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,254,0,.3);
}

/* Upload overlays */
.upload-overlay {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(20px);
  z-index: 99;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.upload-overlay > p {
  color: var(--sub);
  font-size: .88rem;
  font-weight: 400;
}

.done-checkmark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 0 0 8px rgba(255,254,0,.08), 0 0 36px rgba(255,254,0,.28);
  animation: pop .38s cubic-bezier(.34,1.56,.64,1) both;
}
.done-checkmark svg { width: 28px; height: 28px; }

/* 19  Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .02em;
}

/* 20  Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}
@keyframes ringPulse {
  0%, 100% { opacity: .4; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.1); }
}
