/* ── Theme tokens ─────────────────────────────────────────── */
:root {
    --rsvp-red: #B73C2C;
    --rsvp-red-hover: #9a3224;
    --rsvp-gold: #FFD663;
    --rsvp-blush: #F7C6CE;
    --rsvp-white: #FFFFFF;
    --rsvp-dark: #111827;
    --rsvp-font-heading: 'Parisienne', cursive;
    --rsvp-font-body: 'Nunito', sans-serif;
}

.wedding_rsvp_portal_icon {
    background: center / 1.75rem 1.75rem no-repeat url("/wedding_rsvp/static/src/img/envelope.svg");
    color: transparent !important;
    font-size: 0 !important;
}

/* ── Page reset ──────────────────────────────────────────── */
.rsvp-page,
.rsvp-page *,
.rsvp-page *::before,
.rsvp-page *::after {
    box-sizing: border-box;
}

#wrapwrap:has(.rsvp-page) {
    background: linear-gradient(135deg, var(--rsvp-blush) 0%, var(--rsvp-white) 50%, #FFF9E6 100%);
    min-height: 100vh;
}

.rsvp-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    font-family: var(--rsvp-font-body);
    color: var(--rsvp-dark);
}

/* ── Card container ──────────────────────────────────────── */
.rsvp-card {
    background: var(--rsvp-white);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 620px;
}

/* ── Header ──────────────────────────────────────────────── */
.rsvp-header {
    text-align: center;
    margin-bottom: 2rem;
}

.rsvp-title {
    font-family: var(--rsvp-font-heading);
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--rsvp-red);
    margin: 0 0 0.25rem;
    font-weight: 400;
    line-height: 1.2;
}

.rsvp-subtitle {
    font-family: var(--rsvp-font-body);
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

/* ── Error banner ────────────────────────────────────────── */
.rsvp-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--rsvp-red);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ── Menu link ───────────────────────────────────────────── */
.rsvp-menu-link {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--rsvp-red);
    margin-left: 0.4rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rsvp-menu-link:hover {
    color: var(--rsvp-red-hover);
}

/* ── Form layout ─────────────────────────────────────────── */
.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rsvp-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.rsvp-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.rsvp-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rsvp-dark);
}

.rsvp-field label .required {
    color: var(--rsvp-red);
}

/* ── Inputs & selects ────────────────────────────────────── */
.rsvp-field input[type="text"],
.rsvp-field input[type="email"],
.rsvp-field select,
.rsvp-field textarea {
    font-family: var(--rsvp-font-body);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    background: var(--rsvp-white);
    color: var(--rsvp-dark);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus {
    border-color: var(--rsvp-red);
    box-shadow: 0 0 0 3px rgba(183, 60, 44, 0.12);
}

.rsvp-field textarea {
    resize: vertical;
}

.rsvp-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
}

/* ── Radio group ─────────────────────────────────────────── */
.rsvp-radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.25rem;
}

.rsvp-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 400;
}

.rsvp-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rsvp-radio__indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.rsvp-radio input[type="radio"]:checked + .rsvp-radio__indicator {
    border-color: var(--rsvp-red);
}

.rsvp-radio input[type="radio"]:checked + .rsvp-radio__indicator::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--rsvp-red);
}

.rsvp-radio input[type="radio"]:focus-visible + .rsvp-radio__indicator {
    box-shadow: 0 0 0 3px rgba(183, 60, 44, 0.2);
}

/* ── Details group (toggle visibility) ───────────────────── */
.rsvp-details-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: opacity 0.3s, max-height 0.3s;
}

.rsvp-details-group.is-hidden {
    opacity: 0.4;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    gap: 0;
}

/* ── Submit button ───────────────────────────────────────── */
.rsvp-submit {
    font-family: var(--rsvp-font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--rsvp-white);
    background: var(--rsvp-red);
    border: none;
    border-radius: 14px;
    padding: 0.85rem 2rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.rsvp-submit:hover {
    background: var(--rsvp-red-hover);
}

.rsvp-submit:active {
    transform: scale(0.98);
}

/* ── Modal overlay ───────────────────────────────────────── */
.rsvp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: modalFadeIn 0.35s ease forwards;
}

.rsvp-modal {
    background: var(--rsvp-white);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    animation: modalSlideUp 0.35s ease forwards;
}

.rsvp-modal h2 {
    font-family: var(--rsvp-font-heading);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--rsvp-red);
    margin: 0 0 0.5rem;
    font-weight: 400;
}

.rsvp-modal p {
    font-family: var(--rsvp-font-body);
    color: #6b7280;
    margin: 0 0 2rem;
    font-size: 1rem;
}

.rsvp-modal__button {
    display: inline-block;
    font-family: var(--rsvp-font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--rsvp-white);
    background: var(--rsvp-red);
    border-radius: 14px;
    padding: 0.8rem 2rem;
    text-decoration: none;
    transition: background 0.2s;
}

.rsvp-modal__button:hover {
    background: var(--rsvp-red-hover);
    color: var(--rsvp-white);
    text-decoration: none;
}

.rsvp-modal__button--secondary {
    background: transparent;
    color: var(--rsvp-red);
    border: 2px solid var(--rsvp-red);
}

.rsvp-modal__button--secondary:hover {
    background: var(--rsvp-red);
    color: var(--rsvp-white);
}

.rsvp-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@keyframes modalFadeIn {
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    to { transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 540px) {
    .rsvp-card {
        padding: 2rem 1.25rem;
        border-radius: 18px;
    }

    .rsvp-field-row {
        grid-template-columns: 1fr;
    }

    .rsvp-radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .rsvp-modal {
        padding: 2rem 1.5rem;
    }
}
