/* RSVP Form - Integrated Page Styles */

/* Use same fonts as wedding theme */
#rsvp_page,
#rsvp_page * {
    font-family: "Cormorant Garamond", serif;
}

#rsvp_page {
    margin: 0 auto;
    padding: 0;
}

#rsvp_form_wrapper {
    width: 100%;
}

#rsvp_form_contents h1 {
    font-family: "Parisienne", sans-serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: normal;
    margin: 0 0 1.5rem 0;
    text-align: center;
}



#rsvp_form_contents tr {
    border: 0;
}

#rsvp_form_contents label {
    font-weight: 600;
}

.rsvp_error_message {
    color: #8B2635;
    font-size: 1rem;
    margin: 1em 0;
    padding: 0.75em 1em;
    background: rgba(139, 38, 53, 0.1);
    border-radius: 4px;
}

.rsvp_form {
    /* No outline/border - let it blend in */
}

.rsvp_form input[type="radio"] {
    display: inline;
    accent-color: #1E3A5F;
}

.rsvp_form input[type="radio"] + label {
    display: inline;
    margin-right: 1.5em;
    font-weight: normal;
}

.rsvp_form table {
    margin: 0;
    width: 100%;
}

.rsvp_form td {
    padding: 0.75em 1em 0.75em 0;
    vertical-align: top;
}

.rsvp_form input[type="text"],
.rsvp_form textarea {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.1rem;
    padding: 0.5em 0.75em;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

.rsvp_form input[type="text"]:focus,
.rsvp_form textarea:focus {
    outline: none;
    border-color: #1E3A5F;
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.2);
}

.rsvp_form textarea {
    min-height: 100px;
    resize: vertical;
}

.rsvp_form.hidden {
    display: none;
}

.rsvp-form-guest td {
    border-top: 1px solid #ddd;
    padding-top: 1.25rem;
}

.rsvp-form-guest-diet td {
    padding-bottom: 1.25rem;
}

.rsvp-form-guest-diet.last td {
    border-bottom: 1px solid #ddd;
}

.rsvp-form-diet.has-guests td {
    padding-bottom: 1.25rem;
}

.rsvp-form-contact.has-guests td {
    padding-top: 1.25rem;
}

#dietary_restriction_detail,
div[id$="_dietary_restriction_detail"] {
    margin-top: 0.75em;
}

#dietary_restriction_detail label,
div[id$="_dietary_restriction_detail"] label {
    display: block;
    margin-bottom: 0.25em;
}

#rsvp_step2 {
    text-align: center;
}

.rsvp_yes_no {
    text-align: center;
    margin-top: 1.5rem;
}

.rsvp_yes_no button {
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 0.75rem auto;
}

/* Buttons */
button,
.rsvp_submit,
.rsvp_submit_grey {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75em 2em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rsvp_submit {
    background: #1E3A5F;
    color: #fff;
    margin-top: 1.25rem;
    margin-right: 0.75rem;
}

.rsvp_submit:hover {
    background: #8B2635;
}

.rsvp_submit_grey {
    background: #888;
    color: #fff;
}

.rsvp_submit_grey:hover {
    background: #666;
}

.rsvp_cancel_link {
    color: #666;
    text-decoration: none;
    font-size: 1rem;
}

.rsvp_cancel_link:hover {
    text-decoration: underline;
}

#rsvp_url {
    display: inline-block;
    width: auto;
    margin-left: 4px;
    background: none;
    border: 0;
    border-bottom: 2px solid #1E3A5F;
    border-radius: 0;
    padding: 2px 0;
    position: relative;
    top: 1px;
    font-weight: 600;
    font-size: 1.1rem;
    width: 120px;
}

#rsvp_url:focus {
    outline: none;
    border-bottom-color: #8B2635;
    box-shadow: none;
}

.rsvp_url_begin {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Submitting state */
.submitting button {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.submitting button.rsvp_submit_with_spinner::before {
    content: ' ';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    background: url(/wp-content/plugins/our-rsvp/loading.png) no-repeat;
    background-size: contain;
    vertical-align: -2px;
    animation: spin 1s infinite linear;
    filter: invert(1);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Mobile styles */
@media screen and (max-width: 48em) {
    #rsvp_form_contents {
        font-size: 1rem;
    }

    #rsvp_form_contents p {
        font-size: 1.2rem;
    }

    .rsvp_form td {
        display: block;
        padding: 0.5em 0;
    }

    .rsvp_form td:first-child {
        padding-bottom: 0.25em;
    }

    .rsvp_yes_no button {
        width: 100%;
    }
}

/* ================================================
   Legacy Modal Styles (for form2.php popup version)
   ================================================ */

#rsvp_form_bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px) grayscale(50%);
    z-index: 1001;
    animation-name: fade-in;
    animation-duration: 0.2s;
    animation-timing-function: linear;
    animation-fill-mode: both;
}

#rsvp_form_bg.hidden {
    display: none;
    opacity: 0;
    backdrop-filter: none;
}

#rsvp_form_bg #rsvp_form_wrapper {
    position: fixed;
    top: 15vh;
    width: 100%;
    margin: 0 auto;
    z-index: 1002;
    color: #000;
}

#rsvp_form_bg #rsvp_form_contents {
    width: calc(100% - 4px);
    max-width: 600px;
    margin: 0 auto;
    background: #f1e3d7;
    padding: 40px;
    box-sizing: border-box;
    animation-name: fade-in;
    animation-duration: 0.2s;
    animation-delay: 0.2s;
    animation-timing-function: linear;
    animation-fill-mode: both;
    max-height: 75vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#rsvp_form_bg .rsvp_form {
    outline: 1px solid #8B2635;
    outline-offset: 20px;
}

@media screen and (max-width: 48em) {
    #rsvp_form_bg #rsvp_form_wrapper {
        top: 50px;
    }

    #rsvp_form_bg #rsvp_form_contents {
        padding: 25px;
        max-height: calc(100vh - 100px);
    }

    #rsvp_form_bg .rsvp_form {
        outline-offset: 15px;
    }
}
