/* ================================================================
   auth.css — MahraManager
   Design : Split Blue/White — bulles lentes + icônes sous texte
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --blue-deep:   #1E6FB9;
    --blue-mid:    #2563eb;
    --blue-light:  #3b82f6;
    --white:       #ffffff;
    --gray-input:  #f0f2f8;
    --gray-border: #e2e6f0;
    --gray-text:   #6b7280;
    --dark:        #1a1f36;
    --radius:      24px;
    --radius-sm:   12px;
    --transition:  .22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-mid) 50%, var(--blue-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    position: relative;
}

/* ── BULLES ANIMÉES LENTES ──────────────────────────────────────── */
.bubble {
    position: fixed;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    animation: floatUp linear infinite;
    pointer-events: none;
    z-index: 0;
}
.bubble:nth-child(1)  { width: 60px;  height: 60px;  left: 8%;   animation-duration: 28s; animation-delay: 0s;    }
.bubble:nth-child(2)  { width: 30px;  height: 30px;  left: 18%;  animation-duration: 22s; animation-delay: 5s;    }
.bubble:nth-child(3)  { width: 80px;  height: 80px;  left: 28%;  animation-duration: 35s; animation-delay: 9s;    }
.bubble:nth-child(4)  { width: 20px;  height: 20px;  left: 40%;  animation-duration: 25s; animation-delay: 3s;    }
.bubble:nth-child(5)  { width: 50px;  height: 50px;  left: 55%;  animation-duration: 32s; animation-delay: 7s;    }
.bubble:nth-child(6)  { width: 25px;  height: 25px;  left: 65%;  animation-duration: 24s; animation-delay: 12s;   }
.bubble:nth-child(7)  { width: 70px;  height: 70px;  left: 75%;  animation-duration: 38s; animation-delay: 2s;    }
.bubble:nth-child(8)  { width: 35px;  height: 35px;  left: 85%;  animation-duration: 27s; animation-delay: 6s;    }
.bubble:nth-child(9)  { width: 45px;  height: 45px;  left: 92%;  animation-duration: 30s; animation-delay: 14s;   }
.bubble:nth-child(10) { width: 55px;  height: 55px;  left: 3%;   animation-duration: 34s; animation-delay: 8s;    }
.bubble:nth-child(11) { width: 15px;  height: 15px;  left: 48%;  animation-duration: 20s; animation-delay: 16s;   }
.bubble:nth-child(12) { width: 90px;  height: 90px;  left: 33%;  animation-duration: 42s; animation-delay: 4s;    }

@keyframes floatUp {
    0%   { bottom: -120px; opacity: 0; transform: translateX(0); }
    8%   { opacity: .7; }
    92%  { opacity: .4; }
    100% { bottom: 110vh;  opacity: 0; transform: translateX(25px); }
}

/* ── CARD PRINCIPALE ────────────────────────────────────────────── */
.auth-scene {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 980px;
    min-height: 580px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0,0,0,.45), 0 12px 40px rgba(0,0,0,.25);
    animation: cardIn .55s cubic-bezier(.22,.68,0,1.15) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: scale(.94) translateY(24px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── PANNEAU GAUCHE (bleu) ──────────────────────────────────────── */
.auth-left {
    position: relative;
    background: linear-gradient(160deg, var(--blue-deep) 0%, var(--blue-mid) 40%, var(--blue-mid) 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 50px;
}

/* Formes rondes 3D */
.shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.shape-1 {
    width: 300px; height: 300px;
    background: radial-gradient(circle at 35% 30%, var(--blue-mid), var(--blue-deep));
    bottom: -90px; left: -75px;
    box-shadow: inset -14px -14px 40px rgba(0,0,0,.25), inset 10px 10px 30px rgba(255,255,255,.1), 8px 8px 30px rgba(0,0,0,.2);
}
.shape-2 {
    width: 160px; height: 160px;
    background: radial-gradient(circle at 38% 35%, var(--blue-light), var(--blue-deep));
    top: -55px; left: -55px;
    box-shadow: inset -8px -8px 24px rgba(0,0,0,.2), inset 6px 6px 18px rgba(255,255,255,.08);
}
.shape-3 {
    width: 100px; height: 100px;
    background: radial-gradient(circle at 38% 38%, var(--blue-light), var(--blue-deep));
    bottom: 55px; right: -26px;
    box-shadow: inset -5px -5px 14px rgba(0,0,0,.2), inset 4px 4px 12px rgba(255,255,255,.08);
}

/* ── CONTENU GAUCHE ─────────────────────────────────────────────── */
.left-content {
    position: relative;
    z-index: 10;
}

.left-title {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 6px;
}
.left-subtitle {
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 20px;
}
.left-desc {
    font-size: .8rem;
    /* text-align: justify; */
    color: rgba(255,255,255,.55);
    line-height: 1.8;
    max-width: 270px;
    margin-bottom: 32px;
}

/* ── ICÔNES SOUS LE TEXTE ───────────────────────────────────────── */
.left-icons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.left-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.left-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.9);
    font-size: 1.3rem;
    transition: background var(--transition), transform var(--transition);
}
.left-icon-box:hover {
    background: rgba(255,255,255,.2);
    transform: translateY(-2px);
}

.left-icon-label {
    font-size: .65rem;
    font-weight: 500;
    color: rgba(255,255,255,.55);
    letter-spacing: .04em;
    text-align: center;
}

/* ── PANNEAU DROIT (blanc) ──────────────────────────────────────── */
.auth-panel {
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 50px;
}

.auth-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    letter-spacing: -.01em;
}
.auth-subtitle {
    font-size: .82rem;
    color: var(--gray-text);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ── Alertes ────────────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    margin-bottom: 14px;
    border: 1px solid transparent;
    line-height: 1.45;
}
.auth-alert i:first-child { flex-shrink: 0; margin-top: 1px; }
.auth-alert span { flex: 1; }
.auth-alert--danger  { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.auth-alert--warning { background: #fffbeb; border-color: #fde68a; color: #d97706; }
.auth-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }

.alert-close {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: .5; padding: 0; flex-shrink: 0;
    transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ── Champs ─────────────────────────────────────────────────────── */
.field-group { margin-bottom: 16px; }

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-input {
    width: 100%;
    height: 52px;
    padding: 0 64px 0 46px;
    background: var(--gray-input);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--dark);
    font-family: 'Poppins', sans-serif;
    font-size: .9rem;
    outline: none;
    transition: all var(--transition);
}
.field-input::placeholder { color: #b0b8cc; font-size: .85rem; }
.field-input:hover { background: #e8ecf6; }
.field-input:focus {
    background: var(--white);
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.field-input.is-valid   { border-color: rgba(34,197,94,.45); }
.field-input.is-invalid { border-color: rgba(239,68,68,.45); }

.field-icon {
    position: absolute;
    left: 16px;
    font-size: 1.05rem;
    color: #b0b8cc;
    pointer-events: none;
    z-index: 2;
    transition: color var(--transition);
}
.field-wrap:focus-within .field-icon { color: var(--blue-mid); }

.eye-btn {
    position: absolute;
    right: 16px;
    background: none; border: none; cursor: pointer;
    font-size: .72rem;
    font-weight: 600;
    color: var(--blue-mid);
    letter-spacing: .04em;
    padding: 4px;
    transition: color var(--transition);
    z-index: 2;
    font-family: 'Poppins', sans-serif;
}
.eye-btn:hover { color: var(--blue-deep); }

/* ── Bouton principal ───────────────────────────────────────────── */
.submit-btn {
    width: 100%;
    height: 52px;
    margin-top: 24px;
    background: linear-gradient(135deg, var(--blue-deep) 0%, #1e4fd8 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .06em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
    box-shadow: 0 6px 20px rgba(30,79,216,.4);
}
.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(30,79,216,.5);
    background: linear-gradient(135deg, #152f7a 0%, #1a45c8 100%);
}
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.submit-btn--success {
    background: linear-gradient(135deg, #15803d, #22c55e) !important;
    box-shadow: 0 6px 20px rgba(34,197,94,.35) !important;
}

.btn-arrow { font-size: .8rem; transition: transform var(--transition); }
.submit-btn:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

.btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
}
.d-none { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ─────────────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: .75rem;
    color: var(--gray-text);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .auth-scene { grid-template-columns: 1fr; max-width: 460px; min-height: auto; }
    .auth-left  { display: none; }
    .auth-panel { padding: 44px 32px; }
}