/**
 * Registration form styles.
 *
 * The outer `.ce-registration-wrapper` has no visible content by itself
 * since v1.4.0 — the registration UI lives inside a modal (`.ce-modal`)
 * that is kept hidden until the CTA from couvrelles-event-helpers
 * dispatches `ce:open-registration`.
 *
 * @package CourvellesEvents
 */

.ce-registration-wrapper {
    /* Invisible container for data-attributes and the modal root. */
    position: static;
}

.ce-registration-closed {
    padding: 14px 18px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #4b5563;
    font-size: 15px;
    text-align: center;
}

/* Free entry — same shape as the closed pill, blue tint */
.ce-registration-free {
    padding: 14px 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e40af;
    font-size: 15px;
    text-align: center;
}

/* External billetterie — wraps a real CTA + a fine-print note */
.ce-registration-external {
    text-align: center;
}
.ce-registration-external-btn,
.ce-registration-external-btn:visited {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px 28px !important;
    background: #b7995d !important;
    background-color: #b7995d !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    transition: background 0.15s ease;
}
.ce-registration-external-btn:hover,
.ce-registration-external-btn:focus {
    background: #6b5f3a !important;
    background-color: #6b5f3a !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
.ce-registration-external-btn .ce-ext-icon {
    flex-shrink: 0 !important;
    color: #fff !important;
    stroke: #fff !important;
}
.ce-registration-external-note {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}
.ce-registration-external-error {
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 14px;
    text-align: center;
}

/* Free-entry note inside the event-info block */
.ce-event-places.ce-event-free {
    color: #1e40af;
    font-style: italic;
}

/* ─── Modal shell ──────────────────────────────────────────────── */
.ce-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    /* Centered both axes (h/v) when content fits ; scroll kicks in when
       the content is taller than the viewport thanks to `overflow-y`. */
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ce-modal.is-open {
    display: flex;
}

.ce-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.6);
    z-index: 0;
    animation: ce-fade-in 180ms ease-out;
}

.ce-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 12px;
    padding: 40px 40px 28px;
    box-shadow: 0 20px 48px rgba(16, 24, 40, 0.24), 0 4px 12px rgba(16, 24, 40, 0.12);
    animation: ce-slide-up 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Bare close button — no background, no border. Just a primary-colored × */
.ce-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--e-global-color-primary, var(--c-primary, #b7995d)) !important;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 150ms ease, transform 150ms ease;
}

.ce-modal-close:hover,
.ce-modal-close:focus,
.ce-modal-close:focus-visible {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--e-global-color-primary, var(--c-primary, #b7995d)) !important;
    opacity: 0.75;
    transform: scale(1.05);
    outline: none;
}

.ce-modal-close > span {
    display: inline-block;
    line-height: 1;
    pointer-events: none;
}

.ce-modal-title {
    margin: 0 40px 20px 0;
    font-family: 'Work Sans', system-ui, sans-serif;
    font-size: 22px;
    line-height: 1.3;
    color: #101828;
}

/* Bandeau d'explication en tête de la modale « liste d'attente » : le
   parcours n'aboutit pas à un paiement, il faut le dire avant la saisie. */
.ce-waitlist-notice {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-left: 3px solid #b8860b;
    border-radius: 4px;
    background: #fdf8ec;
    font-size: 14px;
    line-height: 1.5;
    color: #4a3c1a;
}

/* Lock scroll on the body while the modal is open. */
body.ce-modal-open {
    overflow: hidden;
}

/* Responsive — mobile full-screen. */
@media (max-width: 640px) {
    .ce-modal {
        padding: 0;
        align-items: stretch;
    }
    .ce-modal-content {
        max-width: none;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        padding: 24px 20px;
    }
    .ce-modal-title {
        font-size: 20px;
    }
}

@keyframes ce-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ce-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Step transitions ──────────────────────────────────────────── */
.ce-form-step {
    display: none;
}
.ce-form-step.active {
    display: block;
}

/* Primary CTA — aligned with the Elementor global primary color. Falls
   back to the helpers plugin gold (`--c-primary`) then to the hardcoded
   gold of the Couvrelles Figma kit. `filter: brightness` is used for the
   hover state so it works with any tint the theme sets. */
.ce-btn-primary {
    background-color: var(--e-global-color-primary, var(--c-primary, #b7995d)) !important;
    color: #fff !important;
    border: 0 !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-family: 'Work Sans', system-ui, sans-serif;
    font-weight: 600 !important;
    cursor: pointer;
    border-radius: 6px !important;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08);
    transition: filter 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.ce-btn-primary:hover,
.ce-btn-primary:focus-visible {
    background-color: var(--e-global-color-primary, var(--c-primary, #b7995d)) !important;
    color: #fff !important;
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
    outline: none;
}

.ce-btn-primary:disabled,
.ce-btn-primary[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ce-form-progress {
    font-size: 13px;
    color: #6a7282;
    margin-bottom: 20px;
    font-family: 'Work Sans', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ce-form-panel {
    /* Panels are step-based: hidden until their step becomes active. */
}

.ce-panel-title {
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #b7995d;
    color: #101828;
    font-family: 'Work Sans', system-ui, sans-serif;
    font-size: 18px;
}

.ce-field {
    margin-bottom: 15px;
}

.ce-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.ce-field .required {
    color: #e00;
}

.ce-field input[type="text"],
.ce-field input[type="email"],
.ce-field input[type="tel"],
.ce-field input[type="number"],
.ce-field input[type="datetime-local"],
.ce-field select,
.ce-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ce-field textarea {
    resize: vertical;
}

.ce-field-help {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

.ce-radio-group {
    margin-top: 5px;
}

.ce-radio-group label {
    display: block;
    font-weight: normal;
    margin-bottom: 8px;
    padding: 6px 0;
    cursor: pointer;
}

.ce-radio-group input[type="radio"] {
    margin-right: 8px;
}

.ce-transport-details {
    margin-left: 20px;
    padding: 10px 15px;
    border-left: 3px solid #0073aa;
    background: #f0f6fc;
    margin-bottom: 15px;
}

.ce-field-gdpr {
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ce-field-gdpr label {
    font-weight: normal;
    cursor: pointer;
}

.ce-form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Secondary action (Précédent) — outlined primary to keep visual
   consistency with the filled primary CTA. */
#ce-prev-btn {
    background: transparent !important;
    color: var(--e-global-color-primary, var(--c-primary, #b7995d)) !important;
    border: 1px solid var(--e-global-color-primary, var(--c-primary, #b7995d)) !important;
    padding: 13px 24px !important;
    font-family: 'Work Sans', system-ui, sans-serif;
    font-weight: 600 !important;
    font-size: 16px !important;
    border-radius: 6px !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 150ms ease, transform 150ms ease;
}

#ce-prev-btn:hover,
#ce-prev-btn:focus-visible {
    background: color-mix(in srgb, var(--e-global-color-primary, #b7995d) 10%, transparent) !important;
    color: var(--e-global-color-primary, var(--c-primary, #b7995d)) !important;
    transform: translateY(-1px);
    outline: none;
}

.ce-form-messages {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
}

.ce-form-messages.ce-msg-error {
    background: #fef0f0;
    border: 1px solid #f5c6cb;
    color: #842029;
}

.ce-form-messages.ce-msg-success {
    background: #f0fef0;
    border: 1px solid #c6f5c6;
    color: #20842a;
}

.ce-field.ce-field-error input,
.ce-field.ce-field-error select,
.ce-field.ce-field-error textarea {
    border-color: #e00;
}

.ce-field .ce-error-text {
    color: #e00;
    font-size: 12px;
    margin-top: 4px;
}

/* Event info on product page */
.ce-event-info {
    margin: 10px 0 15px;
    padding: 12px 15px;
    background: #f7f7f7;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
}

.ce-event-info p {
    margin: 5px 0;
}

.ce-event-full {
    color: #e00;
    font-weight: 600;
}

/* Loading spinner */
.ce-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.ce-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: ce-spin 0.8s linear infinite;
}

@keyframes ce-spin {
    to { transform: rotate(360deg); }
}
