@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --navy: #0f1e3d;
  --navy-mid: #1a2f5a;
  --navy-light: #2a4580;
  --copper: #B87333;
  --copper-light: #d4956a;
  --copper-pale: #f5ede4;
  --cream: #faf8f5;
  --cream-mid: #f0ece4;
  --white: #ffffff;
  --text-primary: #0f1e3d;
  --text-secondary: #4a5568;
  --text-muted: #8a97aa;
  --border: rgba(15,30,61,0.1);
  --border-mid: rgba(15,30,61,0.18);
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --info: #1565c0;
  --info-bg: #e3f2fd;
  --warning: #f57f17;
  --warning-bg: #fff8e1;
  --purple: #6a1b9a;
  --purple-bg: #f3e5f5;
  --danger: #c62828;
  --danger-bg: #ffebee;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15,30,61,0.08);
  --shadow-md: 0 4px 16px rgba(15,30,61,0.1);
  --shadow-lg: 0 8px 32px rgba(15,30,61,0.12);
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
}

a { color: var(--copper); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

img { max-width: 100%; height: auto; }

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

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 24px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--transition); border: none;
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-copper { background: var(--copper); color: var(--white); }
.btn-copper:hover { background: var(--copper-light); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--navy); border: 1px solid var(--border-mid); }
.btn-outline:hover { background: var(--cream-mid); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { color: var(--navy); background: var(--cream-mid); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--border); background: var(--cream); }

/* ── Form elements ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border-mid); background: var(--white);
  font-family: var(--font-body); font-size: 14px; color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--copper); box-shadow: 0 0 0 3px rgba(184,115,51,0.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select {
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 500;
}
.badge-verified { background: var(--success-bg); color: var(--success); }
.badge-background { background: var(--info-bg); color: var(--info); }
.badge-financial { background: var(--warning-bg); color: var(--warning); }
.badge-photo { background: var(--purple-bg); color: var(--purple); }
.badge-pending { background: var(--cream-mid); color: var(--text-muted); }
.badge-copper { background: var(--copper-pale); color: var(--copper); }

/* ── Navigation ── */
.nav-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--white);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  color: var(--navy); letter-spacing: 0.3px;
}
.nav-logo span { color: var(--copper); }

.nav-bottom {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom)); z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 6px 4px; cursor: pointer; transition: all var(--transition);
  color: var(--text-muted); background: none; border: none; font-family: var(--font-body);
}
.nav-item.active { color: var(--copper); }
.nav-item:hover { color: var(--navy); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 500; }
.nav-badge {
  position: absolute; top: 4px; right: calc(50% - 18px);
  background: var(--copper); color: var(--white); border-radius: var(--radius-full);
  font-size: 9px; font-weight: 500; padding: 1px 5px; min-width: 16px;
  text-align: center;
}

/* ── Progress bar ── */
.progress { height: 6px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--copper); border-radius: var(--radius-full); transition: width 0.4s ease; }

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--white); }
.tab-item {
  flex: 1; padding: 12px 8px; font-size: 13px; font-weight: 500;
  text-align: center; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all var(--transition);
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: var(--font-body);
}
.tab-item.active { color: var(--copper); border-bottom-color: var(--copper); }
.tab-item:hover:not(.active) { color: var(--navy); background: var(--cream); }

/* ── Chip filters ── */
.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--border-mid); background: var(--white);
  color: var(--text-secondary); transition: all var(--transition);
}
.chip.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.chip:hover:not(.active) { border-color: var(--copper); color: var(--copper); }

/* ── Avatar ── */
.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; flex-shrink: 0; overflow: hidden;
}
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-xl { width: 88px; height: 88px; font-size: 32px; }
.avatar-navy { background: var(--navy); color: var(--white); }
.avatar-copper { background: var(--copper); color: var(--white); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.divider-text {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
  font-size: 12px; color: var(--text-muted);
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Toast notifications ── */
.toast-container { position: fixed; top: 80px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy); color: var(--white); padding: 12px 16px;
  border-radius: var(--radius-md); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 300px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-copper { background: var(--copper); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateX(100%); } }

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--copper); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,30,61,0.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-overlay.center { align-items: center; }
.modal {
  background: var(--white); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  padding: 24px 20px; animation: slideUp 0.3s ease;
}
.modal.center-modal { border-radius: var(--radius-xl); }
.modal-handle { width: 40px; height: 4px; background: var(--border-mid); border-radius: var(--radius-full); margin: 0 auto 20px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Page wrapper ── */
.page { min-height: 100vh; padding-bottom: 80px; }
.page-content { padding: 16px; max-width: 480px; margin: 0 auto; }
.section-label {
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px;
}

/* ── Compatibility score ── */
.compat-ring {
  width: 56px; height: 56px; border-radius: 50%;
  background: conic-gradient(var(--copper) 0%, var(--copper) var(--pct), var(--border) var(--pct));
  display: flex; align-items: center; justify-content: center; position: relative;
}
.compat-inner {
  width: 44px; height: 44px; border-radius: 50%; background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--navy);
}

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* ── Utility ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-copper { color: var(--copper); }
.text-navy { color: var(--navy); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-display { font-family: var(--font-display); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
