/* ═══════════════════════════════════════════════
   Wedding RSVP — Frontend Styles
   Aesthetic: Romantic luxury · Ivory & Gold
   ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Jost:wght@300;400;500&display=swap');

:root {
    --gold: #c9a96e;
    --gold-light: #e8c99a;
    --gold-pale: #fdf3e3;
    --ivory: #fdfaf5;
    --brown-deep: #3d2b1f;
    --brown-mid: #5a3e28;
    --brown-soft: #8b6b50;
    --rose: #f0b8c8;
    --sage: #b8d4c0;
    --white: #ffffff;
    --radius: 24px;
    --shadow: 0 20px 60px rgba(61,43,31,.12);
}

/* Wrapper */
.wrsvp-wrapper {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 20px 80px;
    font-family: 'Jost', sans-serif;
    color: var(--brown-deep);
    overflow: hidden;
    min-height: 400px;
}

/* ── Floating petals ────────────────────────── */
.wrsvp-petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.petal {
    position: absolute;
    width: 12px; height: 16px;
    background: var(--rose);
    border-radius: 50% 0 50% 0;
    opacity: 0.25;
    animation: floatPetal linear infinite;
}
.petal:nth-child(odd) { background: var(--gold-light); border-radius: 0 50% 0 50%; }
.petal-0 { left: 5%; top: -20px; animation-duration: 14s; animation-delay: 0s; transform: rotate(30deg); }
.petal-1 { left: 15%; top: -20px; animation-duration: 18s; animation-delay: 2s; }
.petal-2 { left: 28%; top: -20px; animation-duration: 12s; animation-delay: 5s; }
.petal-3 { left: 42%; top: -20px; animation-duration: 16s; animation-delay: 1s; }
.petal-4 { left: 58%; top: -20px; animation-duration: 20s; animation-delay: 3s; }
.petal-5 { left: 70%; top: -20px; animation-duration: 15s; animation-delay: 7s; }
.petal-6 { left: 82%; top: -20px; animation-duration: 13s; animation-delay: 4s; }
.petal-7 { left: 92%; top: -20px; animation-duration: 17s; animation-delay: 6s; }
.petal-8 { left: 35%; top: -20px; animation-duration: 11s; animation-delay: 8s; }
.petal-9 { left: 50%; top: -20px; animation-duration: 19s; animation-delay: 2.5s; }
.petal-10{ left: 75%; top: -20px; animation-duration: 14s; animation-delay: 9s; }
.petal-11{ left: 90%; top: -20px; animation-duration: 16s; animation-delay: 1.5s; }

@keyframes floatPetal {
    0%   { transform: translateY(0) rotate(0deg) translateX(0); opacity: .3; }
    50%  { transform: translateY(50vh) rotate(180deg) translateX(30px); opacity: .15; }
    100% { transform: translateY(110vh) rotate(360deg) translateX(-20px); opacity: 0; }
}

/* ── Header ─────────────────────────────────── */
.wrsvp-header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeSlideDown .8s ease both;
}
.wrsvp-monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #fff;
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(201,169,110,.35);
}
.wrsvp-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 700;
    color: var(--brown-deep);
    margin: 0 0 8px;
    line-height: 1.1;
    letter-spacing: 1px;
}
.wrsvp-date, .wrsvp-venue {
    font-size: 15px;
    color: var(--brown-soft);
    margin: 4px 0;
    letter-spacing: .3px;
}

/* ── Cards ──────────────────────────────────── */
.wrsvp-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(201,169,110,.15);
    animation: fadeSlideUp .6s ease both;
    position: relative;
    overflow: hidden;
}
.wrsvp-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--rose), var(--gold));
}

/* ── No-token state ─────────────────────────── */
.wrsvp-no-token { text-align: center; }
.wrsvp-no-token h2 { font-family: 'Cormorant Garamond', serif; font-size: 26px; color: var(--brown-deep); margin: 12px 0 8px; }
.wrsvp-no-token p { color: var(--brown-soft); font-size: 15px; line-height: 1.6; }

/* ── Greeting ───────────────────────────────── */
.wrsvp-greeting { text-align: center; margin-bottom: 36px; }
.wrsvp-wave { font-size: 40px; animation: wave 1.2s ease-in-out; display: inline-block; }
@keyframes wave {
    0%,100% { transform: rotate(0); }
    30% { transform: rotate(20deg); }
    60% { transform: rotate(-10deg); }
}
.wrsvp-greeting h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    color: var(--brown-deep);
    margin: 8px 0 10px;
}
.group-name-highlight { color: var(--gold); font-style: italic; }
.wrsvp-subtitle { font-size: 15px; color: var(--brown-soft); line-height: 1.65; max-width: 420px; margin: 0 auto; }

/* ── Guest items ────────────────────────────── */
.wrsvp-guests-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.wrsvp-guest-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--ivory);
    border: 2px solid transparent;
    transition: all .3s ease;
    animation: fadeSlideUp .5s ease both;
}
.wrsvp-guest-item:hover { border-color: var(--gold-light); background: #fffdf8; }
.wrsvp-guest-item.sel-confirmed { border-color: #6bbf8f; background: #f0faf4; }
.wrsvp-guest-item.sel-declined  { border-color: #e07070; background: #fdf0f0; }

.guest-avatar {
    width: 48px; height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(201,169,110,.3);
}
.guest-info { flex: 1; min-width: 0; }
.guest-fullname { display: block; font-size: 17px; font-weight: 500; color: var(--brown-deep); }
.guest-diet-note { display: block; font-size: 12px; color: var(--brown-soft); margin-top: 3px; }

.guest-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.wrsvp-btn-attend, .wrsvp-btn-decline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #f5f0ea;
    color: var(--brown-mid);
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .25s ease;
    min-width: 70px;
}
.btn-icon-emoji { font-size: 18px; line-height: 1; }
.wrsvp-btn-attend:hover  { background: #e8f6ee; border-color: #6bbf8f; color: #3a8b5c; transform: translateY(-2px); }
.wrsvp-btn-decline:hover { background: #fef0f0; border-color: #e07070; color: #b84040; transform: translateY(-2px); }
.wrsvp-btn-attend.selected  { background: #6bbf8f; border-color: #6bbf8f; color: #fff; box-shadow: 0 4px 12px rgba(107,191,143,.35); transform: translateY(-2px); }
.wrsvp-btn-decline.selected { background: #e07070; border-color: #e07070; color: #fff; box-shadow: 0 4px 12px rgba(224,112,112,.35); transform: translateY(-2px); }

/* ── Submit ─────────────────────────────────── */
.wrsvp-submit-area { text-align: center; }
.wrsvp-hint {
    font-size: 13px;
    color: var(--brown-soft);
    margin-bottom: 16px;
    font-style: italic;
    transition: color .3s;
}
.wrsvp-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 8px 24px rgba(201,169,110,.35);
}
.wrsvp-submit-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(201,169,110,.45);
}
.wrsvp-submit-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Success ────────────────────────────────── */
.wrsvp-success-card, .wrsvp-success-final { text-align: center; position: relative; overflow: hidden; }
.wrsvp-success-card h2, .wrsvp-success-final h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    color: var(--brown-deep);
    margin: 16px 0 10px;
}
.wrsvp-success-card p, .wrsvp-success-final p {
    font-size: 16px;
    color: var(--brown-soft);
    line-height: 1.65;
}
.wrsvp-hearts { font-size: 40px; margin-top: 20px; display: inline-block; animation: pulse 2s ease infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)}50%{transform:scale(1.15)} }

.wrsvp-icon-big { font-size: 56px; display: inline-block; }
.success-anim  { animation: popIn .6s ease; }
.success-bounce{ animation: bounce .8s ease; }
@keyframes popIn  { 0%{transform:scale(0);opacity:0}60%{transform:scale(1.2)}100%{transform:scale(1);opacity:1} }
@keyframes bounce { 0%,100%{transform:translateY(0)}40%{transform:translateY(-16px)}70%{transform:translateY(-8px)} }

/* Summary in already-confirmed state */
.wrsvp-summary { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.wrsvp-summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--ivory);
    font-size: 15px;
    color: var(--brown-deep);
}
.wrsvp-summary-item.status-confirmed { border-left: 4px solid #6bbf8f; }
.wrsvp-summary-item.status-declined  { border-left: 4px solid #e07070; }
.summary-icon { font-size: 20px; }

/* ── Confetti ───────────────────────────────── */
.wrsvp-confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation: confettiFall linear infinite;
}
@keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* ── Animations ─────────────────────────────── */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 520px) {
    .wrsvp-card { padding: 28px 20px; }
    .wrsvp-guest-item { flex-wrap: wrap; }
    .guest-buttons { width: 100%; justify-content: stretch; }
    .wrsvp-btn-attend, .wrsvp-btn-decline { flex: 1; }
}
