/* ============================================================
   DatePulse — Design System
   Aesthetic: Warm noir — deep plum/charcoal + rose/coral glow
   Fonts: Playfair Display (display) + DM Sans (body)
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */

.set-primary-btn {
    position: absolute;
    bottom: 6px; left: 6px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 700;
    padding: 3px 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.photo-thumb:hover .set-primary-btn { opacity: 1; }

:root {
  --bg:           #0f0c14;
  --bg-card:      #1a1525;
  --bg-elevated:  #221c30;
  --bg-input:     #2a2238;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);

  --primary:      #e8516a;
  --primary-dark: #c43d55;
  --primary-glow: rgba(232,81,106,0.3);
  --secondary:    #ff8fa3;
  --accent-gold:  #f4b942;
  --accent-teal:  #5eead4;

  --text:         #f0eaf8;
  --text-muted:   #9b8fb0;
  --text-faint:   #5c5175;

  --pass-color:   #6b7280;
  --like-color:   #e8516a;
  --super-color:  #f4b942;

  --radius-sm:    8px;
  --radius:       16px;
  --radius-lg:    24px;
  --radius-xl:    32px;
  --radius-full:  9999px;

  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow:       0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.6);
  --shadow-glow:  0 0 40px var(--primary-glow);

  --nav-h:        64px;
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }
textarea, input, select { font-family: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3 { font-family: 'Playfair Display', serif; line-height: 1.2; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 16px;
  font-weight: 500;
}
.alert-error   { background: rgba(232,81,106,0.15); border: 1px solid rgba(232,81,106,0.3); color: #fca5a5; }
.alert-success { background: rgba(94,234,212,0.1);  border: 1px solid rgba(94,234,212,0.3); color: var(--accent-teal); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: .95rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #c0375a 100%);
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px var(--primary-glow); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-elevated); }

.btn-outline-danger {
  background: transparent;
  color: #fca5a5;
  border: 1px solid rgba(232,81,106,0.3);
}
.btn-outline-danger:hover { background: rgba(232,81,106,0.1); }

.btn-full { width: 100%; }
.btn-lg   { padding: 16px 32px; font-size: 1.05rem; }
.btn-sm   { padding: 8px 16px; font-size: .85rem; }

/* ── Form elements ───────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.form-group .hint { font-weight: 400; opacity: .7; text-transform: none; font-size: .8rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 16px;
  font-size: .95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239b8fb0' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-check { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.form-check label { font-size: .9rem; color: var(--text-muted); margin: 0; text-transform: none; letter-spacing: 0; }

.char-count { text-align: right; font-size: .78rem; color: var(--text-faint); margin-top: 4px; }

/* Password toggle */
.input-password { position: relative; }
.input-password input { padding-right: 44px; }
.toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-faint); padding: 4px;
  display: flex; align-items: center;
}
.toggle-pw svg { width: 18px; height: 18px; }
.toggle-pw:hover { color: var(--text-muted); }

/* Password strength */
.pw-strength {
  height: 3px; background: var(--border); border-radius: 2px;
  margin-top: 6px; overflow: hidden;
}
.pw-bar {
  height: 100%; width: 0; border-radius: 2px;
  transition: width .3s, background .3s;
}

/* Button group (radio pills) */
.button-group {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.btn-toggle input { display: none; }
.btn-toggle span {
  display: block; padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: .875rem; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-toggle input:checked + span {
  background: var(--primary); border-color: var(--primary);
  color: white; box-shadow: 0 0 12px var(--primary-glow);
}
.btn-toggle span:hover { border-color: var(--border-hover); color: var(--text); }

/* Range sliders */
input[type="range"] {
  width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--val, 50%), var(--bg-elevated) var(--val, 50%));
  border-radius: 2px; cursor: pointer; outline: none;
  padding: 0; border: none; box-shadow: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  cursor: pointer;
  transition: transform var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range-row { display: flex; flex-direction: column; gap: 12px; }

/* Location */
.location-status { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.location-msg { font-size: .85rem; }

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-page { background: radial-gradient(ellipse at 60% 0%, #2a1040 0%, var(--bg) 60%); }

.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-logo {
  font-size: 3rem; line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-subtitle { color: var(--text-faint); font-size: .95rem; margin-top: 4px; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.auth-form .btn-primary { margin-top: 8px; }
.auth-switch { text-align: center; color: var(--text-muted); font-size: .9rem; margin-top: 20px; }
.auth-switch a { color: var(--secondary); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.auth-demo-hint {
  text-align: center; font-size: .82rem; color: var(--text-faint);
  margin-top: 16px; padding: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.auth-demo-hint strong { color: var(--text-muted); }

/* ── Setup page ──────────────────────────────────────────────── */
.setup-container {
  max-width: 520px; margin: 0 auto;
  padding: 40px 20px 80px;
}
.setup-header { text-align: center; margin-bottom: 36px; }
.setup-header h2 { font-family: 'Playfair Display', serif; font-size: 1.8rem; }
.setup-header p  { color: var(--text-muted); margin-top: 4px; }

.setup-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}
.setup-section h3 {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; margin-bottom: 20px;
}
.step-num {
  width: 28px; height: 28px;
  background: var(--primary); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
}

.photo-upload-area { text-align: center; }
.photo-upload-label {
  display: inline-block; cursor: pointer;
}
.photo-placeholder {
  width: 160px; height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  color: var(--text-faint);
  transition: all var(--transition);
  background: var(--bg-elevated);
}
.photo-placeholder:hover { border-color: var(--primary); color: var(--primary); }
.photo-placeholder svg { width: 40px; height: 40px; }
.photo-placeholder span { font-size: .9rem; font-weight: 500; }

/* ── App Nav ─────────────────────────────────────────────────── */
.app-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(15,12,20,0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
}

.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}
.logo-icon {
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-text { background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links { display: flex; align-items: center; gap: 8px; }

.nav-link {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--text-faint);
  transition: all var(--transition);
}
.nav-link svg { width: 22px; height: 22px; }
.nav-link:hover { color: var(--text-muted); background: var(--bg-elevated); }
.nav-link.active { color: var(--primary); }
.nav-link.active::after {
  content: '';
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--primary); border-radius: 50%;
}

.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.nav-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--primary); color: white;
  font-size: .65rem; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ── Discover page ───────────────────────────────────────────── */
.app-page { padding-bottom: var(--nav-h); }

.discover-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  padding: 20px 20px 0;
  gap: 24px;
}

/* Card stack */
.card-stack {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 520px;
}

.swipe-card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform-origin: center bottom;
  user-select: none;
  touch-action: none;
  will-change: transform;
  cursor: grab;
}
.swipe-card:active { cursor: grabbing; }

/* Stack visual — cards below get smaller/rotated */
.swipe-card:nth-last-child(2) { transform: scale(0.97) translateY(6px); }
.swipe-card:nth-last-child(3) { transform: scale(0.94) translateY(12px); }
.swipe-card:nth-last-child(n+4) { display: none; }

.swipe-card.is-top { transform: none !important; z-index: 10; }

.swipe-card.swipe-right {
  animation: flyRight 0.4s cubic-bezier(0.4,0,1,1) forwards;
}
.swipe-card.swipe-left {
  animation: flyLeft 0.4s cubic-bezier(0.4,0,1,1) forwards;
}
.swipe-card.swipe-up {
  animation: flyUp 0.4s cubic-bezier(0.4,0,1,1) forwards;
}

@keyframes flyRight { to { transform: translateX(150%) rotate(20deg); opacity: 0; } }
@keyframes flyLeft  { to { transform: translateX(-150%) rotate(-20deg); opacity: 0; } }
@keyframes flyUp    { to { transform: translateY(-150%) scale(0.9); opacity: 0; } }

.card-photo {
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
  position: relative;
}
.card-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,6,20,0.92) 0%, rgba(10,6,20,0.3) 40%, transparent 65%);
}

.card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px;
  z-index: 2;
}
.card-name-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.card-name { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: white; }
.card-dist {
  font-size: .82rem; color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1);
  padding: 4px 10px; border-radius: var(--radius-full);
}
.card-bio { font-size: .9rem; color: rgba(255,255,255,0.75); line-height: 1.5; }

/* Swipe indicators */
.swipe-indicator {
  position: absolute; top: 28px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: .06em;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  border-width: 3px;
  border-style: solid;
  transition: opacity 0.05s;
}
.like-indicator {
  left: 20px;
  color: #4ade80; border-color: #4ade80;
  transform: rotate(-15deg);
}
.pass-indicator {
  right: 20px;
  color: var(--primary); border-color: var(--primary);
  transform: rotate(15deg);
}

/* Action buttons */
.action-buttons {
  display: flex; align-items: center; gap: 20px;
}

.action-btn {
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  transition: all var(--transition);
  position: relative;
}
.action-btn::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%; opacity: 0;
  transition: opacity var(--transition);
}
.action-btn:hover::after { opacity: 1; }
.action-btn:active { transform: scale(0.9); }

.pass-btn {
  width: 60px; height: 60px;
  background: var(--bg-card);
  color: var(--pass-color);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.pass-btn svg { width: 24px; height: 24px; }
.pass-btn:hover { border-color: var(--pass-color); color: var(--pass-color); transform: scale(1.05); }

.like-btn {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 6px 24px var(--primary-glow);
}
.like-btn svg { width: 30px; height: 30px; }
.like-btn:hover { transform: scale(1.1); box-shadow: 0 10px 36px var(--primary-glow); }

.super-btn {
  width: 60px; height: 60px;
  background: var(--bg-card);
  color: var(--super-color);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.super-btn svg { width: 22px; height: 22px; }
.super-btn:hover { border-color: var(--super-color); transform: scale(1.05); box-shadow: 0 0 20px rgba(244,185,66,0.3); }

.keyboard-hint {
  font-size: .78rem; color: var(--text-faint);
  display: flex; align-items: center; gap: 4px;
}
kbd {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: monospace;
  font-size: .75rem;
  color: var(--text-muted);
}
@media (hover: none) { .keyboard-hint { display: none; } }

/* Match modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,6,20,0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none !important; }

.match-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 36px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: modalPop 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes modalPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.match-burst { font-size: 2.5rem; margin-bottom: 8px; animation: spin 2s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.match-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}
.match-avatars {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 20px;
}
.match-avatar {
  width: 90px; height: 90px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}
.match-heart {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: heartbeat 1s ease-in-out infinite;
}
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.match-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.match-rule { font-size: .85rem; color: var(--text-muted); margin-bottom: 28px; line-height: 1.5; }
.match-actions { display: flex; flex-direction: column; gap: 12px; }

/* ── Matches page ────────────────────────────────────────────── */
.matches-main {
  max-width: 600px; margin: 0 auto;
  padding: 24px 20px;
}
.matches-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.matches-header h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; }
.match-count {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: .82rem; color: var(--text-muted);
}

.matches-section { margin-bottom: 36px; }
.section-title {
  font-size: .78rem; font-weight: 600;
  color: var(--text-faint);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* New match bubbles */
.new-matches-row {
  display: flex; gap: 16px; overflow-x: auto;
  padding-bottom: 8px; scrollbar-width: none;
}
.new-matches-row::-webkit-scrollbar { display: none; }

.new-match-bubble {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center;
}
.bubble-wrap {
  position: relative;
  width: 76px; height: 76px;
}
.bubble-photo {
  width: 76px; height: 76px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transition: transform var(--transition);
}
.new-match-bubble:hover .bubble-photo { transform: scale(1.05); }
.bubble-name { font-size: .85rem; font-weight: 600; color: var(--text); }
.bubble-hint { font-size: .75rem; color: var(--primary); }
.bubble-timer {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  background: var(--accent-gold); color: #1a1525;
  font-size: .65rem; font-weight: 700;
  padding: 2px 6px; border-radius: var(--radius-full);
  white-space: nowrap;
}
.bubble-badge {
  position: absolute; top: -4px; right: -4px;
  width: 22px; height: 22px;
  background: var(--accent-gold); border-radius: 50%;
  font-size: .7rem; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* Conversations */
.conversations-list { display: flex; flex-direction: column; gap: 4px; }
.conv-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.conv-row:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.conv-row.unread { border-color: rgba(232,81,106,0.2); }

.conv-avatar-wrap { position: relative; flex-shrink: 0; }
.conv-avatar {
  width: 54px; height: 54px;
  border-radius: 50%; object-fit: cover;
}
.conv-unread-dot {
  position: absolute; top: -2px; right: -2px;
  background: var(--primary); color: white;
  font-size: .65rem; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.conv-name { font-weight: 600; font-size: .95rem; }
.unread .conv-name { color: var(--primary); }
.conv-time { font-size: .75rem; color: var(--text-faint); flex-shrink: 0; }
.conv-preview { font-size: .875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread .conv-preview { color: var(--text); font-weight: 500; }

/* ── Chat page ───────────────────────────────────────────────── */
.chat-page { padding-bottom: 0; }
.chat-container {
  display: flex; flex-direction: column;
  height: 100vh;
  max-width: 680px; margin: 0 auto;
}

.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: rgba(15,12,20,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.back-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.back-btn:hover { background: var(--bg-elevated); color: var(--text); }
.back-btn svg { width: 20px; height: 20px; }

.chat-partner-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.chat-partner-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.chat-partner-name { font-weight: 600; font-size: 1rem; }
.chat-partner-status { font-size: .78rem; color: var(--accent-teal); }

.chat-header-actions { margin-left: auto; }
.icon-btn {
  width: 36px; height: 36px;
  background: none; border: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-faint);
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg-elevated); color: var(--text-muted); }
.icon-btn svg { width: 18px; height: 18px; }

/* Expiry banner */
.expiry-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  background: rgba(244,185,66,0.1);
  border-bottom: 1px solid rgba(244,185,66,0.2);
  font-size: .85rem; color: var(--accent-gold);
}
.expiry-banner.urgent { background: rgba(232,81,106,0.1); border-color: rgba(232,81,106,0.2); color: var(--primary); }
.expiry-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Messages area */
.messages-area {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column;
}
.messages-area::-webkit-scrollbar { width: 4px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.messages-inner { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }

.chat-empty { text-align: center; color: var(--text-faint); padding: 40px 20px; font-size: .9rem; }

.message-row {
  display: flex; align-items: flex-end; gap: 8px;
  animation: msgSlide 0.2s ease;
}
@keyframes msgSlide { from { opacity: 0; transform: translateY(8px); } }

.message-row.mine { justify-content: flex-end; }
.message-row.theirs { justify-content: flex-start; }

.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 20px;
  position: relative;
  font-size: .93rem; line-height: 1.5;
}
.mine .message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-bottom-right-radius: 4px;
}
.theirs .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-time, .msg-read {
  display: block; font-size: .68rem; margin-top: 4px;
  opacity: .6; text-align: right;
}
.msg-read { margin-top: 0; }

/* Chat input */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.chat-form {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 6px 6px 16px;
  transition: border-color var(--transition);
}
.chat-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.chat-input {
  flex: 1; background: none; border: none;
  color: var(--text); resize: none;
  min-height: 36px; max-height: 120px;
  padding: 6px 0;
  font-size: .95rem;
  outline: none;
  box-shadow: none;
}
.chat-input::placeholder { color: var(--text-faint); }

.send-btn {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 50%; border: none;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  opacity: .5;
}
.send-btn svg { width: 16px; height: 16px; }
.send-btn:not(:disabled) { opacity: 1; box-shadow: 0 2px 10px var(--primary-glow); }
.send-btn:not(:disabled):hover { transform: scale(1.1); }
.send-btn:disabled { cursor: not-allowed; }

.chat-locked {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: .88rem; color: var(--text-muted);
  background: var(--bg);
}
.chat-locked svg { width: 18px; height: 18px; color: var(--text-faint); }

/* ── Profile page ────────────────────────────────────────────── */
.profile-main {
  max-width: 560px; margin: 0 auto;
  padding: 24px 20px;
}

.profile-preview {
  display: flex; gap: 20px; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.preview-photo-wrap { flex-shrink: 0; }
.preview-photo {
  width: 90px; height: 110px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid var(--primary);
}
.preview-photo-placeholder {
  width: 90px; height: 110px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
}
.preview-photo-placeholder svg { width: 32px; height: 32px; }
.preview-info h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; }
.preview-gender { font-size: .82rem; color: var(--text-muted); margin: 2px 0 8px; text-transform: capitalize; }
.preview-bio { font-size: .88rem; color: var(--text-muted); line-height: 1.5; }

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.profile-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; margin-bottom: 20px;
}
.profile-section h4 {
  font-size: .9rem; font-weight: 600; color: var(--text-muted);
  margin: 20px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
}
.photo-thumb.is-primary { border-color: var(--primary); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.primary-badge {
  position: absolute; bottom: 6px; left: 6px;
  background: var(--primary); color: white;
  font-size: .65rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: .05em;
}
.delete-photo-btn {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.7); color: white;
  border: none; border-radius: 50%;
  font-size: .7rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.photo-thumb:hover .delete-photo-btn { opacity: 1; }

.photo-upload-thumb {
  aspect-ratio: 3/4;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
}
.upload-thumb-label {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; color: var(--text-faint);
  transition: all var(--transition);
  font-size: .78rem; text-align: center;
}
.upload-thumb-label:hover { color: var(--primary); border-color: var(--primary); background: rgba(232,81,106,0.05); }
.upload-thumb-label svg { width: 24px; height: 24px; }

.profile-form .btn-primary { margin-top: 8px; }
.danger-zone { border-color: rgba(232,81,106,0.15) !important; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  max-width: 320px; margin: 0 auto;
}
.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 8px; }
.empty-state p  { color: var(--text-muted); margin-bottom: 24px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card-stack { height: 440px; }
  .auth-card  { padding: 24px 20px; }
  .setup-section { padding: 20px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .match-modal { padding: 36px 24px; }
}

@media (min-width: 768px) {
  .app-nav {
    position: fixed; top: 0; bottom: auto; right: auto;
    left: 0; width: 72px;
    height: 100vh;
    flex-direction: column;
    padding: 24px 0;
    border-right: 1px solid var(--border); border-top: none;
    justify-content: flex-start;
    gap: 8px;
  }
  .nav-logo { flex-direction: column; padding: 8px; margin-bottom: 16px; }
  .logo-text { display: none; }
  .nav-links { flex-direction: column; margin-top: auto; padding-bottom: 16px; }

  .app-page { padding-bottom: 0; padding-left: 72px; }
  .chat-page { padding-left: 72px; }

  .discover-main {
    min-height: 100vh;
    justify-content: center;
  }
  .card-stack { height: 560px; max-width: 400px; }
}
