* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; background: #faf6ef; color: #2b2b2b; }
.topbar { display: flex; gap: 12px; align-items: center; padding: 12px 20px; background: #0d1b3e; color: #fff; }
.topbar .logo { color: #fff; font-weight: 800; text-decoration: none; font-size: 18px; }
.topbar .tag { color: #bcd; font-size: 13px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }
.hero { text-align: center; padding: 28px 10px 10px; }
.hero h1 { font-size: 32px; margin: 0 0 8px; }
.hero p { font-size: 16px; color: #555; max-width: 640px; margin: 6px auto; }
.hero .price { background: #fff3cd; border: 1px solid #e6c200; border-radius: 12px; padding: 10px 14px; }
.hero .price a { color: #0d1b3e; font-weight: 700; }
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.form-card, .preview-card { background: #fff; border: 1px solid #e5ddc8; border-radius: 16px; padding: 20px; }
.form-card h2, .preview-card h2 { margin: 4px 0 14px; font-size: 19px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 10px 0; }
label input, label textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; font-family: inherit; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-btn { border: 2px solid #ddd; background: #fff; border-radius: 12px; padding: 10px; cursor: pointer; text-align: left; }
.tpl-btn b { display: block; font-size: 14px; }
.tpl-btn span { font-size: 12px; color: #666; }
.tpl-btn.active { border-color: #0d1b3e; background: #eef2ff; }
.event-row { display: grid; grid-template-columns: 1.4fr 1fr 0.7fr 1fr 28px; gap: 6px; margin: 6px 0; }
.event-row input { padding: 7px; border: 1px solid #ccc; border-radius: 7px; font-size: 13px; width: 100%; }
.ev-del { border: none; background: #fde8e8; border-radius: 7px; cursor: pointer; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 999px; border: 1px solid #ccc; background: #fff; font-weight: 700; cursor: pointer; font-size: 14px; text-decoration: none; color: #222; }
.btn.primary { background: #25d366; border-color: #25d366; color: #fff; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.errors { color: #b00020; font-weight: 600; min-height: 18px; }
.hint { color: #0a7d2c; font-weight: 600; }
.note, .how { color: #555; font-size: 14px; }
.how { background: #fff; border: 1px solid #e5ddc8; border-radius: 16px; padding: 20px; margin-top: 20px; }
.how li { margin: 8px 0; }
footer { text-align: center; color: #777; font-size: 13px; padding: 10px; }
footer a { color: #0d1b3e; }

/* ---- invitation preview (shared with standalone download) ---- */
.invite { text-align: center; }
.invite-inner { border: 2px solid #b8860b; border-radius: 16px; padding: 26px 16px; background: #fffdf7; }
.tpl-gulabi .invite-inner { border-color: #d63384; background: #fff5f8; }
.tpl-neela .invite-inner { border-color: #1e3a8a; background: #f4f7ff; }
.invite .om { color: #b8860b; margin: 0; }
.invite h1 { font-family: Georgia, serif; font-size: 30px; margin: 12px 0 4px; }
.invite .amp { color: #b8860b; }
.invite .tagline { color: #666; margin: 0; }
.invite .date-big { font-size: 19px; font-weight: 800; margin: 10px 0 2px; }
.invite .venue { margin: 2px 0; }
.countdown { display: flex; gap: 8px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.countdown div { background: #b8860b; color: #fff; border-radius: 10px; padding: 8px 10px; min-width: 58px; }
.tpl-gulabi .countdown div { background: #d63384; }
.tpl-neela .countdown div { background: #1e3a8a; }
.countdown b { display: block; font-size: 21px; }
.countdown span { font-size: 11px; }
.events { text-align: left; margin: 16px auto; max-width: 440px; }
.events h3 { text-align: center; margin: 6px 0; }
.event { padding: 7px 0; border-bottom: 1px solid #eee; }
.event b { display: block; }
.event span { font-size: 13px; color: #666; }
.couple-photo { width: 130px; height: 130px; object-fit: cover; border-radius: 50%; border: 3px solid #b8860b; }
.couple-photo.placeholder { display: inline-flex; align-items: center; justify-content: center; font-size: 52px; background: #f3e5c3; }
.invite .actions { margin-top: 14px; }
.invite .actions .btn { margin: 4px; }
.invite .brand { font-size: 12px; color: #999; margin-top: 18px; }
.invite .story { font-style: italic; color: #555; }
.invite .parents { font-size: 14px; color: #555; }

/* ---- 3D envelope card: click to open ---- */
.sc-stage { perspective: 1400px; }
.sc-card { position: relative; transform-style: preserve-3d; transform: rotateY(-4deg); transition: transform 1s cubic-bezier(.4,0,.2,1); border-radius: 16px; box-shadow: 0 30px 60px rgba(60,30,0,.28); }
.sc-stage.open .sc-card { transform: rotateY(0); }
.sc-inside { border-radius: 16px; overflow: hidden; }
.sc-cover { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; padding: 22px 16px; cursor: pointer; font-family: Georgia, serif; color: #fff; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; transform-origin: left center; transition: transform 1s cubic-bezier(.4,0,.2,1), opacity .55s ease .15s; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; background: linear-gradient(135deg,#7b1e1e,#a83232 45%,#c9a227); box-shadow: inset 0 0 0 3px rgba(255,215,0,.65), inset 0 0 0 8px rgba(123,30,30,.9), inset 0 0 0 10px rgba(255,215,0,.4); }
.tpl-gulabi .sc-cover { background: linear-gradient(135deg,#8a2b5e,#d63384 45%,#f7a8c4); box-shadow: inset 0 0 0 3px rgba(255,255,255,.7), inset 0 0 0 8px rgba(138,43,94,.9), inset 0 0 0 10px rgba(255,255,255,.45); }
.tpl-neela .sc-cover { background: linear-gradient(135deg,#0d1b3e,#1e3a8a 45%,#7ea4ff); box-shadow: inset 0 0 0 3px rgba(255,255,255,.65), inset 0 0 0 8px rgba(13,27,62,.9), inset 0 0 0 10px rgba(255,255,255,.4); }
.sc-stage.open .sc-cover { transform: rotateY(-165deg); opacity: 0; pointer-events: none; }
.sc-seal { display: inline-flex; align-items: center; justify-content: center; width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 35% 30%,#ffe98a,#d4af37 55%,#9c7c1e); font-size: 34px; box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 0 0 3px rgba(255,255,255,.35); margin: 6px auto 12px; }
.sc-cover-names { display: block; font-size: 30px; font-weight: 700; line-height: 1.25; background: linear-gradient(90deg,#fff6c9,#ffd700 50%,#fff6c9); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sc-shine 3s linear infinite; }
@keyframes sc-shine { to { background-position: 200% 0; } }
.sc-cover-date { display: block; margin-top: 8px; font-size: 16px; color: #ffeec2; }
.sc-cover-sub { display: block; margin-top: 4px; font-size: 13px; font-style: italic; color: #f3d9a4; }
.sc-open-hint { display: inline-block; margin-top: 18px; padding: 9px 18px; border-radius: 999px; background: rgba(255,255,255,.92); color: #7b1e1e; font-size: 14px; font-weight: 700; font-family: system-ui, sans-serif; animation: sc-bob 1.6s ease-in-out infinite; }
.tpl-gulabi .sc-open-hint { color: #8a2b5e; }
.tpl-neela .sc-open-hint { color: #1e3a8a; }
@keyframes sc-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.sc-toggle { text-align: center; margin: 12px 0 0; display: none; }
.sc-stage.open .sc-toggle { display: block; }
.sc-close { border: 1px solid #ccc; background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.sc-petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; border-radius: 16px; }
.sc-petals span { position: absolute; top: -24px; font-size: 15px; opacity: .75; animation: sc-fall linear infinite; }
@keyframes sc-fall { to { transform: translateY(560px) rotate(320deg); } }
.sc-corner { position: absolute; font-size: 20px; color: #c9a227; opacity: .85; pointer-events: none; }
.tpl-gulabi .sc-corner { color: #d63384; }
.tpl-neela .sc-corner { color: #1e3a8a; }
.sc-corner.tl { top: 8px; left: 10px; }
.sc-corner.tr { top: 8px; right: 10px; }
.sc-corner.bl { bottom: 8px; left: 10px; }
.sc-corner.br { bottom: 8px; right: 10px; }
.invite-inner { position: relative; }
.sc-divider { text-align: center; color: #c9a227; letter-spacing: 6px; margin: 2px 0 0; }

/* ---- multi-window opener: 4 windows unfold in 3D after the cover flips ---- */
.sc-windows { perspective: 900px; }
.sc-win { border: 1px solid #e8d9a8; border-radius: 12px; background: #fffdf7; margin: 12px 0; overflow: hidden; transform-origin: top center; transform: rotateX(-72deg) translateY(14px) scale(.96); opacity: 0; transition: transform .65s cubic-bezier(.34,1.4,.64,1), opacity .45s ease; box-shadow: 0 8px 20px rgba(60,30,0,.12); }
.tpl-gulabi .sc-win { border-color: #f0b6cd; background: #fff5f8; }
.tpl-neela .sc-win { border-color: #b9c8f5; background: #f4f7ff; }
.sc-win-1 { transition-delay: .15s; } .sc-win-2 { transition-delay: .28s; } .sc-win-3 { transition-delay: .41s; } .sc-win-4 { transition-delay: .54s; } .sc-win-5 { transition-delay: .67s; } .sc-win-6 { transition-delay: .80s; } .sc-win-7 { transition-delay: .93s; }
.sc-stage.open .sc-win { transform: none; opacity: 1; }
.sc-win-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; cursor: pointer; background: linear-gradient(90deg,rgba(184,134,11,.16),rgba(184,134,11,.04)); font-family: Georgia, serif; font-size: 15px; font-weight: 700; color: #5a4310; text-align: left; }
.tpl-gulabi .sc-win-head { background: linear-gradient(90deg,rgba(214,51,132,.16),rgba(214,51,132,.04)); color: #7a1f4d; }
.tpl-neela .sc-win-head { background: linear-gradient(90deg,rgba(30,58,138,.16),rgba(30,58,138,.04)); color: #1e3a8a; }
.sc-win-dots { font-size: 9px; letter-spacing: 2px; color: #b8860b; }
.sc-win-chev { margin-left: auto; transition: transform .3s ease; }
.sc-win-closed .sc-win-body { display: none; }
.sc-win-closed .sc-win-chev { transform: rotate(-90deg); }
.sc-win-body { padding: 4px 14px 14px; }
@media (prefers-reduced-motion: reduce) { .sc-win { transition: none; transform: none; opacity: 1; } }

/* Secure payment button + status (ShaadiCard checkout) */
.btn.pay { background: #b8860b; border-color: #b8860b; color: #fff; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
#pay-status { font-size: 14px; font-weight: 600; margin: 8px 0 0; }
#pay-status.ok { color: #0a7d2c; }
#pay-status.err { color: #b3261e; }
