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

:root {
  --rose: #e85d75;
  --rose-dark: #c9445c;
  --rose-light: #fce8ec;
  --peach: #ffb4a2;
  --cream: #fff9f5;
  --ink: #1a1215;
  --ink-muted: #6b5c62;
  --ink-faint: #a8989e;
  --surface: #ffffff;
  --border: #f0e4e8;
  --success: #2d9a6f;
  --shadow: 0 4px 24px rgba(232, 93, 117, 0.12);
  --shadow-lg: 0 12px 40px rgba(26, 18, 21, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 999px;
  --font: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --nav-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: linear-gradient(160deg, #fff5f0 0%, #fce8ec 50%, #f5e6f0 100%);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
}

.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  box-shadow: var(--shadow-lg);
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}

.screen.no-nav { padding-bottom: var(--safe-bottom); }

/* Typography */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
p { color: var(--ink-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.text-center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(232, 93, 117, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(232, 93, 117, 0.45); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--rose);
  padding: 10px 16px;
}
.btn-icon {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.25rem;
}
.btn-sm { padding: 10px 18px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn-like { background: var(--rose-light); color: var(--rose); }
.btn-pass { background: #f0f0f0; color: var(--ink-muted); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--rose);
}
.form-textarea { min-height: 100px; resize: vertical; }

/* Header */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-bar h1 { font-size: 1.25rem; }
.top-bar .logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rose);
  text-decoration: none;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
}
.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--rose);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 8px 12px;
  transition: color 0.15s;
}
.nav-item.active { color: var(--rose); }
.nav-item .nav-icon { font-size: 1.375rem; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-flat {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
}

/* Profile Card (Discover) */
.profile-card {
  margin: 0 20px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.profile-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, var(--peach), var(--rose-light));
}
.profile-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
}
.profile-card-info h2 { color: white; font-size: 1.75rem; }
.profile-card-info p { color: rgba(255,255,255,0.85); }
.profile-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  margin-bottom: 8px;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 24px 20px;
}

/* Avatar */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--peach), var(--rose));
}
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }

/* Lists */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.list-item:hover { background: var(--rose-light); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.9375rem; }
.list-item-sub { font-size: 0.8125rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 6px 14px;
  background: var(--rose-light);
  color: var(--rose-dark);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
}
.tag-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink-muted);
}

/* Recommendation card */
.rec-card {
  margin: 0 20px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--rose);
}
.rec-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--rose-light);
}
.rec-card-body { padding: 16px; }
.rec-card-body .quote {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  border-left: 3px solid var(--peach);
  padding-left: 12px;
  margin: 12px 0;
}
.rec-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rec-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* Chat */
.chat-list-avatar { position: relative; }
.online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.chat-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9375rem;
  margin-bottom: 8px;
}
.chat-bubble.sent {
  background: var(--rose);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
}
.chat-input-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.9375rem;
}

/* Match grid */
.match-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 20px;
}
.match-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 3/4;
  text-decoration: none;
  color: white;
}
.match-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.match-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.6));
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.match-card-name { font-weight: 600; font-size: 0.9375rem; }

/* Settings */
.settings-section {
  padding: 8px 0;
}
.settings-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 16px 20px 8px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.settings-row-label { font-weight: 500; }
.toggle {
  width: 48px;
  height: 28px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle.on { background: var(--rose); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(20px); }

/* Welcome / Auth screens */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
}
.hero-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--rose), var(--peach));
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 32px;
  box-shadow: 0 8px 32px rgba(232, 93, 117, 0.3);
}
.hero h1 { margin-bottom: 12px; }
.hero p { margin-bottom: 32px; max-width: 280px; }
.auth-footer {
  padding: 24px 32px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Onboarding */
.onboarding-progress {
  display: flex;
  gap: 6px;
  padding: 0 20px 20px;
}
.progress-dot {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.progress-dot.active { background: var(--rose); }
.photo-upload {
  width: 140px;
  height: 140px;
  border-radius: 20px;
  border: 3px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-faint);
  cursor: pointer;
  margin: 0 auto 24px;
  transition: border-color 0.15s;
}
.photo-upload:hover { border-color: var(--rose); }
.interest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px;
}
.interest-chip {
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
}
.interest-chip.selected {
  border-color: var(--rose);
  background: var(--rose-light);
  color: var(--rose-dark);
}

/* Content padding */
.content { padding: 0 20px 20px; flex: 1; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
}
.section-header h2 { font-size: 1.125rem; }

/* Notification */
.notif-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.notif-item.unread { background: var(--rose-light); }
.notif-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.notif-icon.rec { background: var(--rose-light); }
.notif-icon.match { background: #e8f5ef; }
.notif-icon.msg { background: #eef0ff; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 32px;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }

/* Profile page */
.profile-hero {
  text-align: center;
  padding: 32px 20px;
}
.profile-hero .avatar-xl { margin: 0 auto 16px; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 20px 0;
}
.stat { text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--rose); }
.stat-label { font-size: 0.75rem; color: var(--ink-muted); }

/* Friend recommend flow */
.friend-select-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.15s;
}
.friend-select-card.selected {
  border-color: var(--rose);
  background: var(--rose-light);
}
.friend-select-card input { display: none; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 0 20px 20px;
}
.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font);
}
.tab.active {
  background: var(--surface);
  color: var(--rose);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Utility */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.divider { height: 8px; background: var(--border); margin: 8px 0; }

/* Placeholder avatars with initials */
.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}
.avatar-placeholder.lg { font-size: 1.75rem; }
