@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ✅ AJOUT : enlever la barre de scroll (desktop) */
html, body {
    height: 100%;
    overflow: hidden;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 20px;
    position: relative;
}


/* ============================================
   PARTICULES MÉDICALES DANS L'OVERLAY
   ============================================ */
.overlay .medical-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.overlay .particle {
    position: absolute;
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.45);
    animation: float 20s infinite;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Logo Medicare */
.logo-container {
    text-align: center;
    margin-bottom: 18px;
}

.medicare-logo {
    height: 115px;
    width: auto;
    object-fit: contain;
}

/* CONTAINER PRINCIPAL */
.auth-wrapper {
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    position: relative;
    overflow: hidden;
    width: 1100px;
    max-width: 100%;
    min-height: 720px;
    z-index: 1;
}

/* ✅ AJOUT : Bouton "Revenir" dans la boîte (en haut à droite) */
.back-button {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 200;

    padding: 10px 16px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #0ea5e9;
    border: 2px solid #0ea5e9;
    border-radius: 999px;

    font-size: 14px;
    font-weight: 600;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    transition: all 0.25s ease;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
}

.back-button:hover {
    background-color: #0ea5e9;
    color: #ffffff;
    transform: translateY(-1px);
}

.back-button:active {
    transform: translateY(0);
}


/* FORMULAIRES */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    transition: all 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-container form {
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 35px;
    height: 100%;
    text-align: center;
    width: 100%;
    max-width: 460px;
    overflow: hidden;
}

.login-container {
    left: 0;
    z-index: 2;
}

.register-container {
    left: 0;
    opacity: 0;
    z-index: 1;
}

.register-container form {
    max-width: 520px;
}

/* Animation quand on active l'inscription */
.auth-wrapper.right-panel-active .login-container {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
}

.auth-wrapper.right-panel-active .register-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
}

/* TITRES & TEXTES */
h1 {
    font-weight: 700;
    font-size: 32px;
    color: #1e293b;
    margin-bottom: 12px;
}

span {
    font-size: 15px;
    color: #64748b;
    display: block;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* FORM GROUPS */
.form-group {
    margin-bottom: 14px;
    width: 100%;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
    width: 100%;
}

.form-group.half {
    flex: 1;
    min-width: 0;
}

/* INPUTS */
input {
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 20px;
    width: 100%;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    color: #1e293b;
}

input:focus {
    outline: none;
    border-color: #38bdf8;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

input::placeholder {
    color: #94a3b8;
}

/* Icônes dans les inputs */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"] {
    padding-left: 50px;
    background-repeat: no-repeat;
    background-position: 18px center;
    background-size: 18px;
}

/* espace à droite pour le bouton œil */
.password-wrapper input {
    padding-right: 56px;
}

input[type="text"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%2394a3b8" viewBox="0 0 16 16"><path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></svg>');
}

input[type="tel"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%2394a3b8" viewBox="0 0 16 16"><path d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.094l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.094-.58L3.654 1.328z"/></svg>');
}

input[type="email"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%2394a3b8" viewBox="0 0 16 16"><path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2zm13 2.383l-4.758 2.855L15 13.157V6.383zm-.034 6.876L5.963 8.5a.5.5 0 0 1-.034-.758L2 3.761v9.438a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V3.761l-3.966 4.98a.5.5 0 0 1-.034.757z"/></svg>');
}

input[type="password"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%2394a3b8" viewBox="0 0 16 16"><path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"/></svg>');
}

/* Bouton œil */
.password-wrapper {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.toggle-password:hover {
    background: rgba(56, 189, 248, 0.12);
    transform: translateY(-50%) scale(1.05);
}

/* OPTIONS DU FORMULAIRE */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
    width: 100%;
}

.forgot-password {
    color: #38bdf8;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #0ea5e9;
    text-decoration: underline;
}

/* BOUTONS PRINCIPAUX */
.submit-btn {
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
    width: 100%;
    margin-bottom: 16px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

/* OVERLAY (PANEL) */
.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.auth-wrapper.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.auth-wrapper.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
    z-index: 30;
}

.overlay-left { transform: translateX(-20%); }
.auth-wrapper.right-panel-active .overlay-left { transform: translateX(0); }

.overlay-right { right: 0; transform: translateX(0); }
.auth-wrapper.right-panel-active .overlay-right { transform: translateX(20%); }

.overlay-panel h1 {
    color: white;
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 700;
}

.overlay-panel p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 35px;
    font-weight: 400;
}

/* BOUTON GHOST */
.ghost {
    background-color: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    padding: 14px 45px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 40;
}

.ghost:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* EFFET COULIS/DRIP */
.drip-effect {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: none;
}

.drip {
    position: absolute;
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, #38bdf8, #0ea5e9);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.drip-1 { height: 25%; top: -5%; animation: drip-flow 2.5s ease-in-out infinite alternate; }
.drip-2 { height: 20%; top: 15%; animation: drip-flow 2.8s ease-in-out infinite alternate-reverse; animation-delay: 0.3s; }
.drip-3 { height: 18%; top: 40%; animation: drip-flow 3.1s ease-in-out infinite alternate; animation-delay: 0.6s; }
.drip-4 { height: 22%; top: 60%; animation: drip-flow 2.7s ease-in-out infinite alternate-reverse; animation-delay: 0.2s; }
.drip-5 { height: 15%; top: 85%; animation: drip-flow 3.3s ease-in-out infinite alternate; animation-delay: 0.8s; }
.drip-6 { height: 12%; top: 75%; animation: drip-flow 2.9s ease-in-out infinite alternate-reverse; animation-delay: 0.5s; }

@keyframes drip-flow {
    0% { transform: translateY(0) scaleY(1); opacity: 0.9; }
    100% { transform: translateY(-8px) scaleY(1.1); opacity: 1; }
}

.auth-wrapper.right-panel-active .drip-effect { left: 0; transform: translateX(0); }
.auth-wrapper.right-panel-active .drip { animation-duration: 1.2s; animation-timing-function: ease-out; }
.auth-wrapper:not(.right-panel-active) .drip { animation-duration: 1.2s; animation-timing-function: ease-out; }

/* MOBILE SWITCH */
.mobile-switch {
    display: none;
    text-align: center;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    margin-top: 16px;
    width: 100%;
}

.mobile-switch p {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 12px;
}

.switch-btn {
    background: transparent;
    color: #38bdf8;
    border: 2px solid #38bdf8;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-2px);
}

/* ============================================================
   RESPONSIVE MOBILE — FIX PAGE BLANCHE INSCRIPTION
   ============================================================ */
@media (max-width: 992px) {

    html, body { overflow: auto; }

    .drip-effect { display: none; }

    .auth-wrapper {
        width: 100%;
        max-width: 520px;
        min-height: auto;
        overflow: visible;
    }

    .overlay-container { display: none; }

    .form-container {
        position: relative;
        width: 100%;
        height: auto;
        left: 0 !important;
        opacity: 1 !important;
        transform: none !important;
        padding: 40px 30px;
        display: flex;
    }

    .form-container form {
        height: auto;
        overflow: visible;
        max-width: 100%;
        padding: 0 20px;
    }

    /* Par défaut : cacher le formulaire d'inscription */
    .register-container {
        display: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    /* Quand on clique sur S'inscrire */
    .auth-wrapper.right-panel-active .login-container {
        display: none !important;
        transform: none !important;
        opacity: 0 !important;
    }

    .auth-wrapper.right-panel-active .register-container {
        display: flex !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .mobile-switch { display: block; }
    .medicare-logo { height: 95px; }
    h1 { font-size: 28px; }
    .form-row { flex-direction: column; gap: 0; }
    .back-button { top: 14px; left: 14px; padding: 9px 14px; font-size: 13px; }
}

@media (max-width: 576px) {
    .form-container { padding: 30px 20px; }
    .medicare-logo { height: 85px; }
    h1 { font-size: 26px; }
    span { font-size: 14px; }
    input { padding: 14px 18px; }
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="password"] { padding-left: 45px; }
    .password-wrapper input { padding-right: 54px; }
    .submit-btn { padding: 16px; }
}

/* Select */
select {
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 20px;
    width: 100%;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    color: #1e293b;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #94a3b8 50%),
        linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 16px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 50px;
}

select:focus {
    outline: none;
    border-color: #38bdf8;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

/* Date */
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    height: 52px;
    padding-left: 20px;
    padding-right: 20px;
    background-image: none;
    text-align: left;
}

/* Scroll inscription desktop */
@media (min-width: 993px) {
    .register-container form {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        justify-content: flex-start !important;
        padding-top: 28px;
        padding-bottom: 28px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .register-container form::-webkit-scrollbar { width: 0; height: 0; }
}

.error-msg {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}