/* ————————————————————————————————————————
   Wedding RSVP · Design 6 · “Bloom”
   Sage card, jasmine & anthurium garlands,
   olive + burgundy on cream — after the
   couple's reference stationery.
———————————————————————————————————————— */

:root {
  --cream: #f5f0e3;
  --ivory: #fdfbf2;
  --sage-card: #c6cfa9;
  --sage-line: #a8b184;
  --sage-soft: #d6dcbd;
  --olive: #6b7747;
  --olive-deep: #46512f;
  --olive-ink: #333a26;
  --burgundy: #7c2a39;
  --burgundy-deep: #5e1f2c;
  --burgundy-soft: rgba(124, 42, 57, 0.12);
  --gold: #d9a94f;
  --ink: #333a26;
  --ink-soft: #4d5639;
  --muted: #6e7553;
  --error: #8c2f2f;
  --ring: 0 0 0 4px rgba(124, 42, 57, 0.16);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: 'Jost', 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(900px 640px at 88% -10%, rgba(198, 207, 169, 0.5), transparent 60%),
    radial-gradient(820px 600px at -10% 104%, rgba(214, 220, 189, 0.6), transparent 56%),
    radial-gradient(700px 520px at 70% 100%, rgba(124, 42, 57, 0.07), transparent 62%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* paper grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}
.blob-1 {
  width: 44vmax; height: 44vmax;
  top: -16vmax; right: -12vmax;
  background: radial-gradient(circle, #d3dab6, transparent 65%);
  animation: drift-1 28s ease-in-out infinite alternate;
}
.blob-2 {
  width: 38vmax; height: 38vmax;
  bottom: -14vmax; left: -12vmax;
  background: radial-gradient(circle, #e4e6cf, transparent 65%);
  animation: drift-2 34s ease-in-out infinite alternate;
}
.blob-3 {
  width: 26vmax; height: 26vmax;
  top: 34%; left: 58%;
  background: radial-gradient(circle, rgba(154, 64, 78, 0.25), transparent 65%);
  animation: drift-3 24s ease-in-out infinite alternate;
}

@keyframes drift-1 { to { transform: translate(-8vmax, 6vmax) scale(1.1); } }
@keyframes drift-2 { to { transform: translate(7vmax, -5vmax) scale(1.06); } }
@keyframes drift-3 { to { transform: translate(-10vmax, 8vmax) scale(0.94); } }

/* ———— doves: sprite wing-beat, orbiting gently inside the card ———— */

.bird {
  width: 88px;
  height: 125px;
  background-image: url('/img/bird-cells.svg');
  background-size: auto 100%;
  will-change: background-position;
  animation: fly-cycle 1s steps(10) infinite;
  filter: drop-shadow(0 6px 9px rgba(70, 81, 47, 0.3));
}

.bird-one { animation-duration: 1.05s; animation-delay: -0.5s; }
.bird-two { animation-duration: 0.92s; animation-delay: -0.75s; }

@keyframes fly-cycle {
  100% { background-position: -900px 0; }
}

.card-doves {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

/* content always sits above the circling doves */
.frame, .step {
  position: relative;
  z-index: 1;
}

/* The doves glide left-to-right along a single lane at the top of the
   card, in the gap between the garland and the progress trail. */
.orbit-dove {
  position: absolute;
  top: clamp(60px, 12vw, 86px);
  left: 0;
  width: 88px;
  height: 125px;
  margin: -62px 0 0 -44px; /* center the dove glyph on the lane line */
  animation: glide-card 15s linear infinite;
  will-change: left;
}
.orbit-a { animation-duration: 15s; animation-delay: -5s; }
.orbit-b {
  animation-duration: 21s;
  animation-delay: -13s;
  top: calc(clamp(60px, 12vw, 86px) + 12px);
}

.orbit-dove .bird { transform: scale(0.38); }
.orbit-b .bird { transform: scale(0.29); opacity: 0.85; }

@keyframes glide-card {
  0%   { left: -9%; }
  100% { left: 109%; }
}

/* ———— envelope cover ———— */

body.locked { overflow: hidden; height: 100vh; }

.env {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(130% 96% at 50% 6%, #f3eede 0%, #dfe3c8 56%, #c6cfa9 100%);
  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.env::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
.env.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.env-stage {
  display: flex; flex-direction: column; align-items: center; gap: 30px;
  transition: transform 0.8s ease, opacity 0.8s ease;
}
.env.is-open .env-stage { transform: translateY(-24px); }
.env.gone .env-stage { transform: translateY(-60px); opacity: 0; }

.env-card {
  position: relative;
  width: min(330px, 80vw);
  aspect-ratio: 7 / 4.7;
  perspective: 900px;
  background: linear-gradient(158deg, #f7f3e6 0%, #e7ebd5 100%);
  border: 1px solid rgba(107, 119, 71, 0.42);
  border-radius: 8px;
  box-shadow: 0 34px 66px -26px rgba(70, 74, 42, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}
/* faint seams: side flaps meeting at the lower centre */
.env-pocket {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  background:
    linear-gradient(to top right, transparent calc(50% - 0.7px), rgba(107, 119, 71, 0.18) 50%, transparent calc(50% + 0.7px)),
    linear-gradient(to top left, transparent calc(50% - 0.7px), rgba(107, 119, 71, 0.18) 50%, transparent calc(50% + 0.7px));
  background-size: 50% 100%, 50% 100%;
  background-position: left bottom, right bottom;
  background-repeat: no-repeat;
}

.env-flap {
  position: absolute; top: 0; left: 0; right: 0;
  height: 58%;
  background: linear-gradient(168deg, #e9edd6 0%, #cdd6b3 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.9s cubic-bezier(0.6, 0.02, 0.2, 1);
  backface-visibility: hidden;
  z-index: 3;
  filter: drop-shadow(0 7px 8px rgba(70, 74, 42, 0.28));
}
.env.is-open .env-flap { transform: rotateX(-174deg); }

.env-seal {
  position: absolute; left: 50%; top: 53%;
  width: clamp(78px, 23vw, 98px); height: auto;
  transform: translate(-50%, -50%);
  z-index: 4;
  filter: drop-shadow(0 6px 9px rgba(70, 74, 42, 0.4));
  transition: opacity 0.4s ease, transform 0.5s ease;
}
.env.is-open .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(-12deg); }

.env-hint {
  display: flex; align-items: center; gap: 9px;
  margin: 0;
  font-family: 'Jost', 'Tajawal', sans-serif;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.26em; text-indent: 0.26em; text-transform: uppercase;
  color: var(--olive-deep);
  animation: hint-pulse 2.4s ease-in-out infinite;
}
.env-hint-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--burgundy);
  box-shadow: 0 0 0 4px rgba(124, 42, 57, 0.22);
}
[dir="rtl"] .env-hint { letter-spacing: 0; text-indent: 0; }
@keyframes hint-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .env-hint { animation: none; opacity: 1; }
}

/* ———— layout shell ———— */

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: clamp(18px, 4vw, 48px) 16px 28px;
}

.card {
  position: relative;
  width: min(600px, 100%);
  background: linear-gradient(178deg, #cbd4b0, #c0c9a2);
  border: 1px solid #aab57f;
  border-radius: 16px;
  box-shadow:
    0 28px 70px -28px rgba(60, 68, 38, 0.5),
    inset 0 1px 0 rgba(255, 255, 250, 0.4);
  padding:
    clamp(96px, 18vw, 126px)
    clamp(22px, 6vw, 56px)
    clamp(88px, 16vw, 112px);
  text-align: center;
}

.garland {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.garland-top { top: 8px; }
.garland-bottom { bottom: 8px; transform: scaleY(-1); }

.foot {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  color: #7a815e;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot svg { width: 30px; height: 20px; opacity: 0.8; }
.foot svg circle { stroke: #7a815e; }

/* ———— journey trail (from The Journey) ———— */

/* icons only — fixed LTR so the trail reads identically in both languages */
.frame { margin: 0 auto 26px; max-width: 350px; direction: ltr; }

.trail {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
}

.trail-line, .trail-fill {
  position: absolute;
  top: 50%;
  height: 3px;
  border-radius: 999px;
  transform: translateY(-50%);
}
.trail-line {
  inset-inline: 16px;
  background-image: linear-gradient(90deg, rgba(70, 81, 47, 0.4) 55%, transparent 0);
  background-size: 11px 3px;
}
.trail-fill {
  inset-inline-start: 16px;
  width: 0;
  max-width: calc(100% - 32px);
  background: var(--olive-deep);
  transition: width 0.7s cubic-bezier(0.3, 0.8, 0.3, 1);
}

.trail-node {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid var(--sage-line);
  color: var(--muted);
  transition: background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}
.trail-node svg { width: 16px; height: 16px; }

.trail-node.done {
  background: var(--olive);
  border-color: var(--olive);
  color: #fdfbf2;
}
.trail-node.now {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: #fdfbf2;
  animation: node-bounce 1.5s ease-in-out infinite;
}

@keyframes node-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

/* ———— steps ———— */

.step { display: none; }
.step.is-active { display: block; animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ———— invitation ———— */

.ornament { width: min(220px, 66%); margin: 0 auto 14px; display: block; }
.ornament-sm { margin: 24px auto; width: min(200px, 60%); }

.doves-pair { width: min(240px, 70%); margin-bottom: 6px; }
.pair-dove path {
  fill: var(--ivory);
  stroke: var(--olive-deep);
  stroke-width: 2.4;
  stroke-linejoin: round;
}

.verse {
  font-family: 'Amiri', serif;
  font-size: clamp(17px, 3.4vw, 21px);
  color: var(--olive-deep);
  margin: 0 auto 18px;
  line-height: 1.9;
  /* em, not ch: ch resolves against locale digit glyphs and differs
     between the en/ar documents, making the verse wrap in one only */
  max-width: 16.5em;
}

.fathers {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(22px, 8vw, 56px);
  margin: 2px 0 16px;
}
/* the groom's father stays on the right in both directions */
html[dir="ltr"] .fathers { flex-direction: row-reverse; }

.father-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.father-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--burgundy);
  line-height: 15px; /* equal box in both languages */
}
[dir="rtl"] .father-label {
  font-family: 'Tajawal', sans-serif;
  font-size: 12.5px;
  letter-spacing: 0;
}

.father {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(17px, 3.4vw, 22px);
  line-height: 1.25;
  color: var(--ink);
}
/* size × line-height matches the Latin box at every viewport width */
[dir="rtl"] .father {
  font-family: 'Aref Ruqaa', serif;
  font-weight: 400;
  font-size: clamp(16px, 3.2vw, 20.7px);
  line-height: 1.328;
}

.notices {
  display: grid;
  gap: 7px;
  margin: 22px auto 0;
  max-width: 46ch;
}

.notice {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 15.5px;
  color: var(--burgundy-deep);
  margin: 0;
  line-height: 25px; /* equal box in both languages */
}
.notice-kids { color: var(--olive-deep); }
[dir="rtl"] .notice {
  font-family: 'Amiri', serif;
  font-style: normal;
  font-size: 16.5px;
}

/* Parisienne names with a slow burgundy-foil shimmer (from Gold Hour);
   groom and bride side by side with the connector between, as in the
   reference invitation. */
.names {
  font-family: 'Parisienne', cursive;
  font-weight: 400;
  font-size: clamp(36px, 9.5vw, 64px);
  line-height: 1.18;
  margin: -20px 0 16px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: baseline;
  gap: clamp(14px, 4vw, 30px);
  background: linear-gradient(105deg, #5e1f2c 0%, #a8475c 26%, #7c2a39 50%, #c2707f 74%, #5e1f2c 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil 6s linear infinite;
}

@keyframes foil {
  to { background-position: -220% 0; }
}

.names .amp {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.44em;
  line-height: 1; /* keep the connector inside the names' box in both languages */
}

.headline {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(17px, 2.6vw, 19px);
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0 auto;
  line-height: 1.55;
  /* reserve two lines and center: EN wraps to 2, AR fits 1 — same box either way */
  min-height: 3.1em;
  display: grid;
  align-content: center;
}

/* three-column date / venue / reception row with icons, per the reference */
.info-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  margin: -17px auto 4px;
  max-width: 460px;
}

.info-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
}

.info-mid {
  border-inline: 1px solid var(--sage-line);
}

.info-cell svg {
  width: 24px;
  height: 24px;
  color: var(--olive-deep);
  margin-bottom: 2px;
}

.info-main {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(15px, 3vw, 18px);
  color: var(--ink);
  line-height: 1.25;
}

.info-sub {
  font-size: clamp(12px, 2.5vw, 14px);
  color: var(--ink-soft);
  line-height: 1.35;
}

[dir="rtl"] .info-main {
  font-family: 'Amiri', serif;
  font-weight: 700;
}

.venue-address {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px auto 2px;
  max-width: 420px;
  font-size: clamp(12.5px, 2.6vw, 14.5px);
  color: var(--ink-soft);
  line-height: 1.4;
  text-align: center;
}

.venue-address svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--olive-deep);
}

[dir="rtl"] .venue-address { font-family: 'Tajawal', sans-serif; }

/* polaroid map (from The Garden) */
.map-wrap {
  position: relative;
  display: block;
  width: min(400px, 96%);
  height: 188px;
  margin: 20px auto 8px;
  background: #fff;
  border: 10px solid #fff;
  border-bottom-width: 30px;
  border-radius: 4px;
  overflow: visible;
  box-shadow: 0 16px 34px -16px rgba(50, 56, 30, 0.5);
  cursor: pointer;
  transform: rotate(-1.6deg);
  transition: transform 0.3s, box-shadow 0.3s;
}
.map-wrap:hover { transform: rotate(0.4deg) translateY(-3px); box-shadow: 0 22px 42px -18px rgba(50, 56, 30, 0.6); }
.map-wrap:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 4px; }

.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  filter: saturate(0.85) sepia(0.08);
}

.map-open {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Caveat', cursive;
  font-size: 16.5px;
  line-height: 24px; /* equal box in both languages */
  color: var(--olive-deep);
  white-space: nowrap;
  pointer-events: none;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2.6vw, 16px);
  margin: 21px 0 28px;
}

.cd-cell {
  /* fixed width (not content-sized): the long English labels would
     otherwise widen the cells — and the card itself — in one language */
  width: clamp(58px, 16vw, 72px);
  min-width: 0;
  padding: 13px 6px 10px;
  background: var(--ivory);
  border: 1px solid var(--sage-line);
  border-radius: 12px;
  box-shadow: 0 6px 14px -10px rgba(60, 68, 38, 0.4);
}

.cd-num {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--burgundy);
}

.cd-lbl {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em; /* "SECONDS" must fit the narrowest cell */
  text-indent: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.quiet {
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0 0;
  line-height: 19px; /* equal box in both languages */
}

/* ———— buttons ———— */

.btn {
  position: relative;
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-transform: uppercase;
  border: none;
  border-radius: 999px;
  padding: 17px 42px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, filter 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  color: #fdf6ef;
  background: linear-gradient(180deg, #93374a, #6e2533);
  box-shadow: 0 14px 30px -12px rgba(94, 31, 44, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -80%;
  width: 50%;
  background: linear-gradient(105deg, transparent, rgba(255, 245, 240, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  color: var(--burgundy);
  background: var(--ivory);
  border: 1.5px solid var(--burgundy);
  text-decoration: none;
}
.btn-outline:hover { background: #f6ecdf; }

.btn:focus-visible { outline: 2px solid var(--burgundy-deep); outline-offset: 3px; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-wide { width: 100%; margin-top: 6px; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(253, 246, 239, 0.45);
  border-top-color: #fdf6ef;
  animation: spin 0.7s linear infinite;
  z-index: 2;
}
.btn-outline.is-loading::before { border-color: rgba(124, 42, 57, 0.3); border-top-color: var(--burgundy); }
@keyframes spin { to { transform: rotate(360deg); } }

.link-quiet {
  display: inline-block;
  margin-top: 22px;
  background: none;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.2s;
}
.link-quiet:hover { color: var(--burgundy); }
.link-quiet:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }

.link-gold {
  background: none;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--burgundy);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(124, 42, 57, 0.45);
  transition: color 0.2s;
}
.link-gold:hover { color: var(--burgundy-deep); }
.link-gold:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.link-gold:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; }

/* ———— forms ———— */

.step-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(30px, 6vw, 38px);
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.step-sub {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 auto 28px;
  max-width: 40ch;
  line-height: 1.6;
}

.step-icon { width: 46px; height: 46px; margin: 0 auto 14px; display: block; }
.step-icon path, .step-icon rect { stroke: var(--olive-deep); }

form { text-align: start; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

.field { margin-bottom: 20px; }

label, .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive-deep);
  margin-bottom: 8px;
  text-align: start;
}

input, textarea {
  width: 100%;
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  color: var(--olive-ink);
  background: var(--ivory);
  border: 1px solid var(--sage-line);
  border-radius: 12px;
  padding: 13px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder, textarea::placeholder { color: #9aa078; }
input:focus, textarea:focus { outline: none; border-color: var(--burgundy); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 88px; line-height: 1.55; }

.phone-field { position: relative; }
.phone-wrap { display: flex; }

.cc-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  background: #e9e7d2;
  border: 1px solid var(--sage-line);
  border-right: none;
  border-radius: 12px 0 0 12px;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  color: var(--ink-soft);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s;
}
.cc-btn:hover { background: #e0ddc2; }
.cc-btn:focus-visible { outline: 2px solid var(--burgundy); outline-offset: -2px; }

.cc-flag { border-radius: 2.5px; display: block; }
.cc-caret { width: 10px; height: 6px; color: var(--muted); }

.phone-wrap input { border-radius: 0 12px 12px 0; }

.cc-panel {
  position: absolute;
  inset-inline: 0;
  z-index: 30;
  margin-top: 6px;
  background: var(--ivory);
  border: 1px solid var(--sage-line);
  border-radius: 14px;
  box-shadow: 0 20px 46px -18px rgba(50, 56, 30, 0.5);
  padding: 10px;
}

.cc-search { padding: 10px 14px; border-radius: 10px; font-size: 15px; }

.cc-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 218px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cc-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 14.5px;
  cursor: pointer;
}
.cc-list li:hover, .cc-list li.active { background: #eef0db; }
.cc-list img { border-radius: 2.5px; flex: 0 0 auto; }
.cc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-code { color: var(--muted); font-size: 13.5px; direction: ltr; }

.hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 2px 0;
  line-height: 1.5;
  text-align: start;
}

/* stepper + hearts (from The Journey) */

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 6px;
  background: var(--ivory);
  border: 1px solid var(--sage-line);
  border-radius: 999px;
}

.step-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #e9e7d2;
  color: var(--olive-deep);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
}
.step-btn:hover { background: #e0ddc2; transform: scale(1.07); }
.step-btn:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
.step-btn:disabled { opacity: 0.4; cursor: default; transform: none; }

.step-val {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 24px;
  min-width: 2ch;
  text-align: center;
  color: var(--burgundy);
}

.hearts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.heart {
  width: 34px;
  height: 34px;
  padding: 5px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.heart svg { width: 100%; height: 100%; fill: #e6e3cb; transition: fill 0.2s; }
.heart:hover { transform: scale(1.2); }
.heart.on svg { fill: var(--burgundy); }
.heart.pop { animation: heart-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }

@keyframes heart-pop {
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.form-error {
  display: block;
  font-size: 13.5px;
  color: var(--error);
  background: rgba(140, 47, 47, 0.09);
  border: 1px solid rgba(140, 47, 47, 0.32);
  border-radius: 11px;
  padding: 10px 14px;
  margin: 0 0 16px;
  text-align: center;
  line-height: 1.5;
}

.note {
  font-size: 13px;
  color: var(--burgundy-deep);
  background: var(--burgundy-soft);
  border: 1px solid rgba(124, 42, 57, 0.32);
  border-radius: 11px;
  padding: 9px 14px;
  margin: 0 0 18px;
  line-height: 1.5;
}

.nowrap { white-space: nowrap; }

/* ———— OTP ———— */

.otp-row {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 2vw, 10px);
  margin: 6px 0 18px;
}

.otp-box {
  width: clamp(40px, 11.5vw, 50px);
  height: 58px;
  padding: 0;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 26px;
}

.otp-box.filled {
  border-color: var(--olive);
  background: #eef0db;
  animation: otp-pop 0.25s ease;
}

@keyframes otp-pop {
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.otp-row.shake { animation: shake 0.4s ease; }
@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.resend { font-size: 14px; color: var(--muted); margin: 20px 0 0; }

/* ———— confirm summary ———— */

.summary {
  max-width: 380px;
  margin: 0 auto 26px;
  text-align: start;
  background: var(--ivory);
  border: 1px solid var(--sage-line);
  border-radius: 16px;
  padding: 6px 18px;
}
.summary > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 13px 2px;
  border-bottom: 1px dashed var(--sage-line);
}
.summary > div:last-child { border-bottom: none; }
.summary dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.summary dd {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 19px;
  color: var(--olive-ink);
  text-align: right;
}

.summary .dd-msg {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 210px;
  overflow-wrap: break-word;
}

/* ———— done ———— */

.check { width: 76px; height: 76px; margin: 4px auto 18px; display: block; }
.check-circle {
  fill: none;
  stroke: var(--olive);
  stroke-width: 2;
  stroke-dasharray: 202;
  stroke-dashoffset: 202;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: draw 0.8s ease forwards;
}
.check-mark {
  fill: none;
  stroke: var(--burgundy);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: draw 0.5s 0.65s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ———— toast ———— */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  background: #3a4128;
  color: #f3f0e0;
  font-size: 14px;
  padding: 13px 24px;
  border-radius: 999px;
  box-shadow: 0 14px 34px -12px rgba(40, 46, 24, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
  max-width: min(92vw, 480px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ———— Arabic / RTL ———— */

[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] button,
[dir="rtl"] .toast {
  font-family: 'Tajawal', 'Jost', sans-serif;
}

[dir="rtl"] .eyebrow,
[dir="rtl"] .when,
[dir="rtl"] .cd-lbl,
[dir="rtl"] label,
[dir="rtl"] .label,
[dir="rtl"] .btn,
[dir="rtl"] .step-title,
[dir="rtl"] .foot,
[dir="rtl"] .design-badge {
  letter-spacing: 0;
  text-indent: 0;
}

/* 0.9 × the Latin size with the line-height scaled inversely (1.18 / 0.9),
   so the names occupy the exact same box as the English ones at every width */
[dir="rtl"] .names {
  font-family: 'Aref Ruqaa', serif;
  font-size: clamp(32.4px, 8.55vw, 57.6px);
  line-height: 1.311;
}
[dir="rtl"] .names .amp {
  font-family: 'Amiri', serif;
  font-style: normal;
  font-size: 0.52em;
}

[dir="rtl"] .headline,
[dir="rtl"] .when-sub {
  font-family: 'Amiri', serif;
  font-style: normal;
}

[dir="rtl"] .when,
[dir="rtl"] .venue,
[dir="rtl"] .step-title,
[dir="rtl"] .step-val,
[dir="rtl"] .summary dd,
[dir="rtl"] .otp-box {
  font-family: 'Amiri', serif;
}

[dir="rtl"] .map-open { font-family: 'Aref Ruqaa', serif; font-size: 15px; }

[dir="rtl"] .phone-wrap,
[dir="rtl"] .otp-row {
  direction: ltr;
}

/* the invitation keeps one fixed layout in both languages — like the
   fathers row above, dates stay left, reception right, pin icon left */
[dir="rtl"] .info-row,
[dir="rtl"] .countdown,
[dir="rtl"] .venue-address {
  flex-direction: row-reverse;
}

[dir="rtl"] .summary dd { text-align: left; }
[dir="rtl"] .summary .dd-msg { font-family: 'Tajawal', sans-serif; }

/* ———— language tag ————
   A segmented tag clipped onto the card's top edge, styled like the
   countdown cells. Declared after the RTL section and kept LTR so it
   renders identically in every language. */

.lang-tag {
  visibility: hidden;
  position: absolute;
  top: -12px;
  right: 18px;
  z-index: 2;
  display: flex;
  direction: ltr;
  padding: 3px;
  background: var(--ivory);
  border: 1px solid var(--sage-line);
  border-radius: 999px;
  box-shadow: 0 6px 14px -10px rgba(60, 68, 38, 0.4);
}

.lang-tag button {
  visibility: hidden;
  position: relative;
  background: none;
  border: none;
  border-radius: 999px;
  font-family: 'Jost', 'Tajawal', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--olive-deep);
  padding: 6px 13px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
/* slim tag, full-size touch target */
.lang-tag button::after {
  content: '';
  position: absolute;
  inset: -10px 0;
}
.lang-tag button:hover { background: #eef0db; }
.lang-tag button:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; }
.lang-tag button.is-on {
  background: var(--olive);
  color: var(--ivory);
  cursor: default;
}

/* ———— small screens ———— */

/* below ~430px the English notices and father labels wrap to two lines while
   the Arabic ones don't — reserve two lines in both languages so nothing
   shifts on switch (labels stay anchored to the name beneath them) */
@media (max-width: 430px) {
  .notice {
    min-height: 50px;
    display: grid;
    align-content: center;
  }
  .father-label {
    min-height: 30px;
    display: grid;
    align-content: end;
  }
}

@media (max-width: 380px) {
  .btn { padding: 16px 32px; }
  .trail-node { width: 32px; height: 32px; }
}

/* ———— reduced motion ———— */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .check-circle, .check-mark { stroke-dashoffset: 0; }
  .card-doves { display: none; }
  .names { animation: none; }
}
