/* ????????????????????????????????????????????????????????
   Auth.css — DataChantiers
   Thème Cosmos LIGHT — aligné sur Index.razor.css
   Fond blanc/gris clair, accents bleu #3b82f6 / violet #8b5cf6
   Variante verte via .auth-page--green
   ???????????????????????????????????????????????????????? */

/* ?? Variables — thème clair cosmos ?????????????????????? */
.auth-page {
    /* Accents */
    --auth-accent1:      #3b82f6;
    --auth-accent2:      #8b5cf6;
    --auth-grad:         linear-gradient(135deg, #3b82f6, #8b5cf6);

    /* Orbes — bleu/violet/cyan pastel (opacité réduite pour fond clair) */
    --auth-orb1:         rgba(59,130,246,0.22);
    --auth-orb2:         rgba(139,92,246,0.18);
    --auth-orb3:         rgba(6,182,212,0.16);

    /* Card — glassmorphism clair */
    --auth-card-bg:      rgba(255,255,255,0.88);
    --auth-card-border:  rgba(59,130,246,0.18);
    --auth-card-inset:   rgba(255,255,255,0.80);
    --auth-line1:        rgba(59,130,246,0.50);
    --auth-line2:        rgba(139,92,246,0.50);

    /* Inputs clair */
    --auth-input-bg:     rgba(248,250,252,0.90);
    --auth-input-bd:     rgba(59,130,246,0.22);
    --auth-input-focus:  rgba(59,130,246,0.55);
    --auth-input-glow:   rgba(59,130,246,0.14);
    --auth-input-bg-f:   rgba(59,130,246,0.06);

    /* Divider */
    --auth-divider:      rgba(59,130,246,0.15);

    /* Logo */
    --auth-logo-grad:    linear-gradient(135deg, #3b82f6, #8b5cf6);
    --auth-logo-glow:    rgba(99,102,241,0.25);

    /* Texte */
    --auth-text:         #0f172a;
    --auth-text-muted:   #475569;
    --auth-label-color:  #3b82f6;
    --auth-link-color:   #3b82f6;
    --auth-link-hover:   #2563eb;

    /* Bouton */
    --auth-btn-shadow:   rgba(59,130,246,0.30);
    --auth-btn-shadow2:  rgba(59,130,246,0.48);

    /* Note / info */
    --auth-note-bg:      rgba(59,130,246,0.07);
    --auth-note-bd:      rgba(59,130,246,0.20);
    --auth-note-color:   #1d4ed8;

    /* Fond page */
    --auth-page-bg:      #f1f5f9;
    --auth-overlay:      linear-gradient(160deg,
                             rgba(241,245,249,0.80) 0%,
                             rgba(248,250,252,0.70) 50%,
                             rgba(241,245,249,0.80) 100%);
}

/* Variante verte (Register / Reset / Confirmations) */
.auth-page--green {
    --auth-accent1:      #10b981;
    --auth-accent2:      #6366f1;
    --auth-grad:         linear-gradient(135deg, #10b981, #6366f1);
    --auth-orb1:         rgba(16,185,129,0.20);
    --auth-orb2:         rgba(99,102,241,0.18);
    --auth-orb3:         rgba(6,182,212,0.14);
    --auth-card-border:  rgba(16,185,129,0.20);
    --auth-card-inset:   rgba(255,255,255,0.80);
    --auth-line1:        rgba(16,185,129,0.55);
    --auth-line2:        rgba(99,102,241,0.55);
    --auth-input-bd:     rgba(16,185,129,0.22);
    --auth-input-focus:  rgba(16,185,129,0.50);
    --auth-input-glow:   rgba(16,185,129,0.14);
    --auth-input-bg-f:   rgba(16,185,129,0.06);
    --auth-divider:      rgba(16,185,129,0.15);
    --auth-logo-grad:    linear-gradient(135deg, #10b981, #6366f1);
    --auth-logo-glow:    rgba(16,185,129,0.25);
    --auth-label-color:  #059669;
    --auth-link-color:   #059669;
    --auth-link-hover:   #047857;
    --auth-btn-shadow:   rgba(16,185,129,0.28);
    --auth-btn-shadow2:  rgba(16,185,129,0.45);
    --auth-note-bg:      rgba(16,185,129,0.07);
    --auth-note-bd:      rgba(16,185,129,0.20);
    --auth-note-color:   #047857;
}

/* ?? PAGE WRAPPER ????????????????????????????????????????? */
.auth-page {
    min-height: calc(100vh - 52px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    background: var(--auth-page-bg, #f1f5f9);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Image de fond Ken Burns */
.auth-page::before {
    content: '';
    position: absolute;
    inset: -6%;
    background-image: var(--auth-bg-img);
    background-size: cover;
    background-position: center;
    animation: kenBurns 26s ease-in-out infinite alternate;
    z-index: 0;
    opacity: 0.55;
    filter: brightness(1.05) saturate(1.1);
}

@keyframes kenBurns {
    0%   { transform: scale(1.06) translate(0,    0);     }
    33%  { transform: scale(1.10) translate(-1%,  1%);    }
    66%  { transform: scale(1.08) translate(1%,  -1%);    }
    100% { transform: scale(1.12) translate(-0.5%, 0.5%); }
}

/* Overlay léger — laisse l'image visible */
.auth-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg,
        rgba(241,245,249,0.45) 0%,
        rgba(248,250,252,0.35) 50%,
        rgba(241,245,249,0.45) 100%);
    z-index: 1;
}

/* ?? ORBES pastel ????????????????????????????????????????? */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.auth-orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle at center, var(--auth-orb1), transparent 68%);
    top: -220px; left: -220px;
    filter: blur(70px);
    animation: orbFloat1 20s ease-in-out infinite;
}

.auth-orb-2 {
    width: 480px; height: 480px;
    background: radial-gradient(circle at center, var(--auth-orb2), transparent 68%);
    bottom: -160px; right: -160px;
    filter: blur(65px);
    animation: orbFloat2 24s ease-in-out infinite;
}

.auth-orb-3 {
    width: 320px; height: 320px;
    background: radial-gradient(circle at center, var(--auth-orb3), transparent 68%);
    top: 35%; right: 8%;
    filter: blur(55px);
    animation: orbFloat3 17s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%,100% { transform: translate(0,0);       }
    50%     { transform: translate(28px,16px);  }
}
@keyframes orbFloat2 {
    0%,100% { transform: translate(0,0);        }
    50%     { transform: translate(-22px,-14px); }
}
@keyframes orbFloat3 {
    0%,100% { transform: translate(0,0);       }
    50%     { transform: translate(12px,-20px); }
}

/* ?? CARD — glassmorphism clair ??????????????????????????? */
.auth-card {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 480px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    box-shadow:
        0 20px 60px rgba(59,130,246,0.10),
        0 4px 20px rgba(0,0,0,0.08),
        0 0 0 1px var(--auth-card-inset) inset;
    animation: authCardIn 0.75s cubic-bezier(0.4,0,0.2,1) forwards;
}

.auth-card--wide { max-width: 540px; }

/* Ligne lumineuse accent en haut */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--auth-line1) 40%,
        var(--auth-line2) 60%,
        transparent);
    z-index: 4;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ?? PANNEAU FORMULAIRE ??????????????????????????????????? */
.auth-form-panel {
    padding: 44px 44px 40px;
    display: flex;
    flex-direction: column;
}

/* ?? LOGO TEXTE ??????????????????????????????????????????? */
.auth-logo { margin-bottom: 20px; }

.auth-logo-text {
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #0f172a;
    line-height: 1;
}

.auth-logo-accent {
    background: var(--auth-logo-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px var(--auth-logo-glow));
}

/* ?? TITRES ??????????????????????????????????????????????? */
.auth-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--auth-text, #0f172a);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--auth-text-muted, #475569);
    margin-bottom: 28px;
    line-height: 1.55;
}

/* ?? CHAMPS ??????????????????????????????????????????????? */
.auth-field { margin-bottom: 15px; }

.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.auth-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--auth-label-color);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.auth-input {
    width: 100%;
    padding: 13px 16px;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-bd);
    border-radius: 10px;
    color: var(--auth-text, #0f172a);
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.auth-input::placeholder { color: #94a3b8; }

.auth-input:focus {
    border-color: var(--auth-input-focus);
    background: var(--auth-input-bg-f);
    box-shadow: 0 0 0 3px var(--auth-input-glow);
    color: var(--auth-text, #0f172a);
}

/* ?? REMEMBER ME ?????????????????????????????????????????? */
.auth-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.auth-check-row input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--auth-accent1);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-check-label {
    font-size: 0.84rem;
    color: var(--auth-text-muted, #475569);
    cursor: pointer;
}

/* ?? BOUTON PRINCIPAL ????????????????????????????????????? */
.auth-btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--auth-grad);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    box-shadow: 0 6px 20px var(--auth-btn-shadow);
    letter-spacing: 0.02em;
    margin-bottom: 14px;
    text-align: center;
    text-decoration: none;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--auth-btn-shadow2);
    filter: brightness(1.06);
    color: #fff;
    text-decoration: none;
}

.auth-btn-primary:active { transform: translateY(0); }

/* ?? BOUTON GHOST ????????????????????????????????????????? */
.auth-btn-ghost {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,0.15);
    background: rgba(15,23,42,0.04);
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
}

.auth-btn-ghost:hover {
    background: rgba(15,23,42,0.08);
    border-color: rgba(15,23,42,0.25);
    color: #0f172a;
    transform: translateY(-1px);
    text-decoration: none;
}

/* ?? SÉPARATEUR ??????????????????????????????????????????? */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-divider);
}

.auth-divider-text {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ?? NOTE / MESSAGE INFO ?????????????????????????????????? */
.auth-note {
    background: var(--auth-note-bg);
    border: 1px solid var(--auth-note-bd);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--auth-note-color);
    line-height: 1.55;
    text-align: center;
}

/* ?? MESSAGE SUCCÈS ??????????????????????????????????????? */
.auth-success {
    background: rgba(16,185,129,0.07);
    border: 1px solid rgba(16,185,129,0.22);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.88rem;
    color: #065f46;
    line-height: 1.55;
    text-align: center;
    margin-bottom: 20px;
}

/* ?? LIENS ???????????????????????????????????????????????? */
.auth-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 6px;
}

.auth-link {
    font-size: 0.8rem;
    color: var(--auth-link-color);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover { color: var(--auth-link-hover); text-decoration: underline; }

/* ?? STATUT ERREUR ???????????????????????????????????????? */
.auth-status {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.20);
    color: #b91c1c;
    font-size: 0.84rem;
    margin-bottom: 16px;
}

/* ?? BRAND ???????????????????????????????????????????????? */
.auth-brand {
    margin-top: 22px;
    font-size: 0.7rem;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.auth-brand a { color: #3b82f6; text-decoration: none; }
.auth-brand a:hover { color: #2563eb; }

/* ?? RESPONSIVE ??????????????????????????????????????????? */
@media (max-width: 700px) {
    .auth-page::before { display: none; }
    .auth-page::after  {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    }
    .auth-form-panel   { padding: 36px 28px; }
    .auth-card         { max-width: 440px; border-radius: 20px; }
    .auth-card--wide   { max-width: 480px; }
}

@media (max-width: 540px) {
    .auth-field-row  { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
    .auth-form-panel { padding: 28px 20px; }
    .auth-title      { font-size: 1.45rem; }
    .auth-logo-text  { font-size: 1.3rem; }
}
