/* صفحة دعوة الضيف — جوال أولاً. الثيمات عبر data-theme على body */
[hidden] { display: none !important; }
:root { color-scheme: only light; }
body[data-theme="ivory"] { --bg: #f4ede0; --paper: #fffaf1; --ink: #2b2418; --mute: #7a6c55; --gold: #a9813a; --gold-hi: #e3c58a; --line: #e6d8bd; --seal: #8d2f2a; --seal-hi: #b8463e; }
body[data-theme="navy"]  { --bg: #0f1a2c; --paper: #13223a; --ink: #f3ead6; --mute: #b5ab94; --gold: #d4b06a; --gold-hi: #f1d79a; --line: #2a3b57; --seal: #a9813a; --seal-hi: #d4b06a; }
body[data-theme="rose"]  { --bg: #f6e9e6; --paper: #fff8f6; --ink: #3a2522; --mute: #8a6b66; --gold: #b07a5a; --gold-hi: #e5b99c; --line: #ecd5cf; --seal: #9c4a55; --seal-hi: #c46b77; }
body[data-theme="sage"]  { --bg: #e9ede4; --paper: #fbfcf8; --ink: #24301f; --mute: #6a7562; --gold: #9a8148; --gold-hi: #d9c38f; --line: #d6dfcd; --seal: #4f6b45; --seal-hi: #6f8e64; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.75 "IBM Plex Sans Arabic", Tahoma, sans-serif;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0; min-height: 100dvh; }
main { max-width: 480px; margin-inline: auto; padding-block: 24px 40px; }
.state { text-align: center; color: var(--mute); padding: 40vh 0 0; margin: 0; }

/* الغلاف */
.cover { min-height: calc(100dvh - 64px); display: grid; place-items: center; }
.env { width: 100%; aspect-ratio: 3 / 4.2; max-height: 78dvh; background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 30px 80px -30px rgba(40, 28, 10, .45); display: grid; align-content: center; justify-items: center; gap: 6px; position: relative; overflow: hidden; }
.env::before { content: ""; position: absolute; inset: 14px; border: 1px solid var(--gold); border-radius: 14px; opacity: .45; pointer-events: none; }
.to { margin: 0; color: var(--mute); font-size: 15px; letter-spacing: .04em; }
.to-name { margin: 0 0 22px; font: 700 34px/1.3 "Aref Ruqaa", "Amiri", serif; color: var(--ink); text-align: center; padding-inline: 24px; }
.seal { width: 118px; height: 118px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--seal-hi), var(--seal) 62%); box-shadow: 0 10px 26px -8px rgba(60, 10, 10, .55), inset 0 -6px 14px rgba(0, 0, 0, .25), inset 0 4px 10px rgba(255, 255, 255, .2);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.seal-in { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: var(--gold-hi); font-size: 34px; border: 2px solid rgba(255, 255, 255, .25); }
.seal:hover { transform: scale(1.04); }
.seal:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.tap { margin: 18px 0 0; color: var(--mute); font-size: 14px; }
.cover.open .seal { transform: scale(1.6) rotate(-12deg); opacity: 0; }
.cover.open .env { animation: lift .7s .15s forwards cubic-bezier(.4, 0, .2, 1); }
@keyframes lift { to { transform: translateY(-30px) scale(.96); opacity: 0; } }

/* الدعوة */
.card { display: grid; gap: 16px; animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.vid { border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 9 / 16; max-height: 76dvh; }
.vid video { width: 100%; height: 100%; display: block; object-fit: cover; }
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 30px 22px 26px; text-align: center; position: relative; }
.paper::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--gold); border-radius: 16px; opacity: .35; pointer-events: none; }
.top { margin: 0 0 6px; font: 400 20px/1.8 "Amiri", serif; color: var(--gold); }
.host { margin: 0 0 8px; font: 400 18px/1.9 "Amiri", serif; white-space: pre-line; }
.names { margin: 6px 0 4px; font: 700 clamp(40px, 12vw, 58px)/1.35 "Aref Ruqaa", "Amiri", serif; color: var(--gold);
  background: linear-gradient(100deg, var(--gold) 20%, var(--gold-hi) 45%, var(--gold) 70%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-wrap: balance; }
.sub { margin: 0; font: 400 17px/1.8 "Amiri", serif; color: var(--mute); }
.orn { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 14px auto 10px; color: var(--gold); }
.orn i { height: 1px; width: 70px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.when { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 6px 0 0; }
.when.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.when div { padding: 4px 8px; border-inline-start: 1px solid var(--line); min-width: 0; }
.when div:first-child { border-inline-start: 0; }
.when div[hidden] { display: none; }
.when dt { font-size: 12px; color: var(--mute); letter-spacing: .04em; }
.when dd { margin: 0; font-weight: 600; font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.hijri { margin: 6px 0 0; color: var(--mute); font-size: 14px; }
.count { margin: 10px auto 0; display: inline-block; padding: 4px 14px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--ink); font-size: 14px; }
.where { margin-top: 14px; }
.venue { margin: 0; font-weight: 600; font-size: 17px; }
.hall { margin: 2px 0 0; color: var(--mute); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.chips span { font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--mute); }
.notes { margin: 10px 0 0; color: var(--mute); font-size: 14px; white-space: pre-line; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.btn { font: 600 15px "IBM Plex Sans Arabic", sans-serif; border-radius: 999px; padding: 11px 20px; cursor: pointer; text-decoration: none; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.gold { background: linear-gradient(135deg, var(--gold), color-mix(in srgb, var(--gold) 70%, #000)); color: #fffaf0; }
.btn.line { background: transparent; color: var(--ink); border-color: var(--gold); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, .link:focus-visible, .stepper button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* تأكيد الحضور */
.rsvp { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 22px 20px; text-align: center; }
.rsvp h2 { margin: 0 0 12px; font: 700 22px/1.5 "Amiri", serif; }
.cnt { display: grid; justify-items: center; gap: 6px; margin-bottom: 12px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 46px; height: 44px; border: 0; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.stepper output { min-width: 44px; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.cnt small, .msg small { color: var(--mute); font-weight: 400; }
.msg { display: grid; gap: 4px; text-align: start; margin: 4px 0 14px; font-size: 14px; }
.msg textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; }
.choice { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.done p { margin: 0 0 8px; font-size: 17px; }
.link { border: 0; background: none; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }
.err { color: #b03a2e; margin: 10px 0 0; font-size: 14px; }
.foot { text-align: center; color: var(--mute); font-size: 12px; }
.foot a { color: var(--gold); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .card, .cover.open .env { animation: none; } .seal { transition: none; } }

/* بطاقة الدخول (QR) بعد تأكيد الحضور */
.pass { margin: 14px auto 6px; max-width: 280px; background: #fff; color: #1d1a14; border-radius: 18px; padding: 16px 14px 14px; display: grid; justify-items: center; gap: 6px; border: 1px solid var(--line); box-shadow: 0 16px 40px -22px rgba(40, 28, 10, .45); }
.pass-k { margin: 0 !important; font-size: 13px !important; letter-spacing: .05em; color: var(--gold); font-weight: 600; }
.pass img { width: 220px; height: 220px; image-rendering: pixelated; }
.pass-name { margin: 0 !important; font-weight: 700; font-size: 16px !important; }
.pass small { color: #6b6250; font-size: 12.5px; line-height: 1.6; }

/* مقدمة VIP: فيديو الظرف على كامل الشاشة */
.intro { position: fixed; inset: 0; z-index: 50; background: #EFE6D3; display: grid; place-items: center; transition: opacity .6s ease; }
.intro video { width: 100%; height: 100%; object-fit: cover; }
.intro.out { opacity: 0; }
.intro .skip { position: absolute; bottom: max(20px, env(safe-area-inset-bottom, 0px)); inset-inline-end: 18px; border: 0; border-radius: 999px; padding: 9px 16px; background: rgba(255, 250, 240, .85); color: #3a2f20; font: 600 14px "IBM Plex Sans Arabic", sans-serif; cursor: pointer; min-height: 40px; }
.vid .again { display: block; text-align: center; font-size: 13px; color: var(--mute); margin-top: 6px; }
