/**
 * Public RSVP forms (/rsvp/{token}, /e/{slug}/rsvp). Depends on global.css tokens.
 */

/* ── Page shell ── */
.rsvp-page {
    overflow-wrap: break-word;
    overflow-wrap: anywhere;
    min-height: calc(100vh - 56px);
    min-height: calc(100svh - 56px);
    background: var(--gray-light, #f4f5f9);
    padding: 48px 20px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Card ── */
.rsvp-card {
    background: var(--white, #fff);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(13, 13, 43, 0.1), 0 1px 3px rgba(13, 13, 43, 0.06);
    padding: 40px;
    width: 100%;
    max-width: 520px;
}

/* ── Event header ── */
.rsvp-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(30, 71, 187, 0.1);
    color: var(--accent, #1e47bb);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.rsvp-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-size: clamp(22px, 5vw, 28px);
    font-weight: 800;
    color: var(--navy, #0d0d2b);
    margin: 0 0 16px;
    line-height: 1.2;
}

.rsvp-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.rsvp-meta li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-dark, #1a1a2e);
}

.rsvp-meta li i {
    color: var(--accent, #1e47bb);
    width: 16px;
    flex-shrink: 0;
    text-align: center;
}

.rsvp-divider {
    border: none;
    border-top: 1px solid var(--line, #e0e0e8);
    margin: 24px 0;
}

.rsvp-greeting,
.rsvp-lead {
    font-size: 15px;
    color: var(--gray-mid, #8e8ea8);
    margin: 0;
    line-height: 1.5;
}

/* ── Form ── */
.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 4px;
}

.rsvp-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rsvp-field-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--navy, #0d0d2b);
    letter-spacing: 0.01em;
}

.rsvp-optional {
    font-weight: 500;
    color: var(--gray-mid, #8e8ea8);
    font-size: 12px;
    margin-left: 2px;
}

/* ── Inputs ── */
.rsvp-input,
.rsvp-select,
.rsvp-textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--line, #e0e0e8);
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    background: var(--white, #fff);
    color: var(--navy, #0d0d2b);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rsvp-input:focus,
.rsvp-select:focus,
.rsvp-textarea:focus {
    outline: none;
    border-color: var(--accent, #1e47bb);
    box-shadow: 0 0 0 3px rgba(30, 71, 187, 0.12);
}

.rsvp-input::placeholder,
.rsvp-textarea::placeholder {
    color: var(--gray-mid, #8e8ea8);
}

.rsvp-textarea {
    resize: vertical;
    min-height: 90px;
}

.rsvp-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e8ea8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Response buttons ── */
.rsvp-status-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.rsvp-radio {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 16px 8px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--line, #e0e0e8);
    background: var(--gray-light, #f4f5f9);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-mid, #8e8ea8);
    text-align: center;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.rsvp-radio:hover {
    border-color: rgba(30, 71, 187, 0.3);
    color: var(--navy, #0d0d2b);
    background: #fff;
}

.rsvp-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rsvp-radio-icon {
    font-size: 24px;
    line-height: 1;
    transition: color 0.15s;
}

/* Selected states per response type */
.rsvp-radio[data-status="accepted"]:has(input:checked) {
    border-color: var(--green, #27ae60);
    background: rgba(39, 174, 96, 0.07);
    color: var(--green, #27ae60);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.12);
}

.rsvp-radio[data-status="declined"]:has(input:checked) {
    border-color: var(--pink, #e00e4f);
    background: rgba(224, 14, 79, 0.07);
    color: var(--pink, #e00e4f);
    box-shadow: 0 0 0 3px rgba(224, 14, 79, 0.12);
}

.rsvp-radio[data-status="maybe"]:has(input:checked) {
    border-color: var(--orange, #f39c12);
    background: rgba(243, 156, 18, 0.07);
    color: var(--orange, #f39c12);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.12);
}

/* ── Errors & hints ── */
.rsvp-field-error {
    font-size: 13px;
    font-weight: 600;
    color: var(--pink, #e00e4f);
    margin: 0;
}

.rsvp-field-hint {
    font-size: 12px;
    color: var(--gray-mid, #8e8ea8);
    margin: 0;
}

/* ── Submit ── */
.rsvp-submit {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
    font-size: 15px;
    border-radius: 12px;
    margin-top: 4px;
    letter-spacing: 0.01em;
}

.rsvp-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rsvp-preview-note {
    margin: 10px 0 0;
    font-size: 12px;
    text-align: center;
    color: var(--gray-mid, #8e8ea8);
}

/* ── Entry pass action buttons — the card itself is guest-pass.css ── */
.rsvp-pass-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 14px;
    border: 1px solid rgba(30, 71, 187, 0.2);
    border-radius: 10px;
    background: var(--white, #fff);
    color: var(--navy, #0d0d2b);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.rsvp-pass-download:hover {
    border-color: var(--accent, #1e47bb);
    color: var(--accent, #1e47bb);
}

/* ── Closed / thanks states ──
   .evt-rsvp-banner itself lives in events-public.css (the public invitation
   page), which this stylesheet's pages don't load — redefined here so
   rsvp/closed.blade.php and rsvp/thank-you.blade.php actually get it styled. */
.evt-rsvp-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.evt-rsvp-banner--open {
    background: rgba(39, 174, 96, 0.1);
    color: var(--green, #27ae60);
}

.evt-rsvp-banner--closed {
    background: rgba(243, 156, 18, 0.12);
    color: var(--orange, #d68910);
}

.rsvp-closed-banner {
    margin-top: 12px;
}

.rsvp-thanks {
    text-align: center;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.rsvp-thanks-banner {
    justify-content: center;
}

/* ── Confirmation card ── */
.rsvp-thanks-card {
    text-align: left;
}

.rsvp-thanks-event {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--navy, #0d0d2b);
    margin: 0 0 14px;
}

.rsvp-thanks-response {
    font-size: 14px;
    color: var(--text-dark, #1a1a2e);
    margin: 0 0 6px;
}

.rsvp-thanks-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
}

.rsvp-thanks-status--accepted {
    background: rgba(39, 174, 96, 0.12);
    color: var(--green, #27ae60);
}

.rsvp-thanks-status--declined {
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
}

.rsvp-thanks-status--maybe {
    background: rgba(243, 156, 18, 0.15);
    color: var(--orange, #d68910);
}

.rsvp-thanks-count {
    font-size: 14px;
    color: var(--gray-mid, #8e8ea8);
    margin: 0 0 6px;
}

.rsvp-thanks-footer {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy, #0d0d2b);
    margin: 14px 0 0;
}

.rsvp-thanks-footer i {
    color: #e0245e;
}

/* ── Action buttons ── */
.rsvp-thanks-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    width: 100%;
}

.rsvp-thanks-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(30, 71, 187, 0.2);
    border-radius: 10px;
    background: var(--white, #fff);
    color: var(--navy, #0d0d2b);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.rsvp-thanks-btn:hover {
    border-color: var(--accent, #1e47bb);
    color: var(--accent, #1e47bb);
}

.rsvp-thanks-btn i {
    color: var(--accent, #1e47bb);
}

.rsvp-thanks-btn--menu {
    padding: 0;
    border: none;
    background: none;
}

.rsvp-thanks-btn-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(30, 71, 187, 0.2);
    border-radius: 10px;
    background: var(--white, #fff);
    color: var(--navy, #0d0d2b);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.rsvp-thanks-btn-trigger:hover,
.rsvp-thanks-btn-trigger[aria-expanded="true"] {
    border-color: var(--accent, #1e47bb);
    color: var(--accent, #1e47bb);
}

.rsvp-thanks-btn-trigger i {
    color: var(--accent, #1e47bb);
}

.rsvp-thanks-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 180px;
    background: var(--white, #fff);
    border: 1px solid var(--line, #e0e0e8);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(13, 13, 43, 0.12);
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.rsvp-thanks-menu[hidden] {
    display: none;
}

/* The menu is opened by rsvp-thanks.js. Without JavaScript the panel would stay hidden and the button would do nothing, so
   the links are shown in place and the button is hidden. */
html:not(.js) .rsvp-thanks-menu[hidden] {
    display: flex;
    position: static;
    box-shadow: none;
    margin-top: 6px;
}

html:not(.js) [data-rsvp-calendar-trigger] {
    display: none;
}

.rsvp-thanks-menu a {
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark, #1a1a2e);
    text-decoration: none;
}

.rsvp-thanks-menu a:hover {
    background: var(--gray-light, #f4f5f9);
    color: var(--accent, #1e47bb);
}

/* ── Mobile ── */
@media (max-width: 560px) {
    .rsvp-card {
        padding: 28px 20px;
    }

    .rsvp-page {
        padding: 24px 12px 60px;
    }
}

@media (max-width: 380px) {
    .rsvp-status-options {
        grid-template-columns: 1fr;
    }

    .rsvp-radio {
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .rsvp-radio-icon {
        font-size: 18px;
    }
}

/* Host contact line shown at the foot of every guest-facing RSVP page (plans/group-rsvp-links.md) */
.rsvp-host-contact {
    margin: 20px 0 0;
    font-size: 14px;
    text-align: center;
    color: var(--text-muted, #64748b);
}
.rsvp-host-contact a {
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
}

/* ── After the deadline: cancel or reduce (resources/views/rsvp/closed.blade.php) ── */
.rsvp-closed-notice {
    margin-bottom: 12px;
}

.rsvp-reduce {
    margin: 16px 0;
}

.rsvp-reduce-title {
    margin: 0 0 6px;
    font-size: 17px;
}

.rsvp-reduce-form {
    margin-top: 10px;
}

/* The native radio is hidden, so which answer is chosen is drawn by the :has(input:checked) rules above and in each layout.
   Browsers without :has() (Chrome < 105, Safari < 15.4) would show no selection at all, and colour alone is a weak signal
   for everyone: a tick before the chosen label's text shows it in every browser. */
.rsvp-radio input:checked + span::before {
    content: "\2713\00a0";
}

.rsvp-radio input:checked + span {
    font-weight: 800;
}

/* One line shown only inside Facebook's and Instagram's in-app browsers (see rsvp-thanks.js). */
.rsvp-inapp-hint {
    margin: 0 0 6px;
    padding: 4px 8px;
    font-size: 12px;
    opacity: 0.8;
}
