/* ============================================================
   Ghalbak (قلبک) — pink romantic theme, RTL, Farsi
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-wght.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --rose-50:  #fff5f8;
  --rose-100: #ffe4ee;
  --rose-200: #fecdd8;
  --rose-300: #f9a8c0;
  --rose-400: #f06292;
  --rose-500: #e91e63;
  --rose-600: #c2185b;
  --rose-700: #9c1450;
  --cream:    #fff9fb;
  --ink:      #4a2333;
  --ink-soft: #8a5a70;
  --white:    #ffffff;
  --glass:        rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .85);
  --chip-x-bg:    rgba(255, 255, 255, .7);
  --badge-bg:     rgba(255, 255, 255, .92);
  --danger-bg:   #fff0f3;
  --danger-text: #c2185b;
  --ok-bg:     #e8f8ee;
  --ok-text:   #1b7a45;
  --ok-border: #bfe8cf;
  --glow-1: rgba(249, 168, 192, .28);
  --glow-2: rgba(240, 98, 146, .18);
  --shadow:   0 10px 30px rgba(var(--accent-rgb),.14);
  --shadow-lg:0 22px 50px rgba(var(--accent-rgb),.22);
  --radius:   22px;
  --radius-sm:14px;
  --grad:     linear-gradient(135deg, #fff5f8 0%, #ffe4ee 50%, #fecdd8 100%);
  --grad-btn: linear-gradient(135deg, #f06292, #e91e63);
  --grad-hero:linear-gradient(160deg, #fff5f8 0%, #ffd9e8 40%, #f9a8c0 100%);
  --grad-wrapped: linear-gradient(135deg, #ffd9e8, #f9a8c0);
  --accent-rgb: 233, 30, 99;
  --accent-soft-rgb: 240, 98, 146;
}

/* Blue accent — applied when html[data-accent="blue"] (male user). */
html[data-accent="blue"] {
  --rose-50:  #f2f7ff;
  --rose-100: #dcebfd;
  --rose-200: #b9d7fb;
  --rose-300: #8ab9f2;
  --rose-400: #4f96e6;
  --rose-500: #1e88e5;
  --rose-600: #1565c0;
  --rose-700: #0d47a1;
  --cream:    #f6fafe;
  --ink:      #213a5c;
  --ink-soft: #65819f;
  --glow-1: rgba(138, 185, 242, .30);
  --glow-2: rgba(79, 150, 230, .18);
  --shadow:   0 10px 30px rgba(30, 136, 229, .15);
  --shadow-lg:0 22px 50px rgba(30, 136, 229, .22);
  --grad:     linear-gradient(135deg, #f2f7ff 0%, #dcebfd 50%, #b9d7fb 100%);
  --grad-btn: linear-gradient(135deg, #4f96e6, #1e88e5);
  --grad-hero:linear-gradient(160deg, #f2f7ff 0%, #cfe4fc 40%, #8ab9f2 100%);
  --grad-wrapped: linear-gradient(135deg, #cfe4fc, #8ab9f2);
  --accent-rgb: 30, 136, 229;
  --accent-soft-rgb: 79, 150, 230;
}

/* Dark palette — applied when the resolved theme is dark
   (explicit "dark" choice, or "system" with a dark OS).
   Must come after the blue-accent block so dark wins on equal specificity;
   the combined selector below re-overrides for dark + blue. */
html[data-resolved="dark"] {
  color-scheme: dark;
  --rose-50:  #241319;
  --rose-100: #2e1a22;
  --rose-200: #472733;
  --rose-300: #6b3c4d;
  --rose-400: #f06292;
  --rose-500: #ec407a;
  --rose-600: #f48fb1;
  --rose-700: #f8bbd0;
  --cream:    #1c1015;
  --ink:      #f3e2e9;
  --ink-soft: #c09aa9;
  --white:    #26161d;
  --glass:        rgba(28, 16, 22, .78);
  --glass-strong: rgba(38, 22, 29, .88);
  --chip-x-bg:    rgba(255, 255, 255, .12);
  --badge-bg:     rgba(38, 22, 29, .92);
  --danger-bg:   #3a1c26;
  --danger-text: #ff8aa8;
  --ok-bg:     #12291c;
  --ok-text:   #7fdca4;
  --ok-border: #24543a;
  --glow-1: rgba(249, 168, 192, .10);
  --glow-2: rgba(240, 98, 146, .08);
  --grad:     linear-gradient(135deg, #241319 0%, #2e1a22 50%, #3d222c 100%);
  --grad-hero:linear-gradient(160deg, #241319 0%, #35202c 40%, #4a2a3a 100%);
  --grad-wrapped: linear-gradient(135deg, #472733, #6b3c4d);
  --accent-rgb: 236, 64, 122;
  --accent-soft-rgb: 240, 98, 146;
}

/* Dark + blue accent (highest specificity of the palette blocks). */
html[data-resolved="dark"][data-accent="blue"] {
  --rose-50:  #101c2e;
  --rose-100: #182639;
  --rose-200: #24374e;
  --rose-300: #3c5878;
  --rose-400: #4f96e6;
  --rose-500: #42a5f5;
  --rose-600: #90caf9;
  --rose-700: #bbdefb;
  --cream:    #0d1522;
  --ink:      #e3edf9;
  --ink-soft: #9db6d1;
  --white:    #16233a;
  --glass:        rgba(13, 21, 34, .78);
  --glass-strong: rgba(22, 35, 58, .88);
  --badge-bg:     rgba(22, 35, 58, .92);
  --glow-1: rgba(138, 185, 242, .10);
  --glow-2: rgba(79, 150, 230, .08);
  --grad:     linear-gradient(135deg, #101c2e 0%, #182639 50%, #22334c 100%);
  --grad-hero:linear-gradient(160deg, #101c2e 0%, #1a2a42 40%, #2c4362 100%);
  --grad-wrapped: linear-gradient(135deg, #24374e, #3c5878);
  --accent-rgb: 66, 165, 245;
  --accent-soft-rgb: 79, 150, 230;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--cream);
  background-image:
    radial-gradient(circle at 12% 18%, var(--glow-1), transparent 42%),
    radial-gradient(circle at 88% 82%, var(--glow-2), transparent 46%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.9;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--rose-600); text-decoration: none; }
a:hover { color: var(--rose-700); }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 28px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rose-100);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--rose-600);
}
.brand-heart {
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--grad-btn);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb),.35);
  animation: beat 2.4s ease-in-out infinite;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nav a:not(.btn) {
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  transition: .25s;
}
.nav a:not(.btn):hover {
  background: var(--rose-100);
  color: var(--rose-600);
}
.nav-logout {
  border: 1px dashed var(--rose-300);
}

/* hamburger — only visible below the 860px breakpoint */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rose-200);
  border-radius: 14px;
  background: var(--rose-100);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  border-radius: 2px;
  background: var(--rose-600);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.theme-switch {
  position: relative;
  align-self: center;
}
/* .btn .btn-soft .btn-sm give the trigger the same box as the header buttons;
   line-height: buttons don't inherit it from body, so heights must match <a> buttons */
.theme-trigger {
  gap: 5px;
  line-height: inherit;
}
.theme-caret {
  font-size: .65rem;
  opacity: .6;
  transition: transform .2s ease;
}
.theme-switch.is-open .theme-caret { transform: rotate(180deg); }

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 132px;
  padding: 5px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--rose-200);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.96);
  transform-origin: top center;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.theme-switch.is-open .theme-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.theme-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: start;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.theme-menu button:hover {
  background: var(--rose-100);
  color: var(--rose-700);
}
.theme-menu button.is-active {
  background: var(--rose-100);
  color: var(--rose-600);
}
.theme-menu button.is-active::after {
  content: '✓';
  margin-inline-start: auto;
  color: var(--rose-500);
}
.theme-switch-float {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 90;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 4px;
}
.theme-switch-float .theme-trigger {
  border: none;
  background: transparent;
  box-shadow: none;
}

/* ---------- accent switch (pink / blue) ---------- */
.accent-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--rose-200);
}
.accent-dot {
  width: 18px;
  height: 18px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}
.accent-dot-pink { background: linear-gradient(135deg, #f06292, #e91e63); }
.accent-dot-blue { background: linear-gradient(135deg, #4f96e6, #1e88e5); }
.accent-dot.is-active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- layout ---------- */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 34px 0 70px;
}

.hero {
  background: var(--grad-hero);
  border-radius: var(--radius);
  padding: 42px 36px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '🌸';
  position: absolute;
  left: -12px; bottom: -18px;
  font-size: 8rem;
  opacity: .18;
  transform: rotate(-18deg);
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--rose-700);
}
.hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 58ch;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  color: var(--rose-700);
  margin: 34px 0 16px;
}
.section-title::before {
  content: '';
  width: 10px; height: 26px;
  border-radius: 999px;
  background: var(--grad-btn);
}
.section-lead {
  margin: -6px 0 20px;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- landing page ---------- */
.landing-hero {
  background: var(--grad-hero);
  border-radius: var(--radius);
  padding: 52px 44px;
  box-shadow: var(--shadow);
  margin-bottom: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  overflow: hidden;
}
.landing-hero::after {
  content: '🌸';
  position: absolute;
  left: -12px; bottom: -18px;
  font-size: 8rem;
  opacity: .18;
  transform: rotate(-18deg);
}
.landing-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 5vw, 2.9rem);
  color: var(--rose-700);
  line-height: 1.5;
}
.landing-tagline {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rose-600);
  max-width: 58ch;
}
.landing-hero-text .muted {
  max-width: 58ch;
}
.landing-note {
  margin: 16px 0 0;
  font-size: .85rem;
  color: var(--ink-soft);
}
.landing-hero-art {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  letter-spacing: .25em;
  filter: drop-shadow(0 12px 22px rgba(var(--accent-rgb),.28));
  animation: floaty 4.5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-14px) rotate(3deg); }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(var(--accent-rgb),.08);
  padding: 24px 22px;
  transition: transform .28s ease, box-shadow .28s ease;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.feature-icon {
  width: 58px; height: 58px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  border-radius: 18px;
  background: var(--rose-100);
  margin-bottom: 12px;
}
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: var(--rose-700);
}
.feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .92rem;
}

/* journey — four connected steps */
.landing-journey {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.journey-step {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px dashed var(--rose-300);
  padding: 22px 20px;
}
.journey-num {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-btn);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.journey-step h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--ink);
}
.journey-step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .88rem;
}

/* story — alternating feature moments with real UI previews */
.story-row {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 30px;
  align-items: center;
  margin: 34px 0;
}
.story-kicker {
  margin: 0 0 6px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--rose-600);
}
.story-text h3 {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  color: var(--rose-700);
}
.story-text .muted {
  max-width: 54ch;
}
.story-list {
  margin: 14px 0 0;
  padding-inline-start: 18px;
  color: var(--ink-soft);
  line-height: 2.1;
  font-size: .92rem;
}
.story-visual {
  display: grid;
  place-items: center;
}
.story-visual .card,
.story-visual .countdown-card {
  width: min(100%, 320px);
}
.story-visual .letter-item {
  width: min(100%, 380px);
}

/* extras — themes + PWA */
.landing-extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.extras-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(var(--accent-rgb),.08);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}
.extras-item .feature-icon {
  flex: none;
  margin-bottom: 0;
}
.extras-item h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  color: var(--rose-700);
}
.extras-item p {
  margin: 0;
  font-size: .9rem;
}

.cta-band {
  margin-top: 40px;
  background: var(--grad-hero);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 46px 32px;
  text-align: center;
}
.cta-quote {
  margin: 0 auto 14px;
  max-width: 52ch;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rose-700);
}
.cta-band h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.5vw, 1.95rem);
  color: var(--rose-700);
}
.cta-band .muted {
  margin: 0 0 20px;
}

/* ---------- cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .28s ease, box-shadow .28s ease;
  border: 1px solid rgba(var(--accent-rgb),.08);
  position: relative;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--rose-100);
  display: block;
}
.card-img-placeholder {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  font-size: 3.2rem;
  background: linear-gradient(135deg, var(--rose-100), var(--rose-200));
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-title {
  margin: 0;
  font-size: 1.06rem;
  color: var(--ink);
}
.card-notes {
  margin: 0;
  color: var(--ink-soft);
  font-size: .88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-weight: 800;
  color: var(--rose-600);
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.tag-chip {
  background: var(--rose-100);
  color: var(--rose-700);
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.badge {
  position: absolute;
  top: 12px; right: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  background: var(--badge-bg);
  color: var(--rose-600);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}
.badge-high { background: var(--grad-btn); color: #fff; }

/* gift-wrapped mystery card */
.card-wrapped .card-img-placeholder {
  background: var(--grad-wrapped);
}
.gift-box {
  font-size: 3.6rem;
  animation: wobble 2.6s ease-in-out infinite;
}
.card-wrapped .card-title {
  filter: blur(5px);
  user-select: none;
  opacity: .55;
}
.mystery-note {
  background: var(--rose-50, #fff5f8);
  border: 1px dashed var(--rose-300);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--rose-600);
  font-size: .85rem;
  text-align: center;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 10px 22px rgba(var(--accent-rgb),.32);
}
.btn-soft {
  background: var(--rose-100);
  color: var(--rose-700);
}
.btn-ghost {
  background: transparent;
  color: var(--rose-600);
  border: 1.5px solid var(--rose-300);
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--rose-200);
}
.btn-sm {
  padding: 7px 14px;
  font-size: .82rem;
}
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
  max-width: 640px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--ink);
}
.form-hint {
  font-size: .82rem;
  color: var(--ink-soft);
  margin-top: 5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--rose-200);
  background: var(--rose-50, #fff5f8);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--rose-400);
  box-shadow: 0 0 0 4px rgba(var(--accent-soft-rgb),.18);
}
textarea { min-height: 110px; resize: vertical; }

input[type="file"] {
  width: 100%;
  padding: 10px;
  background: var(--rose-50, #fff5f8);
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--rose-300);
}

/* tag chips input */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--rose-200);
  background: var(--rose-50, #fff5f8);
  min-height: 52px;
  align-items: center;
}
.tags-input-wrap input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
  flex: 1;
  min-width: 130px;
}
.tag-chip button {
  border: none;
  background: var(--chip-x-bg);
  color: var(--rose-600);
  border-radius: 50%;
  width: 18px; height: 18px;
  line-height: 1;
  cursor: pointer;
  margin-right: 4px;
  font-size: .72rem;
}

/* ---------- flash ---------- */
.flash {
  width: min(1100px, 92vw);
  margin: 16px auto -6px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  animation: slideDown .4s ease;
}
.flash-success { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-border); }
.flash-error   { background: var(--danger-bg); color: var(--rose-700); border: 1px solid var(--rose-200); }
.flash-info    { background: var(--rose-100); color: var(--rose-700); border: 1px solid var(--rose-200); }

/* ---------- welcome modal ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--grad-hero);
  display: grid;
  place-items: center;
  padding: 22px;
  animation: fadeIn .5s ease;
}
.welcome-overlay.hide {
  animation: fadeOut .5s ease forwards;
  pointer-events: none;
}
.welcome-card {
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  border-radius: 30px;
  padding: 46px 38px;
  max-width: 620px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.welcome-card .big-heart {
  font-size: 4.2rem;
  display: block;
  animation: beat 1.8s ease-in-out infinite;
}
.welcome-card h2 {
  color: var(--rose-700);
  margin: 12px 0 6px;
  font-size: 1.65rem;
}
.welcome-message {
  white-space: pre-line;
  color: var(--ink);
  font-size: 1.12rem;
  margin: 18px 0 26px;
  line-height: 2.2;
}
.welcome-hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 30px;
  pointer-events: none;
}
.welcome-hearts span {
  position: absolute;
  bottom: -40px;
  animation: floatUp 6s linear infinite;
  opacity: .55;
  font-size: 1.4rem;
}

/* ---------- quote widgets ---------- */
.quote-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  border-right: 6px solid var(--rose-400);
  position: relative;
}
.quote-card .quote-mark {
  font-size: 3rem;
  color: var(--rose-300);
  line-height: 1;
}
.quote-card p {
  margin: 6px 0 0;
  font-size: 1.12rem;
  color: var(--ink);
}

.ticker-wrap {
  overflow: hidden;
  background: var(--grad-btn);
  color: #fff;
  border-radius: 999px;
  padding: 11px 0;
  margin: 22px 0;
  box-shadow: var(--shadow);
}
.ticker {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker 38s linear infinite;
  font-weight: 600;
  font-size: .98rem;
}

/* ---------- countdown ---------- */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.countdown-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  text-align: center;
}
.countdown-card .date-icon { font-size: 2.2rem; }
.countdown-card h3 {
  margin: 8px 0 12px;
  color: var(--rose-700);
}
.countdown-caption {
  margin: 10px 0 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.countdown-nums {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 6px;
  direction: ltr;
}
.countdown-nums .unit {
  background: var(--rose-100);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  min-width: 0;
}
.countdown-nums .num {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--rose-600);
}
.countdown-nums .lbl {
  font-size: .72rem;
  color: var(--ink-soft);
}
.countdown-card .jalali-date {
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: .86rem;
}

/* ---------- letters ---------- */
.letter-hero {
  background: var(--grad-hero);
  border-radius: var(--radius);
  padding: 38px 34px;
  box-shadow: var(--shadow);
  position: relative;
}
.letter-envelope {
  font-size: 3.6rem;
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform .3s;
}
.letter-envelope:hover { transform: scale(1.12) rotate(-6deg); }
.letter-body {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 26px;
  margin-top: 18px;
  white-space: pre-line;
  line-height: 2.3;
  box-shadow: inset 0 0 0 1px var(--rose-100);
}
.letter-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.letter-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: .25s;
}
.letter-item:hover { transform: translateX(-5px); }
.letter-item h4 { margin: 0 0 4px; color: var(--rose-700); }
.letter-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- surprises / reasons ---------- */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
}
.reason-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  min-height: 130px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: .3s;
}
.reason-card .hidden-text {
  filter: blur(6px);
  transition: filter .4s;
  font-weight: 600;
  color: var(--rose-600);
}
.reason-card.open .hidden-text { filter: blur(0); }
.reason-card:hover { transform: translateY(-4px) rotate(-1deg); }

.secret-code-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 520px;
  margin: 22px auto;
  text-align: center;
  border: 2px dashed var(--rose-300);
}
.unlocked-letter {
  background: var(--grad-hero);
  border-radius: var(--radius);
  padding: 30px;
  margin-top: 20px;
  animation: popIn .5s ease;
}

/* ---------- login ---------- */
.login-wrap {
  min-height: 82vh;
  display: grid;
  place-items: center;
  padding: 30px 16px;
}
.login-card {
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  padding: 46px 38px;
  width: min(420px, 100%);
  text-align: center;
}
.login-card .big-heart {
  font-size: 3.6rem;
  animation: beat 2s ease-in-out infinite;
  display: block;
}
.login-card h1 {
  margin: 10px 0 4px;
  color: var(--rose-700);
  font-size: 1.55rem;
}
.login-card .sub {
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* ---------- onboarding (gender / partner wizard) ---------- */
.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: 1.5px solid var(--rose-200);
  border-radius: var(--radius-sm);
  background: var(--rose-50, #fff5f8);
  font-weight: 700;
  cursor: pointer;
}
.radio-row input { accent-color: var(--rose-600); }
.radio-row .radio-emoji { font-size: 1.35rem; }
.radio-row:has(input:checked) {
  border-color: var(--rose-500);
  background: var(--rose-100);
  color: var(--rose-700);
}
.step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 20px;
}
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose-200);
}
.step-dot.is-done { background: var(--rose-400); }
.step-dot.is-active {
  background: var(--rose-600);
  transform: scale(1.35);
}
.wizard-review {
  text-align: right;
  background: var(--rose-50, #fff5f8);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 2;
}
.wizard-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto 12px;
  border: 3px solid var(--rose-200);
}
.login-card .btn-block + .btn-block { margin-top: 10px; }
.partner-switch select {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--rose-300);
  background: var(--white);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  color: var(--rose-700);
  cursor: pointer;
}

/* ---------- photo uploader + cropper modal ---------- */
.photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(60, 10, 30, .55);
  display: grid;
  place-items: center;
  padding: 20px;
}
.crop-modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 20px;
  width: min(420px, 100%);
  text-align: center;
}
.crop-modal h3 {
  margin: 0 0 4px;
  color: var(--rose-700);
}
.crop-box {
  margin: 12px 0 16px;
  width: 100%;
  height: 280px;
  background: var(--rose-50, #fff5f8);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.crop-box img { display: block; max-width: 100%; }
.crop-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- jalali date picker ---------- */
.dp-wrap {
  display: flex;
  align-items: stretch;
  gap: 7px;
}
.dp-wrap input { flex: 1; min-width: 0; }
.dp-trigger {
  flex: 0 0 auto;
  width: 46px;
  border: 1.5px solid var(--rose-200);
  border-radius: var(--radius-sm);
  background: var(--rose-50, #fff5f8);
  font-size: 1.15rem;
  cursor: pointer;
}
.dp-trigger:hover { border-color: var(--rose-400); }
.dp-panel {
  position: fixed;
  z-index: 80;
  width: 276px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  direction: rtl;
}
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}
.dp-title {
  font-weight: 700;
  color: var(--rose-700);
  flex: 1;
  text-align: center;
}
.dp-nav {
  border: none;
  background: var(--rose-100);
  color: var(--rose-700);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 1.05rem;
  cursor: pointer;
}
.dp-nav:hover { background: var(--rose-200); }
.dp-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 4px;
}
.dp-week span {
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 3px 0;
}
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.dp-day, .dp-empty {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dp-day {
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  color: var(--ink);
  cursor: pointer;
}
.dp-day:hover { background: var(--rose-100); }
.dp-day.is-today {
  font-weight: 700;
  color: var(--rose-600);
  box-shadow: inset 0 0 0 1.5px var(--rose-300);
}
.dp-day.is-selected {
  background: var(--rose-500, #e91e63);
  color: #fff;
  font-weight: 700;
}
.dp-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.dp-today, .dp-clear {
  border: none;
  background: var(--rose-100);
  color: var(--rose-700);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.dp-clear { background: transparent; color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 34px 16px 46px;
  color: var(--ink-soft);
  font-size: .92rem;
}
.footer-note {
  opacity: .8;
  font-size: .82rem;
}
.secret-heart {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform .2s;
}
.secret-heart:hover { transform: scale(1.35) rotate(12deg); }

/* ---------- particles & confetti ---------- */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.petals span {
  position: absolute;
  top: -40px;
  animation: fall linear infinite;
  opacity: .55;
  user-select: none;
}
@keyframes fall {
  0%   { transform: translateY(-10vh) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(360deg); }
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1); opacity: .6; }
  100% { transform: translateY(-110vh) scale(1.25); opacity: 0; }
}
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 300;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  25%      { transform: scale(1.12); }
  40%      { transform: scale(.98); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(7deg); }
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb),.35); }
  50%      { box-shadow: 0 0 0 16px rgba(var(--accent-rgb),0); }
}

.pulse { animation: pulse 1.6s infinite; }

/* ---------- dashboard ---------- */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.dash-couple {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.dash-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.dash-couple-name {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--rose-700);
}
.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dash-couple-meta {
  margin: 6px 0 0;
  font-size: .8rem;
}
a.tag-chip { text-decoration: none; }
.tag-chip.is-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid var(--ok-border);
}
.tag-chip.is-premium {
  background: var(--grad-btn);
  color: #fff;
}

.dash-ribbon {
  background: var(--glass);
  border: 1px solid rgba(var(--accent-rgb),.08);
  border-radius: var(--radius);
  padding: 12px 18px 14px;
  margin: 18px 0 0;
}
.dash-quote {
  margin: 0 0 10px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--rose-700);
}
.ticker-wrap--slim {
  margin: 0;
  padding: 8px 0;
  box-shadow: none;
}
.ticker-wrap--slim .ticker {
  font-size: .86rem;
  animation-duration: 32s;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--white);
  border: 1px solid rgba(var(--accent-rgb),.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  color: inherit;
  text-decoration: none;
  transition: transform .28s ease, box-shadow .28s ease;
}
.stat-tile:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.stat-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-icon {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  border-radius: 14px;
  background: var(--rose-100);
  flex: none;
}
.stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--rose-700);
}
.stat-lbl {
  font-weight: 700;
  color: var(--ink);
}
.stat-sub {
  color: var(--ink-soft);
  font-size: .85rem;
  line-height: 1.9;
}
.stat-quota {
  margin-top: auto;
  align-self: flex-start;
  background: var(--rose-50);
  border: 1px dashed var(--rose-300);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .78rem;
  color: var(--ink-soft);
}
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* ---------- responsive ---------- */
@media (min-width: 1000px) {
  .landing-journey {
    grid-template-columns: repeat(4, 1fr);
    position: relative;
  }
  .landing-journey::before {
    content: '';
    position: absolute;
    top: 42px;
    inset-inline: 7%;
    height: 3px;
    border-radius: 999px;
    background: var(--rose-200);
    z-index: 1;
  }
  .journey-num {
    position: relative;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--white);
  }
}
@media (min-width: 861px) {
  .story-row--flip .story-text { order: 2; }
  .story-row--flip .story-visual { order: 1; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 12px 16px 16px;
    background: var(--glass-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rose-100);
    box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; animation: slideDown .25s ease; }
  .nav .theme-switch,
  .nav .accent-switch { align-self: flex-start; margin-top: 6px; }
  .story-row { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 640px) {
  .site-header { padding: 14px 16px; }
  .brand-text { font-size: 1.02rem; }
  .nav a:not(.btn) { padding: 7px 11px; font-size: .86rem; }
  .hero { padding: 28px 22px; }
  .dash-hero { flex-direction: column; align-items: stretch; }
  .dash-couple { flex-wrap: wrap; }
  .landing-hero { flex-direction: column; align-items: flex-start; padding: 32px 22px; }
  .landing-hero-art { align-self: center; }
  .form-card { padding: 22px 18px; }
  .welcome-card { padding: 32px 20px; }
  .container { padding-top: 22px; }
}

/* utility */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.muted { color: var(--ink-soft); }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }

/* ---------- PWA install hint ---------- */
.pwa-install {
  position: fixed;
  z-index: 150;
  bottom: 16px;
  left: 12px;
  right: 12px;
  margin-inline: auto;
  width: min(520px, calc(100vw - 24px));
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rose-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: slideDown .45s ease;
}
.pwa-install-icon { font-size: 1.65rem; line-height: 1.4; }
.pwa-install-body { flex: 1; min-width: 0; }
.pwa-install-body strong { display: block; font-size: .98rem; margin-bottom: 3px; }
.pwa-install-body p { margin: 0; font-size: .85rem; line-height: 1.75; color: var(--ink-soft); }
.pwa-install-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-inline-start: auto;
}
.pwa-install-close {
  background: var(--chip-x-bg);
  border: 1px solid var(--rose-200);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: .85rem;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.pwa-install-close:hover { background: var(--rose-100); color: var(--rose-700); }
@media (max-width: 480px) {
  .pwa-install { bottom: 12px; padding: 12px; gap: 9px; }
  .pwa-install-icon { font-size: 1.35rem; }
  .pwa-install-body strong { font-size: .92rem; }
}
