/* =====================================================
   Juftim App — Nikoh va sovchilik platformasi
   Premium, minimal, soft pink palette.
   Mobile-first, Telegram Mini WebApp friendly.
   ===================================================== */

:root {
  /* Pink / Rose palette (spec) */
  --rose-dark:    #9F1239;
  --rose:         #E11D48;
  --rose-soft:    #FCE7F3;
  --blush:        #FFF1F5;
  --rose-bg:      #FFF7FA;
  --burgundy:     #831843;

  --ink:          #1F2937;
  --text:         #1F2937;
  --text-soft:    #374151;
  --muted:        #6B7280;
  --hint:         #9CA3AF;

  --bg:           #FFF7FA;
  --surface:      #FFFFFF;
  --surface-soft: #FFF1F5;
  --line:         #FBCFE8;
  --line-soft:    #FCE7F3;
  --line-strong:  #F9A8D4;

  --success:      #16A34A;
  --success-soft: #ECFDF5;
  --warn:         #D97706;
  --warn-soft:    #FFFBEB;
  --danger:       #DC2626;
  --danger-soft:  #FEF2F2;

  --button-text:  #FFFFFF;
  --grad-main:    linear-gradient(135deg, #E11D48 0%, #BE185D 100%);
  --grad-soft:    linear-gradient(135deg, #FFF1F5 0%, #FCE7F3 100%);
  --grad-bg:      linear-gradient(180deg, #FFF7FA 0%, #FFFFFF 60%, #FFF1F5 100%);

  --shadow-xs:    0 1px 2px rgba(159, 18, 57, 0.05);
  --shadow-sm:    0 2px 8px rgba(159, 18, 57, 0.06), 0 1px 2px rgba(159, 18, 57, 0.04);
  --shadow:       0 8px 24px rgba(159, 18, 57, 0.08), 0 2px 6px rgba(159, 18, 57, 0.04);
  --shadow-lg:    0 20px 40px rgba(159, 18, 57, 0.12), 0 6px 12px rgba(159, 18, 57, 0.06);
  --shadow-rose:  0 12px 28px rgba(225, 29, 72, 0.18);

  --radius-sm:    12px;
  --radius:       18px;
  --radius-lg:    22px;
  --radius-xl:    28px;
  --radius-pill:  999px;

  --fs-xs:        clamp(11px, 2.6vw, 12px);
  --fs-sm:        clamp(12px, 3.0vw, 13px);
  --fs-md:        clamp(13px, 3.4vw, 14px);
  --fs-base:      clamp(14px, 3.6vw, 15px);
  --fs-lg:        clamp(16px, 4.2vw, 18px);
  --fs-xl:        clamp(19px, 5.2vw, 22px);
  --fs-2xl:       clamp(22px, 6.4vw, 28px);
  --fs-3xl:       clamp(26px, 7.4vw, 34px);

  --pad-content:  clamp(14px, 4vw, 22px);
  --gap-md:       clamp(12px, 3vw, 16px);

  --tg-button:      var(--rose);
  --tg-button-text: #FFFFFF;
  --tg-top-inset:   0px;
}

/* -------- Reset -------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb  { background: var(--line-strong); border-radius: 999px; }
*::-webkit-scrollbar-track  { background: transparent; }

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--grad-bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
a   { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* =====================================================
   Layout shell
   ===================================================== */
.app-shell {
  width: 100%;
  max-width: 980px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
}

/* =====================================================
   Header
   ===================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px var(--pad-content) 14px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(255, 247, 250, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
}
.app-header.compact {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 10px;
  align-items: center;
}
html.is-tg-fullscreen .app-header {
  position: relative;
  top: auto;
  padding-top: calc(var(--tg-top-inset, 92px) + 10px);
  padding-bottom: 14px;
}
html.is-tg-fullscreen body.home-page .app-header {
  padding-top: max(72px, calc(env(safe-area-inset-top) + 42px));
}
html.is-tg-fullscreen .brand-logo {
  font-size: clamp(22px, 6vw, 28px);
}
.app-header > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.app-header h1 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--burgundy);
}
.app-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--burgundy);
  font-size: clamp(22px, 6.4vw, 28px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.brand-logo::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--grad-main);
  box-shadow: var(--shadow-rose);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header-action {
  display: inline-flex;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--surface);
  color: var(--burgundy);
  border: 1px solid var(--line-soft);
  transition: background .15s ease, transform .15s ease;
}
.header-action svg { stroke: currentColor; }

/* =====================================================
   Content
   ===================================================== */
.content { padding: var(--pad-content); }
.with-bottom-nav { padding-bottom: 100px; }

.icon, svg {
  width: 18px; height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =====================================================
   Hero (home page)
   ===================================================== */
.hero {
  position: relative;
  margin-bottom: 22px;
  padding: clamp(24px, 6vw, 38px) clamp(22px, 5vw, 32px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(225, 29, 72, 0.12), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(252, 231, 243, 0.7), transparent 55%),
    linear-gradient(135deg, #FFFFFF 0%, #FFF1F5 100%);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hero h2 {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--burgundy);
  line-height: 1.2;
}
.hero p {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: var(--fs-md);
  line-height: 1.6;
  max-width: 36ch;
}
.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

/* =====================================================
   Stats row (home page)
   ===================================================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 22px;
}
.stat-card {
  padding: 16px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  text-align: center;
  box-shadow: var(--shadow-xs);
}
.stat-card strong {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--burgundy);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =====================================================
   Type cards (Kelin / Kuyov)
   ===================================================== */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.type-card {
  position: relative;
  padding: 22px 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  text-align: left;
  color: var(--text);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.type-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--grad-main);
}
.type-card.is-groom::before {
  background: linear-gradient(135deg, #6366F1, #4338CA);
}
.type-card h3 {
  margin: 8px 0 4px;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--burgundy);
}
.type-card.is-groom h3 { color: #312E81; }
.type-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.type-card strong {
  display: block;
  margin-top: 12px;
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--burgundy);
}
.type-card.is-groom strong { color: #312E81; }

/* =====================================================
   Section heading
   ===================================================== */
.section-heading {
  margin: 24px 4px 14px;
}
.section-heading h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--burgundy);
}
.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

/* =====================================================
   Tabs (Kelin / Kuyov)
   ===================================================== */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-xs);
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tab.is-active {
  background: var(--grad-main);
  color: #FFFFFF;
  box-shadow: var(--shadow-rose);
}

/* =====================================================
   Search + filter row
   ===================================================== */
.search-card {
  position: sticky;
  top: 12px;
  z-index: 25;
  padding: 10px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .28s ease, opacity .28s ease;
}
.search-card.is-hidden {
  transform: translateY(-130%);
  opacity: 0;
  pointer-events: none;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--rose-bg);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.search-row:focus-within {
  border-color: var(--rose);
  background: var(--surface);
}
.search-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
}
.search-row input::placeholder { color: var(--hint); opacity: 1; }
.search-row button {
  display: inline-flex;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 0;
  border-radius: 10px;
  background: var(--grad-main);
  color: var(--button-text);
  cursor: pointer;
  transition: opacity .15s ease;
}
.search-row button svg { width: 18px; height: 18px; }

/* =====================================================
   Buttons
   ===================================================== */
.primary-link, .primary-btn, .secondary-btn,
.ghost-btn, .plain-btn, .call-btn, .secondary-link {
  display: inline-flex;
  min-height: 46px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 600;
  font-size: var(--fs-base);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.primary-link, .primary-btn, .call-btn {
  background: var(--grad-main);
  color: var(--button-text);
  box-shadow: var(--shadow-rose);
}
.secondary-btn, .secondary-link {
  background: var(--surface);
  color: var(--burgundy);
  border-color: var(--line);
}
.ghost-btn {
  background: transparent;
  color: var(--burgundy);
  border-color: var(--line);
}
.plain-btn {
  background: transparent;
  color: var(--muted);
}
.wide { width: 100%; }
.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #FCA5A5;
}

/* =====================================================
   Cards (candidates list)
   ===================================================== */
.cards {
  display: grid;
  gap: var(--gap-md);
  grid-auto-rows: 1fr;
  transition: opacity .18s ease, transform .18s ease;
}
.cards.is-refreshing {
  opacity: .45;
  transform: translateY(6px);
}
.cards.is-updated .card {
  animation: card-in .42s ease both;
}
.cards.is-updated .card:nth-child(2) { animation-delay: .04s; }
.cards.is-updated .card:nth-child(3) { animation-delay: .08s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
}
.candidate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--rose-soft);
  color: var(--rose-dark);
}
.candidate-badge.is-groom {
  background: #E0E7FF;
  color: #3730A3;
}
.candidate-code {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
}

.card-body {
  padding: 12px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.card-body h3 {
  margin: 6px 0 6px;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--burgundy);
  letter-spacing: -0.015em;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 8px;
}
.info-grid span,
.district {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.info-grid span svg,
.district svg { color: var(--rose); width: 15px; height: 15px; }

.description {
  display: -webkit-box;
  margin: 12px 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.date {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 700;
}

/* =====================================================
   States
   ===================================================== */
.state {
  padding: clamp(22px, 5vw, 32px);
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  background: var(--blush);
  border-radius: var(--radius);
}
.state h2 {
  margin: 0 0 8px;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--burgundy);
}
.state .primary-btn {
  margin-top: 14px;
  min-height: 42px;
}

.load-more {
  width: 100%;
  margin: 18px 0 30px;
  background: var(--surface);
  color: var(--burgundy);
  border: 1px solid var(--line);
}

/* =====================================================
   Detail page
   ===================================================== */
.detail-content {
  max-width: 760px;
  margin: 0 auto;
}
.detail-card {
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.detail-cover {
  padding: 24px 22px 20px;
  background: var(--grad-soft);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-cover h2 {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--burgundy);
}
.detail-cover p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.detail-body {
  padding: 20px 22px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.detail-grid div {
  padding: 14px;
  border-radius: 14px;
  background: var(--blush);
  border: 1px solid var(--line-soft);
}
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.detail-grid strong {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--burgundy);
}
.detail-section {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--blush);
  border: 1px solid var(--line-soft);
}
.detail-section h3 {
  margin: 0 0 8px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--burgundy);
}
.detail-section p {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--fs-md);
  line-height: 1.6;
  white-space: pre-line;
}

.locked-phone {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.locked-phone strong {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--burgundy);
}
.locked-phone p {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.locked-phone .primary-btn { width: 100%; justify-content: center; }

/* =====================================================
   Multi-step form (Application)
   ===================================================== */
.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.step-dot {
  flex: 1 1 0;
  height: 6px;
  border-radius: 999px;
  background: var(--line-soft);
  transition: background .2s ease;
}
.step-dot.is-active { background: var(--grad-main); }
.step-dot.is-done   { background: var(--rose); opacity: .7; }

.form-card {
  padding: clamp(18px, 4vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.form-card h2 {
  margin: 0 0 6px;
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--burgundy);
}
.form-card .form-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--rose-bg);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 500;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--hint); opacity: 1; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rose);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.10);
}
.field .field-hint {
  color: var(--muted);
  font-size: 11px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.is-checked,
.choice:has(input:checked) {
  border-color: var(--rose);
  background: var(--rose-soft);
  color: var(--burgundy);
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-nav {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}
.form-nav .ghost-btn { flex: 0 0 auto; }
.form-nav .primary-btn { flex: 1 1 auto; }

.form-errors {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid #FCA5A5;
}
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }
.form-errors[hidden] { display: none; }

/* =====================================================
   Preview
   ===================================================== */
.preview-card {
  padding: clamp(18px, 4vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.preview-head .candidate-badge { font-size: 12px; }
.preview-rows {
  display: grid;
  gap: 8px;
}
.preview-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
}
.preview-row:last-child { border-bottom: 0; }
.preview-row span {
  color: var(--muted);
  font-weight: 500;
}
.preview-row strong {
  color: var(--text);
  font-weight: 600;
}
.preview-section {
  margin-top: 14px;
  padding: 14px;
  background: var(--blush);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
.preview-section h4 {
  margin: 0 0 6px;
  color: var(--burgundy);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.preview-section p {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--fs-md);
  line-height: 1.6;
  white-space: pre-line;
}

/* =====================================================
   My profile status
   ===================================================== */
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-xs);
}
.status-card .status-text strong {
  display: block;
  color: var(--burgundy);
  font-size: var(--fs-md);
  font-weight: 700;
}
.status-card .status-text span {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.status-pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-pill.is-pending   { background: var(--warn-soft); color: var(--warn); }
.status-pill.is-approved  { background: var(--success-soft); color: var(--success); }
.status-pill.is-rejected  { background: var(--danger-soft); color: var(--danger); }
.status-pill.is-archived  { background: var(--rose-soft); color: var(--rose-dark); }

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

/* =====================================================
   Bottom nav
   ===================================================== */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  width: min(100%, 980px);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line-soft);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.bottom-nav a,
.bottom-nav button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 72px;
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.bottom-nav .is-active {
  color: var(--rose-dark);
  background: var(--rose-soft);
}
.bottom-nav svg { width: 22px; height: 22px; }

/* Anketa nav — accentuated "+" icon */
.bottom-nav .nav-anketa svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 50%;
  background: var(--grad-main);
  color: #fff;
  box-shadow: var(--shadow-rose);
  stroke-width: 2.4;
  margin-bottom: -4px;
}
.bottom-nav .nav-anketa.is-active {
  background: transparent;
}
.bottom-nav .nav-anketa.is-active svg {
  transform: scale(1.04);
}
@media (max-width: 359px) {
  .bottom-nav { gap: 18px; }
  .bottom-nav a, .bottom-nav button { min-width: 64px; padding: 6px 6px; font-size: 10px; }
}

/* =====================================================
   Toast / inline messages
   ===================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(80px, env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  z-index: 90;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--burgundy);
  color: #FFFFFF;
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: var(--danger); }
.toast.is-ok    { background: var(--success); }

/* =====================================================
   Spinner
   ===================================================== */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 359px) {
  .hero-actions, .two-cols, .choice-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .info-grid, .detail-grid { grid-template-columns: 1fr; }
  .bottom-nav a, .bottom-nav button { padding: 6px 2px; font-size: 10px; }
  .preview-row { grid-template-columns: 110px 1fr; }
}
@media (min-width: 720px) {
  .cards      { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-card  { max-width: 720px; margin: 0 auto; }
}
@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =====================================================
   Hover (desktop)
   ===================================================== */
@media (hover: hover) and (pointer: fine) {
  .header-action:hover { background: var(--blush); }
  .primary-link:hover, .primary-btn:hover, .call-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
  }
  .secondary-btn:hover, .secondary-link:hover { background: var(--blush); border-color: var(--rose); }
  .ghost-btn:hover { background: var(--blush); }
  .plain-btn:hover { color: var(--burgundy); }
  .card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--shadow); }
  .type-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--shadow); }
  .choice:hover { border-color: var(--rose); }
  .load-more:hover { background: var(--blush); }
  .tab:not(.is-active):hover { color: var(--burgundy); background: var(--blush); }
  .bottom-nav a:hover, .bottom-nav button:hover { color: var(--burgundy); }
}

/* =====================================================
   Accessibility
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .primary-link, .primary-btn { background: ButtonText; color: ButtonFace; }
  .card, .form-card, .preview-card { border: 1px solid CanvasText; }
}

/* =====================================================
   v2 — Home tabs row, filter button, sheet grabber
   ===================================================== */
.tabs-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.tabs-row .tabs { margin: 0; flex: 1 1 auto; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--burgundy);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  position: relative;
}
.filter-btn svg { width: 16px; height: 16px; }
.filter-btn:hover { background: var(--blush); border-color: var(--rose); }
.filter-btn .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--grad-main);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(31, 41, 55, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease;
}
.sheet-open .sheet-backdrop { opacity: 1; }
.sheet-backdrop[hidden] { display: none; }

.filter-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 70;
  width: min(100%, 720px);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 14px 20px calc(22px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -16px 48px rgba(159, 18, 57, 0.16);
  transform: translate(-50%, 105%);
  transition: transform .28s cubic-bezier(.2, .7, .3, 1);
  -webkit-overflow-scrolling: touch;
}
.sheet-open .filter-sheet { transform: translate(-50%, 0); }
.filter-sheet[hidden] { display: none; }

.sheet-grabber {
  width: 44px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--line-strong);
  opacity: 0.7;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sheet-header strong {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--burgundy);
  letter-spacing: -0.01em;
}
.sheet-header span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* =====================================================
   v2 — Card layout with premium CTA at bottom
   ===================================================== */
.card-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.card-cta .ghost-btn,
.card-cta .primary-btn {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
}

/* =====================================================
   v2 — Premium contact card (detail page)
   ===================================================== */
.premium-contact {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #FFF1F5 0%, #FCE7F3 100%);
  border: 1px solid var(--line);
  position: relative;
}
.premium-contact[data-state="revealed"] {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border-color: #A7F3D0;
}

.premium-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.premium-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--grad-main);
  color: #fff;
  box-shadow: var(--shadow-rose);
  flex-shrink: 0;
}
.premium-contact[data-state="revealed"] .premium-icon {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.30);
}
.premium-head strong {
  display: block;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--burgundy);
  line-height: 1.3;
}
.premium-contact[data-state="revealed"] .premium-head strong { color: #065F46; }
.premium-head span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.contact-rows {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}
.contact-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  font-size: var(--fs-sm);
}
.premium-contact[data-state="revealed"] .contact-row {
  background: rgba(255, 255, 255, 0.85);
}
.contact-row span {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contact-row strong {
  color: var(--burgundy);
  font-weight: 700;
  font-feature-settings: "tnum";
  word-break: break-all;
  font-size: var(--fs-md);
}
.premium-contact[data-state="revealed"] .contact-row strong { color: #047857; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  color: #047857;
  border: 1px solid #A7F3D0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.copy-btn:hover { background: #047857; color: #fff; }

.contact-actions {
  display: grid;
  gap: 8px;
}
.contact-actions .secondary-btn {
  background: #fff;
  border-color: #A7F3D0;
  color: #047857;
}

/* =====================================================
   v2 — Profile page
   ===================================================== */
.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-xs);
}
.avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 16px rgba(159, 18, 57, 0.18);
}
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-main);
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.user-info {
  flex: 1 1 auto;
  min-width: 0;
}
.user-info strong {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--burgundy);
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-info span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 2px;
}
.user-info .user-id {
  font-size: 11px;
  color: var(--hint);
  margin-top: 4px;
  font-feature-settings: "tnum";
}

.premium-card {
  padding: 18px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #FFF1F5 0%, #FCE7F3 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.premium-card[data-state="active"] {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border-color: #A7F3D0;
}
.premium-card[data-state="active"] .premium-icon {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}
.premium-card[data-state="active"] .premium-head strong { color: #065F46; }

/* Draft resume card on /profil */
.draft-resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.draft-resume-card strong {
  display: block;
  color: var(--burgundy);
  font-size: var(--fs-md);
  font-weight: 700;
}
.draft-resume-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.draft-resume-card .draft-actions {
  display: flex;
  gap: 6px;
}
.draft-resume-card .primary-btn,
.draft-resume-card .ghost-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 999px;
}

/* Draft banner on /anketa */
.draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.draft-banner[hidden] { display: none; }
.draft-banner .draft-text strong {
  display: block;
  color: var(--burgundy);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.draft-banner .draft-text span {
  color: var(--muted);
  font-size: 11px;
}
.draft-banner .ghost-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 999px;
}

/* =====================================================
   v2 — Tighter cards (since premium CTA added)
   ===================================================== */
.card .card-body { padding-bottom: 14px; }

