* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    background: #2575FC;
}

/* Forcer le bleu sur TOUT quand la page Welcome est active */
html.mlwelcome-html,
html.mlwelcome-html body,
body.mlwelcome-active,
body.mlwelcome-active main,
body.mlwelcome-active .site,
body.mlwelcome-active .site-content,
body.mlwelcome-active .site-main,
body.mlwelcome-active .entry-content,
body.mlwelcome-active .elementor,
body.mlwelcome-active .elementor-section,
body.mlwelcome-active .elementor-section-wrap,
body.mlwelcome-active .elementor-container,
body.mlwelcome-active .elementor-column-wrap,
body.mlwelcome-active .elementor-widget-wrap,
body.mlwelcome-active .elementor-widget-shortcode,
body.mlwelcome-active article {
    background: #2575FC !important;
    background-color: #2575FC !important;
}

/* ===== FOND IMMERSIF ===== */
.mlwelcome {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #2575FC;
}

.mlwelcome-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #2575FC;
    z-index: 0;
}

.mlwelcome-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}

.mlwelcome-bg-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    background: transparent;
}

/* ===== CARD ===== */
.mlwelcome-card {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 420px;
    text-align: center;
    color: #fff;
}

.mlwelcome-logo {
    width: 120px;
    height: auto;
    margin: 0 auto 32px;
    filter: drop-shadow(0 4px 20px rgba(74,141,255,0.4));
}

.mlwelcome-title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    margin: 0 0 12px;
    text-shadow: 0 4px 30px rgba(0,0,0,0.4);
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mlwelcome-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    margin: 0 0 32px;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ===== TOGGLE LOGIN / REGISTER (crossfade horizontal) ===== */
.mlwelcome-tabs {
    position: relative;
    display: flex;
    padding: 4px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.mlwelcome-tabs-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    border-radius: 10px;
    background: linear-gradient(135deg, #4a8dff 0%, #2575FC 50%, #1a5cc8 100%);
    box-shadow: 0 4px 12px rgba(37,117,252,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
    transition: transform .45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.mlwelcome-tabs[data-active="register"] .mlwelcome-tabs-indicator {
    transform: translateX(100%);
}

.mlwelcome-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 11px 16px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    font-family: inherit;
    transition: color .45s ease, opacity .45s ease;
}
.mlwelcome-tab:hover { color: rgba(255,255,255,0.85); }

.mlwelcome-tabs[data-active="login"] .mlwelcome-tab[data-tab="login"] {
    color: #fff;
}
.mlwelcome-tabs[data-active="login"] .mlwelcome-tab[data-tab="register"] {
    color: rgba(255,255,255,0.55);
}
.mlwelcome-tabs[data-active="register"] .mlwelcome-tab[data-tab="register"] {
    color: #fff;
}
.mlwelcome-tabs[data-active="register"] .mlwelcome-tab[data-tab="login"] {
    color: rgba(255,255,255,0.55);
}

/* ===== FORM ===== */
.mlwelcome-form { display: none; }
.mlwelcome-form.is-active {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: mlw-fade-in .25s ease;
}
@keyframes mlw-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mlwelcome-field {
    position: relative;
}

.mlwelcome-field-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    pointer-events: none;
    z-index: 1;
    transition: color .2s ease;
}
.mlwelcome-field-icon svg { width: 18px; height: 18px; display: block; }

.mlwelcome-input,
.mlwelcome .mlwelcome-input,
input.mlwelcome-input {
    width: 100%;
    padding: 15px 18px 15px 48px;
    background: rgba(255,255,255,0.08) !important;
    border: 1.5px solid rgba(255,255,255,0.18) !important;
    border-radius: 14px !important;
    color: #fff !important;
    font-size: 15px !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    outline: none !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color .2s, background .2s, box-shadow .2s;
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 30px transparent inset;
}

/* Variante sans icône à gauche (login) */
.mlwelcome-input--clean,
.mlwelcome .mlwelcome-input--clean,
input.mlwelcome-input--clean {
    padding-left: 18px !important;
}
.mlwelcome-input::placeholder,
.mlwelcome .mlwelcome-input::placeholder,
input.mlwelcome-input::placeholder {
    color: rgba(255,255,255,0.7) !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}
.mlwelcome-input::-webkit-input-placeholder { color: rgba(255,255,255,0.7) !important; opacity: 1 !important; }
.mlwelcome-input::-moz-placeholder { color: rgba(255,255,255,0.7) !important; opacity: 1 !important; }
.mlwelcome-input:-ms-input-placeholder { color: rgba(255,255,255,0.7) !important; opacity: 1 !important; }

.mlwelcome-input:focus {
    border-color: rgba(255,255,255,0.5) !important;
    background: rgba(255,255,255,0.13) !important;
    box-shadow: 0 0 0 4px rgba(74,141,255,0.15) !important;
}
.mlwelcome-input:focus ~ .mlwelcome-field-icon,
.mlwelcome-field:focus-within .mlwelcome-field-icon {
    color: rgba(255,255,255,0.85);
}

/* Autofill : forcer le fond transparent et le texte blanc */
.mlwelcome-input:-webkit-autofill,
.mlwelcome-input:-webkit-autofill:hover,
.mlwelcome-input:-webkit-autofill:focus,
.mlwelcome-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(74,141,255,0.25) inset !important;
    -webkit-text-fill-color: #fff !important;
    background-clip: content-box !important;
    caret-color: #fff;
    transition: background-color 5000s ease-in-out 0s;
}

/* Champ avec œil de visibilité mot de passe */
.mlwelcome-input--with-eye {
    padding-right: 48px;
}
.mlwelcome-field-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    z-index: 2;
}
.mlwelcome-field-eye:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}
.mlwelcome-field-eye svg { width: 18px; height: 18px; }

.mlwelcome-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mlwelcome-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    font-family: inherit;
    font-weight: 500;
    transition: color .2s;
}
.mlwelcome-help:hover { color: #fff; }
.mlwelcome-help svg { width: 14px; height: 14px; }
.mlwelcome-help-img {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    background: #fff;
    padding: 6px;
    display: none;
}
.mlwelcome-help-img.is-show { display: block; animation: mlw-fade-in .2s ease; }
.mlwelcome-help-img img { width: 100%; display: block; border-radius: 6px; }

/* ===== BTN ===== */
.mlwelcome-btn {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #4a8dff 0%, #2575FC 50%, #1a5cc8 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 8px 24px rgba(37,117,252,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform .15s, box-shadow .15s, filter .15s;
    min-height: 52px;
}
.mlwelcome-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 12px 30px rgba(37,117,252,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}
.mlwelcome-btn:active { transform: translateY(0); }

/* ===== LINKS ===== */
.mlwelcome-links {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}
.mlwelcome-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}
.mlwelcome-links a:hover { color: #fff; text-decoration: underline; }
.mlwelcome-links-sep { opacity: 0.4; }

/* Bouton lien (Mot de passe oublié, Retour à la connexion) */
.mlwelcome-link-btn {
    background: transparent !important;
    border: none !important;
    color: rgba(255,255,255,0.85) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    transition: color .2s ease;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.mlwelcome-link-btn:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

/* Intro mot de passe oublié */
.mlwelcome-forgot-intro {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
    text-align: center;
}
.mlwelcome-forgot-intro p { margin: 0; }

/* Message de succès */
.mlwelcome-success {
    background: rgba(74, 141, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: mlw-fade-in .25s ease;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ===== FOOTER ===== */
.mlwelcome-footer {
    margin-top: 28px;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 500px) {
    .mlwelcome-title { font-size: 36px; }
    .mlwelcome-subtitle { font-size: 13px; }
    .mlwelcome-logo { width: 100px; margin-bottom: 24px; }
    .mlwelcome-row { grid-template-columns: 1fr; gap: 12px; }
}

/* ========== Ajouts plugin ========== */

/* Reset du body parent (Elementor / thème) pour que la page soit full-bleed */
body.mlwelcome-active {
    margin: 0;
    background: #2575FC;
}
body.mlwelcome-active .entry-content,
body.mlwelcome-active .elementor-section-wrap,
body.mlwelcome-active .site-content,
body.mlwelcome-active .site-main {
    padding: 0 !important;
    margin: 0 !important;
    background: #2575FC !important;
}

/* Input ID en majuscules (auto-uppercase) */
.mlwelcome-input--uppercase {
    text-transform: uppercase;
}
.mlwelcome-input--uppercase::placeholder {
    text-transform: none;
}

/* Erreur sous le formulaire */
.mlwelcome-error {
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: mlw-fade-in .25s ease;
}

/* Petit message (CGU) en bas */
.mlwelcome-fineprint {
    font-size: 11px;
    opacity: 0.65;
    line-height: 1.5;
    color: rgba(255,255,255,0.8);
}

/* Bouton avec état chargement */
.mlwelcome-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.mlwelcome-btn-label,
.mlwelcome-btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mlwelcome-btn-spinner[hidden],
.mlwelcome-btn-spinner.is-hidden {
    display: none !important;
}
.mlwelcome-btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mlw-spin 0.7s linear infinite;
}
@keyframes mlw-spin {
    to { transform: rotate(360deg); }
}
