/* ============================================================
   Design tokens
   Palette grounded in the brief: seriousness through to marriage,
   a Levantine visual world (pomegranate, olive, aged gold) rather
   than a generic dating-app look. Signature element: the "seal"
   (חותם) — expressing interest presses a wax-seal ring, not a swipe.
   ============================================================ */
:root {
  --ink: #221D1A;
  --parchment: #F7F0E4;
  --parchment-dim: #EFE5D3;
  --pomegranate: #93213B;
  --pomegranate-dark: #6E1830;
  --olive: #57624A;
  --gold: #B8933F;
  --dusk: #232B45;

  --font-display: "Frank Ruhl Libre", "Times New Deco", serif;
  --font-body: "Heebo", -apple-system, sans-serif;
  --font-data: "IBM Plex Mono", monospace;

  --radius: 4px;
  --shadow-seal: 0 1px 0 rgba(34,29,26,0.06), 0 6px 16px rgba(34,29,26,0.10);
}

* { box-sizing: border-box; }

html {
  direction: rtl;
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--parchment);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(34,29,26,0.08);
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--pomegranate-dark);
  letter-spacing: 0.5px;
}
.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink);
  opacity: 0.55;
  letter-spacing: 0.3px;
}
.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--ink);
  opacity: 0.7;
  padding: 6px;
}

/* ---------- Screen container ---------- */
.screen {
  flex: 1;
  padding: 24px 20px 100px;
  animation: fade-in 0.25s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
h1.screen-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
p.screen-sub {
  margin: 0 0 28px;
  color: var(--ink);
  opacity: 0.65;
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---------- Seal divider (signature motif) ---------- */
.seal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0;
  opacity: 0.5;
}
.seal-divider::before, .seal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink);
  opacity: 0.15;
}
.seal-divider svg { width: 16px; height: 16px; }

/* ---------- Form elements ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field .hint {
  font-size: 11.5px;
  opacity: 0.55;
  margin-top: 4px;
}
input[type="text"], input[type="tel"], input[type="password"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(34,29,26,0.18);
  border-radius: var(--radius);
  background: #FFFDF9;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pomegranate);
  box-shadow: 0 0 0 3px rgba(147,33,59,0.12);
}
textarea { resize: vertical; min-height: 80px; }

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice-chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(34,29,26,0.18);
  background: #FFFDF9;
  font-size: 13.5px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
}
.choice-chip.selected {
  background: var(--pomegranate);
  border-color: var(--pomegranate);
  color: #FBF3E6;
}

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background: var(--pomegranate);
  color: #FBF3E6;
  box-shadow: var(--shadow-seal);
}
.btn-primary:active { background: var(--pomegranate-dark); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(34,29,26,0.18);
}
.btn-link {
  background: none;
  border: none;
  color: var(--pomegranate-dark);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  padding: 8px 0;
}
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.error-banner {
  background: rgba(147,33,59,0.08);
  border: 1px solid rgba(147,33,59,0.25);
  color: var(--pomegranate-dark);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- Profile / suggestion cards ---------- */
.card {
  background: #FFFDF9;
  border: 1px solid rgba(34,29,26,0.10);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-seal);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.card-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}
.card-meta {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--olive);
  margin-top: 3px;
}
.badge {
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold);
  text-transform: uppercase;
}
.card-bio {
  font-size: 13.5px;
  line-height: 1.55;
  opacity: 0.8;
  margin: 10px 0 14px;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tag {
  font-size: 11.5px;
  background: var(--parchment-dim);
  padding: 4px 9px;
  border-radius: 4px;
  color: var(--ink);
  opacity: 0.75;
}

/* Seal button — the signature interaction */
.seal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: var(--dusk);
  color: var(--gold);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.seal-btn:active { transform: scale(0.97); }
.seal-btn.pressed {
  background: var(--olive);
  color: #FBF3E6;
}
.seal-btn svg { width: 18px; height: 18px; }

/* ---------- Match / chat ---------- */
.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(34,29,26,0.08);
  cursor: pointer;
}
.match-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--dusk);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 17px;
}
.match-info { flex: 1; }
.match-name { font-weight: 700; font-size: 14.5px; }
.match-status { font-size: 12px; opacity: 0.55; margin-top: 2px; }

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.chat-bubble.mine {
  background: var(--pomegranate);
  color: #FBF3E6;
  margin-inline-start: auto;
  border-bottom-left-radius: 3px;
}
.chat-bubble.theirs {
  background: var(--parchment-dim);
  color: var(--ink);
  border-bottom-right-radius: 3px;
}
.chat-input-row {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--parchment);
  border-top: 1px solid rgba(34,29,26,0.1);
}
.chat-input-row input { flex: 1; }
.chat-input-row button {
  width: 46px;
  border-radius: var(--radius);
  background: var(--pomegranate);
  color: #FBF3E6;
  border: none;
  font-size: 16px;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--dusk);
  padding: 10px 0 14px;
}
.nav-item {
  flex: 1;
  text-align: center;
  background: none;
  border: none;
  color: rgba(247,240,228,0.5);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  padding: 4px;
}
.nav-item.active { color: var(--gold); }
.nav-item .nav-icon { display: block; font-size: 18px; margin-bottom: 3px; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  opacity: 0.6;
}
.empty-state .seal-mark { margin-bottom: 14px; }

.step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.step-dots span {
  height: 3px;
  flex: 1;
  background: rgba(34,29,26,0.12);
  border-radius: 2px;
}
.step-dots span.done { background: var(--pomegranate); }

.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(34,29,26,0.15);
  border-top-color: var(--pomegranate);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Settings rows (profile management entry points) ---------- */
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(34,29,26,0.08);
  cursor: pointer;
}
.settings-row .s-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--parchment-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--pomegranate-dark);
  flex-shrink: 0;
}
.settings-row .s-icon svg { width: 18px; height: 18px; }
.settings-row .s-body { flex: 1; min-width: 0; }
.settings-row .s-title { font-weight: 700; font-size: 14.5px; }
.settings-row .s-sub { font-size: 12px; opacity: 0.55; margin-top: 2px; }
.settings-row .s-chevron { opacity: 0.35; flex-shrink: 0; }
.settings-row .s-chevron svg { width: 16px; height: 16px; }
.settings-row.danger .s-icon { background: rgba(147,33,59,0.1); color: var(--pomegranate-dark); }
.settings-row.danger .s-title { color: var(--pomegranate-dark); }

/* ---------- Photo gallery management ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.photo-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--parchment-dim);
}
.photo-slot.empty {
  border: 1.5px dashed rgba(34,29,26,0.28);
  background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink); opacity: 0.5; font-size: 10.5px; text-align: center; cursor: pointer;
}
.photo-slot.empty svg { width: 20px; height: 20px; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot.blurred img { filter: blur(10px); transform: scale(1.1); }
.photo-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(34,29,26,0.72); color: #FBF3E6;
  font-family: var(--font-data); font-size: 8.5px; letter-spacing: 0.3px;
  padding: 3px 6px; border-radius: 3px;
  display: flex; align-items: center; gap: 3px;
}
.photo-badge svg { width: 10px; height: 10px; }
.photo-remove {
  position: absolute; top: 6px; left: 6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(34,29,26,0.55); color: #FBF3E6;
  border: none; display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; cursor: pointer;
}
.photo-star {
  position: absolute; bottom: 6px; left: 6px;
  background: var(--gold); color: var(--ink);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.photo-star svg { width: 12px; height: 12px; }

/* ---------- Identity verification ---------- */
.upload-dropzone {
  display: block;
  border: 1.5px dashed rgba(34,29,26,0.28);
  border-radius: 6px;
  padding: 30px 18px;
  text-align: center;
  margin-bottom: 22px;
  background: #FFFDF9;
  cursor: pointer;
}
.upload-dropzone svg { width: 30px; height: 30px; color: var(--olive); margin-bottom: 12px; }
.upload-dropzone .up-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.upload-dropzone .up-hint { font-size: 12px; opacity: 0.55; }

.privacy-note {
  display: flex; gap: 12px;
  background: rgba(87,98,74,0.08);
  border: 1px solid rgba(87,98,74,0.25);
  border-radius: var(--radius);
  padding: 14px;
  margin: 22px 0;
}
.privacy-note svg { width: 18px; height: 18px; color: var(--olive); flex-shrink: 0; margin-top: 1px; }
.privacy-note p { margin: 0; font-size: 12.5px; line-height: 1.65; opacity: 0.85; }
.privacy-note strong { color: var(--olive); }

/* ---------- Account deletion ---------- */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.check-list svg { width: 15px; height: 15px; color: var(--pomegranate-dark); flex-shrink: 0; margin-top: 2px; }

.confirm-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #FFFDF9;
  border: 1.5px solid rgba(34,29,26,0.18);
  border-radius: var(--radius);
  padding: 14px;
  margin: 20px 0;
  cursor: pointer;
}
.confirm-row input[type="checkbox"] {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  accent-color: var(--pomegranate-dark);
}
.confirm-row span { font-size: 12.5px; line-height: 1.55; opacity: 0.85; }

.btn-danger { background: var(--pomegranate-dark); color: #FBF3E6; box-shadow: var(--shadow-seal); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
