/* ==========================================================================
   کارت‌پستال صوتی آنا — سیستم طراحی مشترک (Wizard فرستنده + صفحه گیرنده)
   Mobile First · RTL · هویت بصری کاله/آنا
   ========================================================================== */

:root {
  --ana-blue-deep: #123b71;
  --ana-blue: #1d5da6;
  --ana-blue-mid: #2e75b6;
  --ana-blue-light: #8fc7e8;
  --ana-blue-pale: #eaf4fc;
  --ana-gold: #f0b429;
  --ana-gold-soft: #f8dfa0;
  --ana-white: #ffffff;
  --ink: #16233a;
  --ink-soft: #4a5a72;
  --line: #dce8f4;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --success: #1f8a55;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 10px 30px rgba(18, 59, 113, 0.12);
  --shadow-soft: 0 4px 14px rgba(18, 59, 113, 0.08);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --font-fa: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Tahoma,
    "Vazirmatn", "Noto Sans Arabic", Roboto, sans-serif;

  --max-width: 460px;
  --transition-base: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-fa);
  background: linear-gradient(180deg, var(--ana-blue-pale) 0%, #ffffff 42%);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

a {
  color: inherit;
}

h1, h2, h3, p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--ana-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Safari's in-app browser can let a flex item's own display rule override the
   browser's default [hidden] styling. The initial loader must never reserve
   height once a postcard is ready. */
#initialLoading[hidden] {
  display: none !important;
}

/* ==========================================================================
   چیدمان کلی صفحه
   ========================================================================== */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shell {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 540px) {
  .page {
    padding: var(--space-6) 0;
  }
  .shell {
    min-height: 780px;
    border-radius: 28px;
  }
}

.brand-wave {
  width: 100%;
  height: 40px;
  display: block;
  margin-top: auto;
  flex-shrink: 0;
}

.brand-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-5);
  color: var(--ink-soft);
  font-size: 12px;
  flex-shrink: 0;
}

.brand-footer img {
  height: 20px;
  width: auto;
  opacity: 0.9;
}

/* ==========================================================================
   نوار پیشرفت ویزارد
   ========================================================================== */

.wizard-progress {
  display: flex;
  gap: 6px;
  padding: var(--space-4) var(--space-5) 0;
}

.wizard-progress span {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--line);
  transition: background var(--transition-base);
}

.wizard-progress span.is-done,
.wizard-progress span.is-active {
  background: var(--ana-blue);
}

/* ==========================================================================
   مراحل ویزارد
   ========================================================================== */

.wizard-step {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: var(--space-5);
  animation: postcard-fade-in var(--transition-base) both;
}

.wizard-step.is-active {
  display: flex;
}

[hidden] {
  display: none !important;
}

.step-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--ana-blue);
  font-size: 14px;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-2);
  cursor: pointer;
}

.hero-visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.brand-badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-badge img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.step-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ana-blue-deep);
  margin-top: var(--space-5);
  line-height: 1.5;
}

.step-subtitle {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: var(--space-3);
}

.step-spacer {
  flex: 1;
}

/* ==========================================================================
   دکمه‌ها
   ========================================================================== */

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: transform var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--ana-blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(29, 93, 166, 0.32);
}

.btn-primary:hover:not(:disabled) {
  background: var(--ana-blue-deep);
}

.btn-secondary {
  background: var(--ana-blue-pale);
  color: var(--ana-blue-deep);
}

.btn-outline {
  background: transparent;
  color: var(--ana-blue);
  border: 1.5px solid var(--ana-blue-light);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  font-weight: 600;
}

.btn-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.btn-row .btn {
  width: auto;
  flex: 1;
}

/* ==========================================================================
   فرم‌ها
   ========================================================================== */

.field {
  margin-top: var(--space-5);
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ana-blue-deep);
  margin-bottom: var(--space-2);
}

.field input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  transition: border-color var(--transition-base);
}

.field input[type="text"]:focus {
  border-color: var(--ana-blue);
  outline: none;
}

.field input.has-error {
  border-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: var(--space-2);
  display: none;
}

.field-error.is-visible {
  display: block;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-5);
  background: var(--ana-blue-pale);
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.checkbox-field input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--ana-blue);
  flex-shrink: 0;
}

.checkbox-field label {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.8;
}

.privacy-note {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: var(--space-3);
  padding-inline-start: var(--space-2);
}

.privacy-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================================================
   راهنما / آکاردئون پیشنهاد متن
   ========================================================================== */

.guide-list {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.guide-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  background: var(--ana-blue-pale);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--ink);
}

.guide-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ana-gold);
  margin-top: 7px;
  flex-shrink: 0;
}

.suggestions {
  margin-top: var(--space-4);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.suggestions summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-4);
  font-weight: 700;
  color: var(--ana-blue-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.suggestions summary::-webkit-details-marker {
  display: none;
}

.suggestions summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--ana-blue);
  border-bottom: 2px solid var(--ana-blue);
  transform: rotate(45deg);
  transition: transform var(--transition-base);
}

.suggestions[open] summary::after {
  transform: rotate(225deg);
}

.suggestion-item {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}

.recording-prompts {
  margin-top: var(--space-4);
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.recording-prompts h3 {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  color: var(--ana-blue-deep);
  font-size: 15px;
}

/* ==========================================================================
   ضبط صدا
   ========================================================================== */

.recorder {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.recorder-ring {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 50% 40%, var(--ana-blue-pale), #fff 72%);
  box-shadow: var(--shadow-soft);
}

.recorder-ring svg.progress-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  pointer-events: none;
}

.recorder-ring circle.ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 6;
}

.recorder-ring circle.ring-progress {
  fill: none;
  stroke: var(--ana-gold);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 200ms linear;
}

.mic-button {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  background: var(--ana-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(29, 93, 166, 0.35);
  transition: transform var(--transition-base), background var(--transition-base);
  position: relative;
  z-index: 2;
  touch-action: manipulation;
}

.mic-button:active {
  transform: scale(0.95);
}

.is-recording .mic-button {
  background: var(--danger);
  box-shadow: 0 10px 24px rgba(192, 57, 43, 0.35);
}

.timer {
  margin-top: var(--space-4);
  font-size: 28px;
  font-weight: 800;
  color: var(--ana-blue-deep);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.recorder-hint {
  margin-top: var(--space-2);
  font-size: 13px;
  color: var(--ink-soft);
  min-height: 18px;
}

.waveform {
  width: 100%;
  height: 72px;
  margin-top: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--ana-blue-pale);
}

.recorder-controls {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
  width: 100%;
}

.voice-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 14px;
  border-radius: 12px;
  color: var(--ana-blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}

.voice-file-button:hover { background: rgba(143, 199, 232, 0.2); }
.voice-file-button:active { transform: scale(0.98); }
[data-app-state="recording"] .voice-file-button,
[data-app-state="requesting_permission"] .voice-file-button { opacity: 0.45; pointer-events: none; }

/* ==========================================================================
   پیش‌نمایش پخش
   ========================================================================== */

.playback-card {
  margin-top: var(--space-5);
  background: var(--ana-blue-pale);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.play-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--ana-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.playback-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

.playback-waveform {
  flex: 1;
  height: 56px;
}

.playback-duration {
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.rerecord-note {
  margin-top: var(--space-3);
  font-size: 12px;
  color: var(--ink-soft);
}

.auto-mix-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--ana-blue-pale);
  color: var(--ana-blue-deep);
  font-size: 14px;
  font-weight: 700;
}

.auto-mix-status[hidden],
.playback-card[hidden],
.retry-mix-btn[hidden] {
  display: none !important;
}

.auto-mix-status.has-error {
  border-color: rgba(192, 57, 43, 0.25);
  background: var(--danger-bg);
  color: var(--danger);
}

.auto-mix-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid rgba(29, 93, 166, 0.18);
  border-top-color: var(--ana-blue);
  border-radius: 50%;
  animation: postcard-spin 800ms linear infinite;
}

.auto-mix-status.has-error .auto-mix-spinner {
  display: none;
}

.retry-mix-btn {
  margin-top: var(--space-3);
}

.review-actions {
  flex-direction: column;
}

.review-actions #submitBtn {
  order: -1;
}

/* ==========================================================================
   بنر خطا / وضعیت
   ========================================================================== */

.alert {
  display: none;
  align-items: flex-start;
  gap: var(--space-2);
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: 14px;
  margin-top: var(--space-4);
}

.alert.is-visible {
  display: flex;
}

.alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.recorder-diagnostics {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #cfe3f4;
  border-radius: 16px;
  background: #f7fbff;
  color: #31577f;
}

.recorder-diagnostics summary {
  cursor: pointer;
  font-weight: 700;
}

.recorder-diagnostics p {
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.7;
}

.recorder-diagnostics pre {
  direction: ltr;
  text-align: left;
  max-height: 260px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 10px;
  background: #0b1f38;
  color: #dceeff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ==========================================================================
   لودینگ (ساخت کارت)
   ========================================================================== */

.loading-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  gap: var(--space-5);
}

.loading-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--ana-blue-pale);
  border-top-color: var(--ana-gold);
  animation: postcard-spin 900ms linear infinite;
}

.loading-view p {
  color: var(--ink-soft);
  font-size: 15px;
}

.upload-progress {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--ana-blue-pale);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ana-blue);
  transition: width 160ms linear;
}

/* ==========================================================================
   صفحه موفقیت
   ========================================================================== */

.success-badge {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--ana-blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.link-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--ana-blue-pale);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
}

.link-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  direction: ltr;
  text-align: left;
}

.link-box input:focus {
  outline: none;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 40;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   صفحه گیرنده — پاکت
   ========================================================================== */

.envelope-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-5);
  gap: var(--space-5);
}

.envelope-wrap {
  width: 220px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: transform 320ms var(--transition-base);
}

.envelope-wrap:active {
  transform: scale(0.97);
}

.envelope-wrap.is-opening {
  animation: postcard-envelope-pop 480ms var(--transition-base) both;
}

.recipient-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ana-blue-deep);
  line-height: 1.6;
}

.recipient-sub {
  font-size: 15px;
  color: var(--ink-soft);
}

/* ==========================================================================
   صفحه گیرنده — کارت باز شده
   ========================================================================== */

.card-scene {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) var(--space-5);
  text-align: center;
  position: relative;
  animation: postcard-fade-in 420ms var(--transition-base) both;
}

.card-scene.is-active {
  display: flex;
}

.card-key-visual {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.card-key-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.sparkle {
  position: absolute;
  border-radius: 50%;
  background: var(--ana-gold);
  opacity: 0;
  pointer-events: none;
}

.sparkle.is-active {
  animation: postcard-sparkle 1400ms ease-in-out infinite;
}

.from-label {
  margin-top: var(--space-5);
  font-size: 14px;
  color: var(--ink-soft);
}

.from-label strong {
  color: var(--ana-blue-deep);
}

.play-hero {
  margin-top: var(--space-5);
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: none;
  background: var(--ana-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(29, 93, 166, 0.35);
  transition: transform var(--transition-base);
  position: relative;
}

.play-hero:active {
  transform: scale(0.95);
}

.play-hero .pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--ana-gold);
  opacity: 0;
}

.play-hero.is-playing .pulse {
  animation: postcard-pulse 1600ms ease-out infinite;
}

.play-hero-label {
  margin-top: var(--space-3);
  font-size: 14px;
  color: var(--ana-blue-deep);
  font-weight: 700;
}

.recipient-waveform {
  width: 100%;
  height: 64px;
  margin-top: var(--space-5);
}

.after-play {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-5);
  gap: var(--space-4);
  width: 100%;
}

.after-play.is-visible {
  display: flex;
}

.after-play p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* ==========================================================================
   وضعیت‌های خطا/انقضا/حذف صفحه گیرنده
   ========================================================================== */

.state-scene {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-5);
  gap: var(--space-4);
}

.state-scene.is-active {
  display: flex;
}

.state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ana-blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ana-blue-deep);
}

.state-text {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 300px;
}

/* ==========================================================================
   انیمیشن‌ها
   ========================================================================== */

@keyframes postcard-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes postcard-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes postcard-envelope-pop {
  0% {
    transform: scale(1) rotate(0deg);
  }
  40% {
    transform: scale(1.05) rotate(-2deg);
  }
  100% {
    transform: scale(0.2) rotate(4deg);
    opacity: 0;
  }
}

@keyframes postcard-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes postcard-sparkle {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  50% {
    opacity: 0.9;
    transform: translateY(-6px) scale(1);
  }
}

@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 (max-width: 359px) {
  .wizard-step, .envelope-scene, .card-scene, .state-scene {
    padding: var(--space-4);
  }
  .step-title {
    font-size: 19px;
  }
  .recorder-ring {
    width: 160px;
    height: 160px;
  }
  .mic-button {
    width: 76px;
    height: 76px;
  }
}

/* ==========================================================================
   لایه‌ی بصری کمپین — برگرفته از Key Visual آنا
   ========================================================================== */

:root {
  --paper: #fffaf0;
  --paper-blue: #f2f8fd;
  --blue-shadow: 0 24px 70px rgba(7, 41, 88, 0.22);
}

body {
  background:
    radial-gradient(circle at 14% 18%, rgba(240, 180, 41, 0.18), transparent 22rem),
    linear-gradient(135deg, #082b59 0%, #15579a 52%, #8fc7e8 130%);
}

.page {
  position: relative;
}

.page::before,
.page::after {
  content: "";
  position: fixed;
  width: 38vw;
  height: 38vw;
  max-width: 540px;
  max-height: 540px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 48% 52% 58% 42%;
  pointer-events: none;
}

.page::before { top: -18vw; right: -12vw; transform: rotate(18deg); }
.page::after { bottom: -22vw; left: -11vw; transform: rotate(-24deg); }

.shell {
  background: linear-gradient(180deg, #ffffff 0%, var(--paper-blue) 100%);
  box-shadow: var(--blue-shadow);
}

.wizard-progress {
  gap: 5px;
  padding-top: 18px;
}

.wizard-progress span {
  height: 5px;
}

.wizard-progress span.is-active {
  background: linear-gradient(90deg, var(--ana-blue), var(--ana-gold));
}

.wizard-step {
  padding-top: 18px;
}

.step-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ana-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.step-eyebrow span:last-child {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.step-back {
  margin-bottom: 0;
  font-weight: 700;
}

.hero-visual {
  aspect-ratio: 2.3 / 1;
  border-radius: 26px 26px 90px 26px;
  box-shadow: 0 18px 36px rgba(18, 59, 113, 0.22);
}

.hero-visual::after,
.card-key-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 48%, rgba(18, 59, 113, 0.08));
  pointer-events: none;
}

.brand-badge {
  width: 54px;
  height: 54px;
  padding: 5px;
  z-index: 2;
}

.step-title {
  font-size: clamp(22px, 5.8vw, 28px);
  letter-spacing: -0.025em;
}

.btn {
  min-height: 54px;
  border-radius: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, #0e447f, var(--ana-blue));
  box-shadow: 0 12px 28px rgba(14, 68, 127, 0.3), inset 0 1px rgba(255, 255, 255, 0.18);
}

.btn-secondary { background: rgba(143, 199, 232, 0.22); }

.field input[type="text"] {
  min-height: 56px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 2px rgba(18, 59, 113, 0.04);
}

#detailsForm {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.guide-item {
  border: 1px solid rgba(143, 199, 232, 0.42);
  background: rgba(255, 255, 255, 0.72);
}

.guide-item-featured {
  background: linear-gradient(135deg, #123b71, #2e75b6);
  color: #fff;
  box-shadow: 0 12px 26px rgba(18, 59, 113, 0.2);
}

.guide-item-featured small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.music-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  background: var(--ana-gold);
  color: var(--ana-blue-deep);
  font-size: 22px;
}

.recorder-ring {
  background: radial-gradient(circle, #fff 0 42%, rgba(143, 199, 232, 0.25) 43% 67%, #fff 68%);
  box-shadow: 0 20px 48px rgba(18, 59, 113, 0.16);
}

.mic-button {
  background: linear-gradient(145deg, #226db9, #103d74);
}

.waveform,
.playback-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(143, 199, 232, 0.45);
}

.mix-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(240, 180, 41, 0.13);
  color: #71520b;
  font-size: 12px;
  line-height: 1.7;
}

.mix-note > span:first-child { font-size: 20px; color: var(--ana-blue); }

.music-choices {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.music-loading,
.music-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 13px;
}

.music-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--ana-gold);
  border-radius: 50%;
  animation: postcard-spin 800ms linear infinite;
}

.music-choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid rgba(143, 199, 232, 0.55);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.music-choice:hover { transform: translateY(-2px); border-color: var(--ana-blue); }
.music-choice.is-selected {
  border-color: var(--ana-gold);
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.13), rgba(255, 255, 255, 0.92));
  box-shadow: 0 12px 28px rgba(18, 59, 113, 0.12);
}

.music-choice-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #123b71, #2e75b6);
  color: #fff;
  font-size: 23px;
}

.music-choice-copy { flex: 1; }
.music-choice-copy strong { display: block; color: var(--ana-blue-deep); font-size: 15px; }
.music-choice-copy small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.music-choice-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: transparent;
  font-size: 13px;
}

.music-choice.is-selected .music-choice-check {
  border-color: var(--ana-gold);
  background: var(--ana-gold);
  color: var(--ana-blue-deep);
}

.mix-explainer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding: 11px;
  border-radius: 15px;
  background: rgba(143, 199, 232, 0.15);
  color: var(--ink-soft);
  font-size: 11px;
}

.mix-explainer i { color: var(--ana-gold); font-style: normal; font-size: 17px; }
.mix-explainer strong { color: var(--ana-blue-deep); }

.mix-preview-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(240, 180, 41, 0.55);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 223, 160, 0.2));
  box-shadow: 0 12px 30px rgba(18, 59, 113, 0.1);
}

.mix-preview-result[hidden] { display: none; }

.mix-preview-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.mix-preview-heading strong { display: block; color: var(--ana-blue-deep); font-size: 13px; }
.mix-preview-heading small { display: block; color: var(--ink-soft); font-size: 10px; margin-top: 2px; }
.mix-preview-result audio { display: block; width: 100%; height: 42px; accent-color: var(--ana-blue); }
.mix-accept-btn { margin-top: 10px; }

.build-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.build-steps span {
  padding: 7px 4px;
  border-radius: 10px;
  background: #e6edf5;
  color: #6c7a8e;
  font-size: 10px;
}

.build-steps span.is-active { background: var(--ana-gold-soft); color: #6c4b00; }
.build-steps span.is-done { background: #dff3e8; color: var(--success); }

.ready-postcard {
  width: min(280px, 82vw);
  aspect-ratio: 1.55 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 8px solid #fff;
  border-radius: 22px;
  background: url("postcard-paper-v2.jpg") center / cover;
  box-shadow: 0 20px 45px rgba(18, 59, 113, 0.2);
  color: var(--ana-blue-deep);
  font-weight: 900;
  transform: rotate(-2deg);
}

.ready-postcard img { width: 58px; height: 40px; object-fit: contain; }
.ready-postcard i { font-style: normal; color: var(--ana-gold); font-size: 24px; }

.envelope-scene {
  background: url("postcard-paper-v2.jpg") center / cover;
  position: relative;
}

.envelope-brand {
  width: 82px;
  height: 52px;
  object-fit: contain;
  position: absolute;
  top: 28px;
  right: 28px;
}

.envelope-wrap {
  filter: drop-shadow(0 22px 28px rgba(18, 59, 113, 0.2));
}

.card-scene {
  padding: 18px;
  background: url("postcard-paper-v2.jpg") center / cover;
}

.postcard-frame {
  width: 100%;
  overflow: hidden;
  border: 8px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 24px 56px rgba(18, 59, 113, 0.22);
  backdrop-filter: blur(10px);
}

.card-key-visual {
  aspect-ratio: 2.3 / 1;
  border-radius: 20px 20px 70px 20px;
  box-shadow: none;
}

.postcard-message {
  padding: 22px 18px 20px;
}

.postcard-kicker {
  color: var(--ana-blue);
  font-size: 12px;
  font-weight: 800;
}

.postcard-message h1 {
  margin: 2px 0 0;
  color: var(--ana-blue-deep);
  font-size: 26px;
  line-height: 1.45;
}

.from-label { margin-top: 5px; }

.audio-keepsake {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 13px;
  border-radius: 22px;
  background: linear-gradient(135deg, #123b71, #226db9);
  text-align: right;
}

.play-hero {
  margin-top: 0;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  background: var(--ana-gold);
  color: var(--ana-blue-deep);
  box-shadow: 0 10px 26px rgba(4, 27, 60, 0.3);
}

.audio-copy .play-hero-label { margin-top: 0; color: #fff; text-align: right; }
.audio-copy span { display: block; color: rgba(255,255,255,.7); font-size: 11px; margin-top: 3px; }
.recipient-waveform { height: 46px; margin-top: 12px; }

.after-play {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
}

@media (min-width: 760px) {
  :root { --max-width: 520px; }
  .page { padding: 32px 0; }
  .shell { min-height: min(820px, calc(100vh - 64px)); border-radius: 34px; }
  .wizard-step { padding-inline: 34px; }
}

/* ========================================================================== 
   تأیید یکپارچه و خروجی مینیمال کمپین
   ========================================================================== */

.inline-consent {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid rgba(143, 199, 232, 0.48);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.inline-consent-title {
  color: var(--ana-blue-deep);
  font-size: 13px;
  font-weight: 900;
}

.inline-consent .checkbox-field {
  gap: 11px;
  margin-top: 10px;
  padding: 0;
  background: transparent;
}

.inline-consent .checkbox-field label {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.85;
}

.inline-consent .checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.inline-consent .privacy-note {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(234, 244, 252, 0.75);
  font-size: 10px;
  line-height: 1.65;
}

.inline-consent + #submitBtn {
  margin-top: 12px;
}

.final-success-step {
  padding-top: 14px;
}

.final-success {
  display: flex;
  flex: 1;
  flex-direction: column;
  text-align: center;
}

.final-success-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1.35 / 1;
  overflow: hidden;
  border-radius: 26px 26px 82px 26px;
  background: var(--ana-blue-deep);
  box-shadow: 0 20px 42px rgba(12, 54, 102, 0.22);
}

.final-success-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(0deg, rgba(10, 53, 102, 0.68), transparent);
  pointer-events: none;
}

.final-success-art > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.final-success-logo {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(7, 37, 73, 0.2);
}

.final-success-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.final-success-check {
  position: absolute;
  z-index: 3;
  left: 18px;
  bottom: 17px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: var(--ana-gold);
  color: var(--ana-blue-deep);
  box-shadow: 0 10px 22px rgba(7, 37, 73, 0.2);
}

.final-success-copy {
  padding: 24px 12px 19px;
}

.final-success-copy h2 {
  margin-top: 2px;
  color: var(--ana-blue-deep);
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.5;
  letter-spacing: -0.035em;
}

.final-success-copy p {
  max-width: 360px;
  margin: 8px auto 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

.final-success-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.final-link-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 5px;
  color: var(--ana-blue);
  font-size: 12px;
  font-weight: 800;
}

.final-link-actions a {
  text-decoration: none;
}

.final-link-actions button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(29, 93, 166, 0.32);
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* کارت مینیمال گیرنده */

.card-scene {
  justify-content: flex-start;
  padding: 14px 14px 22px;
  background:
    radial-gradient(circle at 12% 9%, rgba(240, 180, 41, 0.12), transparent 22%),
    linear-gradient(180deg, #eef7fd 0%, #f9fcff 52%, #ffffff 100%);
}

.postcard-frame-v3 {
  border: 0;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(14, 68, 127, 0.18);
}

.postcard-frame-v3 .card-key-visual {
  aspect-ratio: 1.25 / 1;
  border-radius: 30px 30px 78px 30px;
  background: var(--ana-blue-deep);
}

.postcard-frame-v3 .card-key-visual::after {
  background: linear-gradient(0deg, rgba(10, 51, 98, 0.56), transparent 38%);
}

.postcard-frame-v3 .card-key-visual > img {
  object-position: center 30%;
}

.postcard-frame-v3 .brand-badge {
  top: 14px;
  right: 14px;
  width: 52px;
  height: 52px;
}

.postcard-frame-v3 .postcard-message {
  padding: 23px 22px 20px;
}

.postcard-frame-v3 .postcard-kicker {
  color: #9a6a00;
  font-size: 10px;
  letter-spacing: 0.01em;
}

.postcard-frame-v3 .postcard-message h1 {
  margin-top: 0;
  font-size: clamp(27px, 7.3vw, 35px);
  letter-spacing: -0.04em;
}

.postcard-note {
  max-width: 340px;
  margin: 7px auto 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
}

.postcard-frame-v3 .from-label {
  margin-top: 9px;
  font-size: 11px;
}

.postcard-frame-v3 .audio-keepsake {
  margin-top: 18px;
  padding: 11px 12px;
  border-radius: 20px;
  background: #123f77;
  box-shadow: 0 13px 28px rgba(14, 68, 127, 0.18);
}

.postcard-frame-v3 .play-hero {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
}

.postcard-frame-v3 .audio-copy .play-hero-label {
  font-size: 12px;
}

.postcard-frame-v3 .audio-copy span {
  font-size: 9px;
}

.postcard-frame-v3 .recipient-waveform {
  height: 34px;
  margin-top: 8px;
}

.card-scene .after-play {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(143, 199, 232, 0.38);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: none;
}

.card-scene .after-play p {
  font-size: 12px;
}

@media (max-width: 380px) {
  .final-success-copy { padding-block: 18px 14px; }
  .postcard-frame-v3 .postcard-message { padding: 18px 16px 16px; }
  .postcard-note { font-size: 12px; }
}

/* صفحه ورود کارت: تمرکز کامل روی شنیدن پیام */
.postcard-loading {
  gap: 0;
  background: #123b71;
}

.postcard-arrival {
  isolation: isolate;
  overflow: hidden;
  gap: 0;
  padding: 34px 28px 42px;
  background: #123b71;
}

.postcard-arrival::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: url("final-moment-v3.jpg") center / cover;
  opacity: 0.8;
  transform: scale(1.03);
}

.postcard-arrival::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 50% 54%, rgba(240, 180, 41, 0.2), transparent 22%),
    linear-gradient(180deg, rgba(6, 34, 68, 0.3) 0%, rgba(9, 47, 91, 0.2) 35%, rgba(8, 43, 83, 0.86) 100%);
}

.postcard-arrival .envelope-brand {
  z-index: 1;
  top: 24px;
  right: 24px;
  width: 64px;
  height: 46px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(1, 23, 50, 0.18);
}

.arrival-copy {
  z-index: 1;
  margin-top: auto;
  margin-bottom: 34px;
}

.postcard-arrival .recipient-title {
  color: #fff;
  font-size: clamp(25px, 7vw, 34px);
  letter-spacing: -0.03em;
  text-shadow: 0 3px 18px rgba(2, 24, 52, 0.45);
}

.postcard-arrival .recipient-sub {
  margin-top: 4px;
  color: #f8dfa0;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(2, 24, 52, 0.42);
}

.arrival-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8cc62, #e9a719);
  color: var(--ana-blue-deep);
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2), 0 20px 44px rgba(2, 25, 54, 0.42), inset 0 1px rgba(255,255,255,.68);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

.arrival-play:hover { transform: translateY(-3px) scale(1.03); }
.arrival-play:active { transform: scale(0.95); }
.arrival-play.is-opening { animation: postcard-envelope-pop 480ms var(--transition-base) both; }

.arrival-play-pulse {
  position: absolute;
  inset: -17px;
  border: 1.5px solid rgba(248, 223, 160, 0.8);
  border-radius: inherit;
  animation: postcard-arrival-pulse 1800ms ease-out infinite;
}

.arrival-play-hint {
  z-index: 1;
  margin: 28px 0 auto;
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 2px 15px rgba(2, 24, 52, 0.5);
}

@keyframes postcard-arrival-pulse {
  0% { opacity: 0.9; transform: scale(0.86); }
  75%, 100% { opacity: 0; transform: scale(1.22); }
}

/* تنها تصویر کارت + کنترل پخش در مرکز همان تصویر */
.postcard-frame-v3 .card-key-visual {
  aspect-ratio: 1.36 / 1;
}

.card-hero-play {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 108px;
  height: 108px;
  margin: 0;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #f8cc62, #e9a719);
  color: var(--ana-blue-deep);
  box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.22), 0 18px 40px rgba(3, 28, 59, 0.42), inset 0 1px rgba(255,255,255,.72);
}

.card-hero-play:hover { transform: translate(-50%, calc(-50% - 3px)) scale(1.03); }
.card-hero-play:active { transform: translate(-50%, -50%) scale(0.95); }

.card-play-hint {
  position: absolute;
  z-index: 3;
  top: calc(50% + 74px);
  right: 14px;
  left: 14px;
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 12px rgba(2, 24, 52, 0.6);
}

.postcard-frame-v3 .postcard-message {
  padding-top: 20px;
}

.postcard-frame-v3 .recipient-waveform {
  height: 28px;
  margin-top: 10px;
}

/* ==========================================================================
   تصاویر جدید کمپین و ویترین محصولات آنا
   ========================================================================== */

.hero-visual {
  aspect-ratio: 1.38 / 1;
  border-radius: 28px 28px 92px 28px;
  background: #164f90;
}

.hero-visual > img {
  object-position: center 37%;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-visual:hover > img {
  transform: scale(1.025);
}

.ana-product-spotlight {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid rgba(143, 199, 232, 0.5);
  border-radius: 22px 22px 50px 22px;
  background: linear-gradient(135deg, #0f4e91, #2476c4);
  box-shadow: 0 16px 32px rgba(13, 63, 117, 0.18);
}

.ana-product-spotlight::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.18), transparent 36%);
}

.ana-product-spotlight-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ana-product-spotlight-head > span:last-child {
  color: var(--ana-gold-soft);
  font-size: 17px;
  line-height: 1;
}

.ana-product-spotlight img {
  position: relative;
  z-index: 0;
  width: 100%;
  aspect-ratio: 1.78 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 0 0 47px 21px;
}

.final-success-art > img {
  object-position: center 37%;
}

.postcard-frame-v3 .card-key-visual > img {
  object-position: center 36%;
}

.postcard-arrival::before {
  background-image: url("ana-family-hero.jpg");
  background-position: center 36%;
}

@media (max-width: 359px) {
  .hero-visual { aspect-ratio: 1.48 / 1; }
  .ana-product-spotlight { margin-top: 14px; }
  .ana-product-spotlight-head { padding: 8px 12px 7px; }
}

/* ==========================================================================
   نمایش تک‌صفحه‌ای موبایل و کانال‌های اشتراک‌گذاری
   ========================================================================== */

.share-channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-channel {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(13, 61, 112, 0.16);
  transition: transform var(--transition-base), filter var(--transition-base);
}

.share-channel:hover { filter: brightness(1.06); transform: translateY(-1px); }
.share-channel:active { transform: scale(0.98); }
.share-channel--telegram { background: #249bd7; }
.share-channel--whatsapp { background: #21a564; }

.postcard-product-strip {
  width: 100%;
  height: 70px;
  flex: 0 0 auto;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid rgba(143, 199, 232, 0.6);
  border-radius: 16px 16px 34px 16px;
  background: #0876da;
  box-shadow: 0 10px 22px rgba(14, 68, 127, 0.12);
}

.postcard-product-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 68%;
}

@media (max-width: 759px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .page {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
  }

  .shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0 !important;
    border-radius: 0 !important;
    overflow: hidden;
  }

  .wizard-progress {
    flex: 0 0 auto;
    padding: max(8px, env(safe-area-inset-top)) 16px 0;
  }

  .brand-wave {
    height: 18px;
  }

  .brand-footer {
    min-height: 28px;
    padding: 4px 12px max(5px, env(safe-area-inset-bottom));
    font-size: 10px;
  }

  .brand-footer img { height: 16px; }

  .wizard-step {
    min-height: 0;
    overflow: hidden;
    padding: 10px 20px 8px;
  }

  .step-eyebrow {
    min-height: 18px;
    margin-bottom: 6px;
    font-size: 10px;
  }

  .step-eyebrow span:last-child { padding: 2px 8px; }
  .step-back { min-height: 24px; padding: 2px 0; font-size: 12px; }

  .step-title {
    margin-top: 9px;
    font-size: clamp(20px, 5.7vw, 26px);
    line-height: 1.35;
  }

  .step-subtitle {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.55;
  }

  .btn {
    min-height: 46px;
    padding: 11px 16px;
    border-radius: 16px;
    font-size: 14px;
  }

  .wizard-step[data-step="1"] .hero-visual {
    height: clamp(130px, 25dvh, 195px);
    aspect-ratio: auto;
  }

  .wizard-step[data-step="1"] .step-title { margin-top: 10px; }
  .wizard-step[data-step="1"] .step-subtitle { font-size: 12px; }
  .wizard-step[data-step="1"] .step-spacer { min-height: 7px; }

  .ana-product-spotlight {
    height: clamp(58px, 11dvh, 82px);
    margin-top: 10px;
    border-radius: 16px 16px 35px 16px;
    box-shadow: 0 9px 18px rgba(13, 63, 117, 0.15);
  }

  .ana-product-spotlight::after { display: none; }

  .ana-product-spotlight img {
    height: 100%;
    aspect-ratio: auto;
    object-position: center 68%;
    border-radius: inherit;
  }

  .wizard-step[data-step="2"] .field {
    margin-top: 14px;
  }

  .wizard-step[data-step="2"] .field input[type="text"] {
    padding: 10px 13px;
    border-radius: 13px;
  }

  .wizard-step[data-step="3"] .step-title { margin-top: 3px; }
  .wizard-step[data-step="3"] .recorder { margin-top: 9px; }

  .wizard-step[data-step="3"] .recorder-ring {
    width: clamp(136px, 23dvh, 172px);
    height: clamp(136px, 23dvh, 172px);
  }

  .wizard-step[data-step="3"] .mic-button {
    width: clamp(68px, 12dvh, 84px);
    height: clamp(68px, 12dvh, 84px);
  }

  .wizard-step[data-step="3"] .timer { margin-top: 4px; font-size: 22px; }
  .wizard-step[data-step="3"] .recorder-hint { margin-top: 1px; font-size: 12px; }
  .wizard-step[data-step="3"] .waveform { height: 40px; margin-top: 6px; }
  .wizard-step[data-step="3"] .voice-file-button { margin-top: 5px; padding: 7px 12px; font-size: 12px; }

  .wizard-step[data-step="3"] .recording-prompts {
    margin-top: 7px;
    border-radius: 13px;
  }

  .wizard-step[data-step="3"] .recording-prompts h3 {
    padding: 6px 11px;
    font-size: 12px;
  }

  .wizard-step[data-step="3"] .suggestion-item {
    padding: 4px 11px;
    font-size: 11px;
    line-height: 1.45;
  }

  .wizard-step[data-step="4"] .auto-mix-status {
    min-height: 48px;
    margin-top: 10px;
    padding: 10px;
    font-size: 12px;
  }

  .wizard-step[data-step="4"] .playback-card { margin-top: 10px; padding: 10px; }
  .wizard-step[data-step="4"] .play-toggle { width: 48px; height: 48px; }
  .wizard-step[data-step="4"] .playback-waveform { height: 36px; }
  .wizard-step[data-step="4"] .mix-note { margin-top: 8px; padding: 8px 10px; font-size: 11px; }

  .inline-consent {
    margin-top: 9px;
    padding: 10px 12px;
    border-radius: 15px;
  }

  .inline-consent .checkbox-field { margin-top: 6px; }
  .inline-consent .checkbox-field label { font-size: 10px; line-height: 1.55; }
  .inline-consent .privacy-note { padding: 6px 8px; font-size: 9px; }
  .review-actions { margin-top: 8px; gap: 7px; }

  .final-success-step { padding-top: 8px; }
  .final-success-art { height: clamp(115px, 21dvh, 175px); aspect-ratio: auto; }
  .final-success-copy { padding: 10px 8px; }
  .final-success-copy h2 { font-size: clamp(20px, 5.8vw, 26px); }
  .final-success-copy p { margin-top: 3px; font-size: 11px; line-height: 1.55; }
  .final-success-actions { gap: 7px; }
  .share-channels { gap: 7px; }
  .share-channel { min-height: 42px; border-radius: 14px; font-size: 12px; }
  .final-link-actions { padding-top: 2px; font-size: 10px; }

  .card-scene {
    min-height: 0;
    overflow: hidden;
    padding: 10px 14px 12px;
  }

  .postcard-frame-v3 .card-key-visual {
    height: clamp(145px, 28dvh, 220px);
    aspect-ratio: auto;
  }

  .postcard-frame-v3 .postcard-message { padding: 12px 16px; }
  .postcard-frame-v3 .postcard-message h1 { font-size: 22px; }
  .postcard-frame-v3 .postcard-note { margin-top: 3px; font-size: 11px; line-height: 1.55; }
  .postcard-frame-v3 .recipient-waveform { height: 18px; margin-top: 6px; }
  .postcard-product-strip { height: clamp(50px, 8dvh, 62px); margin-top: 8px; }
  .card-scene .after-play { margin-top: 8px; padding: 9px; }
  .card-scene .after-play p { font-size: 11px; }
}

@media (max-width: 759px) and (max-height: 620px) {
  .wizard-progress { padding-top: max(5px, env(safe-area-inset-top)); }
  .brand-wave { height: 13px; }
  .brand-footer { min-height: 23px; padding-block: 3px; }
  .wizard-step { padding-top: 6px; padding-bottom: 5px; }
  .wizard-step[data-step="1"] .hero-visual { height: clamp(104px, 22dvh, 138px); }
  .ana-product-spotlight { height: clamp(48px, 9dvh, 58px); margin-top: 6px; }
  .step-title { margin-top: 5px; font-size: 19px; }
  .step-subtitle { font-size: 11px; }
  .wizard-step[data-step="3"] .recorder-ring { width: 130px; height: 130px; }
  .wizard-step[data-step="3"] .recording-prompts h3 { display: none; }
  .wizard-step[data-step="3"] .suggestion-item { padding-block: 3px; font-size: 10px; }
  .final-success-art { height: 108px; }
  .final-success-copy { padding-block: 6px; }
  .postcard-frame-v3 .card-key-visual { height: 138px; }
}

/* ==========================================================================
   اصلاح نهایی نمای موبایل: تصویر کامل، ضبط هم‌مرکز و کارت‌پستال خوانا
   ========================================================================== */

.wizard-step[data-step="1"] .hero-visual {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0d427b, #2f79bf);
}

.wizard-step[data-step="1"] .hero-visual > img {
  object-fit: contain;
  object-position: center;
}

.wizard-step[data-step="3"] .recording-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
}

.wizard-step[data-step="3"] .recording-prompts h3 {
  grid-column: 1 / -1;
  padding: 0 3px 2px;
}

.wizard-step[data-step="3"] .suggestion-item {
  min-width: 0;
  padding: 6px 5px;
  border: 1px solid rgba(143, 199, 232, 0.48);
  border-radius: 10px;
  color: var(--ana-blue-deep);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 759px) {
  .wizard-step[data-step="1"] .hero-visual {
    height: clamp(155px, 28dvh, 230px);
  }

  .wizard-step[data-step="3"] .recorder-ring {
    isolation: isolate;
    flex: 0 0 auto;
  }

  .wizard-step[data-step="3"] .recording-prompts {
    margin-top: 6px;
    gap: 4px;
    padding: 5px;
  }

  .wizard-step[data-step="3"] .recording-prompts h3 {
    display: block;
    padding: 0 3px 2px;
    font-size: 11px;
  }

  .wizard-step[data-step="3"] .suggestion-item {
    padding: 4px;
    font-size: 9px;
    line-height: 1.35;
  }

  .postcard-frame-v3 {
    width: 100%;
    flex: 0 0 auto;
  }

  .postcard-product-strip {
    width: 100%;
    flex: 0 0 auto;
  }

  .card-scene .after-play.is-visible {
    flex: 0 0 auto;
  }
}

@media (max-width: 759px) and (max-height: 620px) {
  .wizard-step[data-step="1"] .hero-visual {
    height: clamp(120px, 25dvh, 160px);
  }

  .wizard-step[data-step="3"] .recording-prompts h3 {
    display: block;
    font-size: 10px;
  }

  .wizard-step[data-step="3"] .suggestion-item {
    padding: 3px;
    font-size: 8.5px;
  }
}

/* ==========================================================================
   صفحهٔ گیرنده — دعوت واضح به پخش و پوستر کمپین آنا
   ========================================================================== */

.card-hero-play:not(.is-playing) .pulse {
  animation: postcard-pulse 1600ms ease-out infinite;
  border-color: rgba(255, 255, 255, 0.94);
}

.card-play-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 238px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(7, 39, 78, 0.68);
  box-shadow: 0 8px 20px rgba(2, 24, 52, 0.25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.card-play-hint-icon {
  flex: 0 0 auto;
  color: var(--ana-gold-soft);
}

.postcard-product-poster {
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 1200 / 541;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid rgba(143, 199, 232, 0.62);
  border-radius: 20px 20px 42px 20px;
  background: #0876da;
  box-shadow: 0 14px 30px rgba(14, 68, 127, 0.16);
}

.postcard-product-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 759px) {
  .postcard-product-poster {
    margin-top: 8px;
    border-radius: 16px 16px 34px 16px;
  }

  .card-scene.has-after-play .postcard-product-poster {
    height: clamp(66px, 11dvh, 90px);
    aspect-ratio: auto;
  }

  .card-scene.has-after-play .postcard-product-poster img {
    object-fit: contain;
  }
}

@media (max-width: 759px) and (max-height: 620px) {
  .postcard-product-poster {
    height: clamp(76px, 24vw, 104px);
    aspect-ratio: auto;
  }

  .postcard-product-poster img {
    object-fit: contain;
  }
}

/* Recipient postcard: a photographic breakfast assembled from transparent
   assets. Each layer can enter independently without shifting the audio UI. */
.breakfast-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 250px;
  aspect-ratio: 1.36 / 1;
  flex: 0 0 auto;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 25px 25px 47px 25px;
  background: #d3e5ed;
  box-shadow: 0 18px 40px rgba(11, 57, 104, .19);
}

.breakfast-stage::after {
  content: "";
  position: absolute;
  z-index: 9;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.58), inset 0 -22px 32px rgba(56,37,16,.06);
}

.breakfast-stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 49%;
  transform-origin: 50% 50%;
}

.breakfast-stage-light {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 82% 8%, rgba(255,236,185,.32), transparent 48%);
  mix-blend-mode: screen;
}

.breakfast-stage-title {
  position: absolute;
  z-index: 8;
  top: 13px;
  right: 14px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: #174f89;
  font-family: var(--font-campaign, var(--font-fa));
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 5px 16px rgba(30, 76, 108, .12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.breakfast-stage .breakfast-item {
  position: absolute;
  max-width: none;
  height: auto;
  transform-origin: 50% 100%;
  pointer-events: none;
  will-change: transform, opacity;
}

.breakfast-stage.is-pending .breakfast-item,
.breakfast-stage.is-pending .breakfast-stage-title {
  opacity: 0;
}

.breakfast-item-products {
  z-index: 3;
  bottom: 22%;
  left: -2.5%;
  width: 105%;
  filter: drop-shadow(0 10px 9px rgba(55, 49, 42, .22));
}

.breakfast-item-bread {
  z-index: 5;
  bottom: -10%;
  left: -10%;
  width: 54%;
  filter: drop-shadow(0 11px 9px rgba(65, 42, 22, .23));
}

.breakfast-item-produce {
  z-index: 5;
  bottom: -4%;
  right: 19%;
  width: 27%;
  filter: drop-shadow(0 10px 9px rgba(65, 42, 22, .23));
}

.breakfast-item-tea {
  z-index: 4;
  bottom: 11%;
  right: 0;
  width: 26%;
  filter: drop-shadow(0 8px 7px rgba(65, 42, 22, .19));
}

.breakfast-steam-field {
  position: absolute;
  z-index: 6;
  right: 8.5%;
  bottom: 46%;
  width: 42px;
  height: 44px;
  pointer-events: none;
}

.breakfast-steam-field i {
  position: absolute;
  bottom: 0;
  width: 13px;
  height: 37px;
  border-left: 2px solid rgba(255,255,255,.83);
  border-radius: 50%;
  filter: blur(.5px);
  opacity: 0;
}
.breakfast-steam-field i:nth-child(1) { left: 2px; }
.breakfast-steam-field i:nth-child(2) { left: 16px; }
.breakfast-steam-field i:nth-child(3) { left: 29px; }

.breakfast-stage-glint {
  position: absolute;
  z-index: 7;
  top: 39%;
  left: 43%;
  width: 40px;
  height: 40px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,222,128,.28) 28%, transparent 65%);
  filter: drop-shadow(0 0 8px rgba(255,223,130,.7));
}
.breakfast-stage-glint::before,
.breakfast-stage-glint::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
}
.breakfast-stage-glint::before { width: 2px; height: 31px; }
.breakfast-stage-glint::after { width: 31px; height: 2px; }

.breakfast-stage.is-in-view .breakfast-stage-bg {
  animation: breakfast-camera-enter 1.5s ease-out both;
}
.breakfast-stage.is-in-view .breakfast-item-bread {
  animation: breakfast-enter-left .88s .15s cubic-bezier(.18,1.18,.34,1) both;
}
.breakfast-stage.is-in-view .breakfast-item-tea {
  animation: breakfast-enter-right .88s .38s cubic-bezier(.18,1.18,.34,1) both;
}
.breakfast-stage.is-in-view .breakfast-item-produce {
  animation: breakfast-enter-up .82s .7s cubic-bezier(.18,1.18,.34,1) both;
}
.breakfast-stage.is-in-view .breakfast-item-products {
  animation: breakfast-product-hero 1.05s 1.03s cubic-bezier(.16,1.22,.34,1) both;
}
.breakfast-stage.is-in-view .breakfast-stage-title {
  animation: breakfast-title-enter .65s 1.5s ease-out both;
}
.breakfast-stage.is-in-view .breakfast-stage-glint {
  animation: breakfast-glint 1.25s 1.85s ease-out both;
}
.breakfast-stage.is-in-view .breakfast-steam-field i {
  animation: breakfast-steam-photo 2.75s 1.5s ease-in-out infinite;
}
.breakfast-stage.is-in-view .breakfast-steam-field i:nth-child(2) { animation-delay: 2.15s; }
.breakfast-stage.is-in-view .breakfast-steam-field i:nth-child(3) { animation-delay: 2.75s; }

.card-scene.is-playing .breakfast-stage.is-in-view .breakfast-item-products {
  animation: breakfast-product-float 3.5s ease-in-out infinite;
}
.card-scene.is-playing .breakfast-stage-light {
  animation: breakfast-morning-glow 3.5s ease-in-out infinite alternate;
}
.card-scene.is-active .card-key-visual > img {
  animation: postcard-photo-breathe 10s ease-in-out infinite alternate;
}

@keyframes breakfast-camera-enter {
  from { opacity: .7; transform: scale(1.075); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes breakfast-enter-left {
  from { opacity: 0; transform: translate(-70px, 30px) rotate(-11deg) scale(.86); }
  to { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
}
@keyframes breakfast-enter-right {
  from { opacity: 0; transform: translate(60px, 25px) rotate(8deg) scale(.84); }
  to { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
}
@keyframes breakfast-enter-up {
  from { opacity: 0; transform: translateY(48px) scale(.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes breakfast-product-hero {
  from { opacity: 0; transform: translateY(65px) scale(.84); }
  68% { opacity: 1; }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes breakfast-title-enter {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes breakfast-glint {
  0%, 100% { opacity: 0; transform: translate(-22px, 15px) scale(.35) rotate(-35deg); }
  40% { opacity: 1; transform: translate(0, 0) scale(1.1) rotate(0); }
}
@keyframes breakfast-steam-photo {
  0% { opacity: 0; transform: translateY(10px) rotate(7deg); }
  38% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-30px) rotate(-13deg); }
}
@keyframes breakfast-product-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes breakfast-morning-glow {
  from { opacity: .45; }
  to { opacity: 1; }
}
@keyframes postcard-photo-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

@media (max-width: 759px) and (max-height: 620px) {
  .card-scene { overflow: visible; flex-shrink: 0; }
  .breakfast-stage { min-height: 212px; height: 212px; aspect-ratio: auto; margin-top: 8px; }
  .breakfast-stage-title { top: 9px; right: 10px; padding: 4px 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .breakfast-stage *,
  .breakfast-stage *::before,
  .breakfast-stage *::after,
  .card-scene.is-active .card-key-visual > img {
    animation: none !important;
    transition: none !important;
  }
  .breakfast-stage-glint,
  .breakfast-steam-field { display: none; }
}
