/* Center the block, no drift */
.rsvp-wrapper {
    display: grid;
    place-items: center;
    margin: 1em 0;
    text-align: center;
}

/* Lock input + button on one line, perfectly aligned */
.rsvp-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 460px;
}

/* Kill stray margins/wrappers CF7/OceanWP add */
.rsvp-inline > * {
    margin: 0 !important;
}

.rsvp-inline .wpcf7-form-control-wrap {
    display: contents;
}

.rsvp-inline p {
    margin: 0 !important;
}

/* Email field */
.rsvp-input {
    flex: 1;
    min-width: 260px;
    padding: 14px 16px;
    font-size: 1.3rem !important;
    line-height: 1.4;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #ffffff !important;
    text-align: center;
    box-sizing: border-box;
}

.rsvp-textarea {
    flex: 1;
    min-width: 260px;
    padding: 14px 16px;
    font-size: 1.3rem !important;
    line-height: 1.4;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: transparent;
    color: #ffffff !important;
    text-align: center;
    box-sizing: border-box;
}

.rsvp-input::placeholder,
.rsvp-textarea::placeholder {
    color: rgba(255, 255, 255, 0.75) !important;
    text-align: center;
}

/* RSVP button */
.rsvp-btn {
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #555555 !important;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsvp-btn:hover {
    background: #5d8354;
}

/* Privacy text (legible on dark bg) */
.privacy-notice {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    max-width: 700px;
    margin-top: 40px !important;
}

.privacy-notice a {
    color: #fff;
    text-decoration: underline;
}

.privacy-notice a:hover {
    text-decoration: none;
    color: #cfcfcf;
}

/* Mobile: stack cleanly */
@media (max-width: 480px) {
    .rsvp-inline {
        display: block;
        text-align: center;
    }

    .rsvp-input,
    .rsvp-btn {
        display: block;
        width: 100%;
        border-radius: 5px;
        box-sizing: border-box;
    }

    .rsvp-btn {
        margin-top: 0.6em;
    }
}

/* --- Keep input + button aligned --- */
.rsvp-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

/* Keep the wrapper inline so layout doesn't break */
.rsvp-inline .wpcf7-form-control-wrap {
    display: inline-block !important;
    position: relative;
}

/* Absolutely position error message below input */
.rsvp-inline .wpcf7-not-valid-tip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1.5em;
    text-align: center;
    color: #e74c3c;
    font-size: 1.5rem;
    line-height: 1;
    pointer-events: none;
}

/* optional: prevent overflow clipping */
.rsvp-wrapper {
    overflow: visible;
}

/* === FINAL OVERRIDE FIX === */
.rsvp-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-direction: column !important;
    text-align: center !important;
    width: 100% !important;
    margin: 1.5em auto !important;
    overflow: visible !important;
}

/* Force inline row to stay centered */
.rsvp-inline {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: auto !important;
    margin: 0 auto !important;
    position: relative !important;
}

/* Crush theme/CF7 wrapper widths */
.rsvp-inline .wpcf7-form-control-wrap,
.rsvp-inline span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Keep the error text absolutely centered */
.rsvp-inline .wpcf7-not-valid-tip {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: -1.6em !important;
    text-align: center !important;
    color: #e74c3c !important;
    line-height: 1.2 !important;
    pointer-events: none !important;
    white-space: nowrap !important;
}

/* Modal and CF7 layout overrides */
.osc-events-modal__dialog .wpcf7,
.osc-events-modal__dialog .wpcf7 form,
.osc-events-modal__dialog .wpcf7-spinner {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.osc-events-modal__dialog .wpcf7 form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.osc-events-modal__dialog .rsvp-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    gap: 1rem;
}

.osc-events-modal__dialog .rsvp-inline {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: min(100%, 460px) !important;
    max-width: 460px !important;
    margin: 0 auto !important;
    gap: 0.75rem !important;
}

.osc-events-modal__dialog .rsvp-inline .wpcf7-form-control-wrap,
.osc-events-modal__dialog .rsvp-inline span {
    display: block !important;
    width: 100% !important;
}

.osc-events-modal__dialog .rsvp-input,
.osc-events-modal__dialog .rsvp-textarea,
.osc-events-modal__dialog .rsvp-btn {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
}

.osc-events-modal__dialog .rsvp-btn {
    margin-top: 0.25rem;
}

.osc-events-modal__dialog .cf-turnstile,
.osc-events-modal__dialog .cf-turnstile iframe,
.osc-events-modal__dialog .wpcf7-cloudflare-turnstile,
.osc-events-modal__dialog .wpcf7-form-control-wrap[data-name*="turnstile"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

.osc-events-modal__dialog .cf-turnstile,
.osc-events-modal__dialog .wpcf7-cloudflare-turnstile,
.osc-events-modal__dialog .wpcf7-form-control-wrap[data-name*="turnstile"] {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
}

.osc-events-modal__dialog .wpcf7-not-valid-tip,
.osc-events-modal__dialog .wpcf7-response-output {
    text-align: center !important;
}
