/* ============================================================
   auth.css — pages/auth/{login,forgot,reset,change_password}.php
   Shell standalone pour les pages non authentifiées.
   ============================================================ */

@import url('/assets/css/base.css');

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e4cb8 45%, #2f6df0 100%);
    color: var(--c-text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    position: relative;
    overflow-x: hidden;
}
@supports (align-items: safe center) {
    body { align-items: safe center; }
}

/* ---------- Blobs animés en arrière-plan ---------- */
.ev2-auth-blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.ev2-auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .35;
    will-change: transform;
}
.ev2-auth-blob--1 {
    width: 320px; height: 320px;
    background: radial-gradient(circle, #60a5fa 0%, transparent 70%);
    top: -80px; left: -60px;
    animation: ev2-blob-float 14s ease-in-out infinite;
}
.ev2-auth-blob--2 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
    bottom: -90px; right: -70px;
    animation: ev2-blob-float 18s ease-in-out infinite reverse;
    opacity: .28;
}
.ev2-auth-blob--3 {
    width: 240px; height: 240px;
    background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
    top: 40%; right: -60px;
    animation: ev2-blob-float 16s ease-in-out infinite;
    animation-delay: -6s;
    opacity: .22;
}
@keyframes ev2-blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.08); }
    66%      { transform: translate(-20px, 30px) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
    .ev2-auth-blob { animation: none; }
}

/* ---------- Card ---------- */
.ev2-auth {
    width: 100%;
    max-width: 420px;
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 255, 255, .08);
    padding: 1.75rem 1.5rem;
    animation: ev2-auth-in .5s cubic-bezier(.34, 1.2, .64, 1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(8px);
}

@media (max-width: 380px) {
    .ev2-auth { padding: 1.25rem 1rem; }
}

@keyframes ev2-auth-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Logo / titre ---------- */
.ev2-auth__brand {
    text-align: center;
    margin-bottom: 1rem;
}
.ev2-auth__logo {
    width: 64px;
    height: 64px;
    margin: 0 auto .65rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-blue) 0%, var(--c-blue-d) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 20px rgba(47, 109, 240, .35);
    animation: ev2-logo-bounce 2.6s ease-in-out infinite;
}
@keyframes ev2-logo-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-4px) rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
    .ev2-auth__logo { animation: none; }
}
.ev2-auth__brand h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--c-blue-d);
    letter-spacing: -.01em;
}
.ev2-auth__brand p {
    margin: .25rem 0 0;
    color: var(--c-text-muted);
    font-size: .85rem;
}

@keyframes ev2-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ev2-auth__title {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--c-text);
    position: relative;
    padding-bottom: .65rem;
}
.ev2-auth__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--c-blue);
    border-radius: 2px;
}

.ev2-auth__intro {
    margin: 0 0 1rem;
    color: var(--c-text-muted);
    font-size: .9rem;
    line-height: 1.5;
    text-align: center;
}

/* ---------- Form ---------- */
.ev2-auth-form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.ev2-auth-form > [style*="--stagger"] {
    animation: ev2-fade-up .45s ease-out both;
    animation-delay: calc(.25s + var(--stagger, 0) * .08s);
}

.ev2-auth-field { position: relative; }
.ev2-auth-field label {
    display: block;
    margin-bottom: .35rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--c-text);
}
.ev2-auth-field input {
    width: 100%;
    height: 48px;
    padding: 0 .9rem 0 2.5rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--c-surface);
    color: var(--c-text);
    transition: border-color var(--t), box-shadow var(--t);
}
.ev2-auth-field input:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(47, 109, 240, .15);
}
.ev2-auth-field input.is-invalid {
    border-color: var(--c-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.ev2-auth-field__icon {
    position: absolute;
    top: 50%;
    left: .9rem;
    transform: translateY(-50%);
    color: var(--c-text-muted);
    pointer-events: none;
}
.ev2-auth-field--has-label .ev2-auth-field__icon {
    top: calc(50% + .65rem);
}

.ev2-auth-field__toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--c-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.ev2-auth-field__toggle:hover { color: var(--c-blue-d); }
.ev2-auth-field--has-label .ev2-auth-field__toggle { top: calc(50% + .65rem); }

.ev2-auth-field__hint {
    display: block;
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--c-text-muted);
}

/* ---------- Force du mot de passe ---------- */
.ev2-auth-strength {
    height: 6px;
    width: 100%;
    background: var(--c-border-s);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-top: .5rem;
}
.ev2-auth-strength__fill {
    height: 100%;
    width: 0;
    background: var(--c-red);
    transition: width .3s var(--t), background .3s var(--t);
    border-radius: inherit;
}

/* ---------- Bouton submit ---------- */
.ev2-auth-submit {
    height: 52px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--c-blue), var(--c-blue-d));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: transform var(--t), box-shadow var(--t);
    box-shadow: 0 4px 14px rgba(47, 109, 240, .3);
    position: relative;
    overflow: hidden;
}
.ev2-auth-submit__shine {
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, .35) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: ev2-btn-shine 3.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ev2-btn-shine {
    0%, 60% { left: -75%; }
    100%    { left: 125%; }
}
.ev2-auth-submit__arrow {
    transition: transform var(--t);
    margin-left: .15rem;
}
.ev2-auth-submit:hover,
.ev2-auth-submit:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(47, 109, 240, .4);
}
.ev2-auth-submit:hover .ev2-auth-submit__arrow,
.ev2-auth-submit:focus-visible .ev2-auth-submit__arrow {
    transform: translateX(3px);
}
.ev2-auth-submit:active { transform: translateY(0); }
.ev2-auth-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
    .ev2-auth-submit__shine { animation: none; display: none; }
}

/* ---------- Décor route + voiture ---------- */
.ev2-auth__road {
    position: relative;
    margin-top: 1.25rem;
    height: 28px;
    overflow: hidden;
    opacity: .8;
}
.ev2-auth__road-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        var(--c-text-muted) 0,
        var(--c-text-muted) 12px,
        transparent 12px,
        transparent 24px
    );
    transform: translateY(-50%);
    animation: ev2-road-scroll 1.4s linear infinite;
    background-size: 24px 2px;
}
.ev2-auth__road-car {
    position: absolute;
    top: 50%;
    transform: translateY(-58%);
    color: var(--c-blue);
    font-size: 1.2rem;
    animation: ev2-road-car 6s ease-in-out infinite;
    left: 0;
}
@keyframes ev2-road-scroll {
    from { background-position: 0 0; }
    to   { background-position: -24px 0; }
}
@keyframes ev2-road-car {
    0%   { left: -10%; opacity: 0; }
    10%  { opacity: 1; }
    50%  { left: 50%; transform: translate(-50%, -58%); }
    90%  { opacity: 1; }
    100% { left: 110%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .ev2-auth__road-line, .ev2-auth__road-car { animation: none; }
    .ev2-auth__road-car { left: 50%; transform: translate(-50%, -58%); }
}

/* ---------- Liens secondaires ---------- */
.ev2-auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-top: 1rem;
    padding: .65rem;
    color: var(--c-blue-d);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--t);
}
.ev2-auth-link:hover { background: var(--c-blue-l); }

.ev2-auth__links {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: .25rem;
}

/* ---------- Alertes ---------- */
.ev2-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .88rem;
    line-height: 1.4;
}
.ev2-auth-alert i { font-size: 1.1rem; flex: 0 0 auto; margin-top: .1rem; }

.ev2-auth-alert--success { background: var(--c-green-l); color: #0b5a3a; }
.ev2-auth-alert--success i { color: var(--c-green); }

.ev2-auth-alert--danger  { background: var(--c-red-l);   color: #b91c1c; }
.ev2-auth-alert--danger  i { color: var(--c-red); }

.ev2-auth-alert--warning { background: #fff4e0;          color: #a36b00; }
.ev2-auth-alert--warning i { color: var(--c-amber); }

.ev2-auth-alert--info    { background: var(--c-blue-l);  color: var(--c-blue-d); }
.ev2-auth-alert--info    i { color: var(--c-blue); }

/* ---------- Footer marque ---------- */
.ev2-auth-foot {
    margin-top: 1rem;
    color: rgba(255, 255, 255, .85);
    text-align: center;
    font-size: .78rem;
    position: relative;
    z-index: 1;
}
