/* ═══════════════════════════════════════════════════════════════
   GRC FORGE — AUTH PAGES (Login · Register · Forgot Password)
   Premium brand blue glassmorphism — Shared styles
   ═══════════════════════════════════════════════════════════════ */

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

:root {
    --brand-blue:      #0166A3;
    --brand-blue-dark: #024f80;
    --brand-blue-deep: #0a1628;
    --navy:            #0d1f3c;
    --navy-mid:        #132a4a;
    --orange:          #f5a425;
    --orange-dark:     #d4891a;
    --orange-glow:     rgba(245,164,37,0.25);
    --green:           #22c55e;
    --red:             #ef4444;
    --text:            #ffffff;
    --text-muted:      rgba(255,255,255,0.55);
    --border:          rgba(255,255,255,0.10);
    --glass:           rgba(255,255,255,0.05);
    --glass-border:    rgba(255,255,255,0.12);
    --radius:          16px;
    --font:            'Poppins', system-ui, sans-serif;
}

html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--navy);
    background-image: linear-gradient(170deg, var(--brand-blue-deep) 0%, var(--navy) 100%);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
    justify-content: flex-start;
    padding: 48px 16px 40px;
    position: relative;
    overflow-x: hidden;
}

/* ── Subtle ambient glow ── */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(120px);
    opacity: 0.5;
}
body::before {
    width: 500px; height: 500px;
    top: -15%; left: -8%;
    background: rgba(1,102,163,0.18);
    animation: orbFloat 14s ease-in-out infinite alternate;
}
body::after {
    width: 400px; height: 400px;
    bottom: -10%; right: -8%;
    background: rgba(1,102,163,0.10);
    animation: orbFloat 12s ease-in-out infinite alternate-reverse;
}
@keyframes orbFloat {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.05); }
}

/* ── Grid pattern overlay ── */
.grid-overlay {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(1,102,163,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(1,102,163,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 80%);
}

/* ── CONTAINER PRINCIPAL ── */
.auth-wrap {
    position: relative; z-index: 1;
    width: 100%; max-width: 460px;
    display: flex; flex-direction: column; gap: 0;
    margin: auto 0;
    animation: cardEntrance .6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.auth-wrap.wide { max-width: 520px; }

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── BOUTON RETOUR ACCUEIL ── */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 50px;
    margin-bottom: 24px;
    align-self: flex-start;
    backdrop-filter: blur(12px);
    background: var(--glass);
    transition: all .25s ease;
}
.back-home:hover {
    color: var(--orange);
    border-color: rgba(245,164,37,0.40);
    background: rgba(245,164,37,0.08);
    transform: translateX(-3px);
}
.back-home i { font-size: .75rem; transition: transform .2s; }
.back-home:hover i { transform: translateX(-2px); }

/* ── LOGO ── */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.logo-link {
    display: inline-flex; align-items: center; gap: 12px;
    text-decoration: none; color: var(--text);
}
.logo-img {
    height: 80px; width: auto;
    filter: drop-shadow(0 6px 18px rgba(1,102,163,0.35));
}

/* ── CARTE ── */
.auth-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 36px 36px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 24px 80px rgba(0,0,0,.35),
        0 0 0 1px rgba(1,102,163,0.08) inset,
        0 1px 0 rgba(255,255,255,0.06) inset;
    position: relative;
    overflow: hidden;
}
/* Top accent line */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-blue), var(--orange), var(--brand-blue));
    background-size: 200% 100%;
    animation: gradientSlide 4s ease infinite;
}
@keyframes gradientSlide {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-title {
    font-size: 1.65rem; font-weight: 700;
    text-align: center; margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.auth-subtitle {
    color: var(--text-muted); font-size: .88rem;
    text-align: center; margin-bottom: 30px;
    line-height: 1.5;
}

/* ── ALERTES ── */
.alert {
    border-radius: 12px;
    padding: 13px 16px;
    margin-bottom: 20px;
    font-size: .85rem;
    display: flex; align-items: flex-start; gap: 10px;
    backdrop-filter: blur(10px);
    line-height: 1.5;
    animation: alertSlide .35s ease both;
}
@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert a { color: var(--orange); font-weight: 700; }

.alert-success {
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.30);
    color: #86efac;
}
.alert-error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.30);
    color: #fca5a5;
}

/* ── FORMULAIRE ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group {
    margin-bottom: 20px;
    animation: fieldEntrance .5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.form-group:nth-child(2) { animation-delay: .06s; }
.form-group:nth-child(3) { animation-delay: .10s; }
.form-group:nth-child(4) { animation-delay: .14s; }
.form-group:nth-child(5) { animation-delay: .18s; }
@keyframes fieldEntrance {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.input-label {
    display: block;
    font-size: .78rem; font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: .06em;
}
.req { color: var(--orange); }

.input-wrap { position: relative; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.30); font-size: .85rem; pointer-events: none;
    transition: color .25s;
}
.input-wrap:focus-within .input-icon {
    color: var(--brand-blue);
}

.input-field {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 14px 13px 40px;
    color: var(--text);
    font-family: var(--font);
    font-size: .92rem;
    transition: all .25s ease;
    outline: none;
}
.input-field:focus {
    border-color: var(--brand-blue);
    background: rgba(1,102,163,0.08);
    box-shadow: 0 0 0 3px rgba(1,102,163,0.20), 0 4px 16px rgba(1,102,163,0.10);
}
.input-field::placeholder { color: rgba(255,255,255,0.25); }

.pwd-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: rgba(255,255,255,0.30);
    cursor: pointer; font-size: .85rem; padding: 6px;
    border-radius: 8px;
    transition: all .2s;
}
.pwd-toggle:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

.forgot-link {
    display: block; text-align: right;
    color: var(--text-muted); font-size: .8rem;
    text-decoration: none; margin-top: 8px;
    transition: color .2s;
}
.forgot-link:hover { color: var(--orange); }

/* ── Password strength gauge ── */
.pwd-strength {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.pwd-strength-bar {
    height: 100%; border-radius: 2px;
    transition: all .3s ease; width: 0;
}
.pwd-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ── Checkbox / Terms ── */
.terms-row {
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 20px;
}
.terms-row input[type="checkbox"] {
    width: 16px; height: 16px; margin-top: 2px;
    accent-color: var(--brand-blue); flex-shrink: 0;
    cursor: pointer;
}
.terms-row label {
    font-size: .82rem; color: var(--text-muted);
    cursor: pointer; line-height: 1.6;
}
.terms-row label a {
    color: var(--orange); text-decoration: none;
    transition: color .2s;
}
.terms-row label a:hover { text-decoration: underline; color: #fbbf24; }

/* ── Discovery banner (register) ── */
.discovery-banner {
    background: rgba(1,102,163,0.08);
    border: 1px solid rgba(1,102,163,0.20);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 24px;
}
.discovery-banner .db-title {
    font-size: .76rem; font-weight: 700;
    color: var(--brand-blue);
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.discovery-banner .db-title::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand-blue);
    box-shadow: 0 0 8px rgba(1,102,163,0.50);
}
.discovery-banner ul {
    list-style: none;
    display: flex; flex-direction: column; gap: 6px;
}
.discovery-banner li {
    font-size: .82rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
}
.discovery-banner li::before {
    content: '✓'; color: var(--green); font-weight: 700;
    font-size: .75rem;
}

/* ── BOUTON PRINCIPAL ── */
.btn-submit {
    width: 100%; margin-top: 8px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    border: none; border-radius: 14px;
    padding: 14px 24px;
    color: #fff; font-family: var(--font);
    font-size: .95rem; font-weight: 700;
    cursor: pointer; letter-spacing: .01em;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 6px 24px var(--orange-glow);
    position: relative;
    overflow: hidden;
}
.btn-submit::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .5s ease;
}
.btn-submit:hover::before { transform: translateX(100%); }
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(245,164,37,.45);
}
.btn-submit:active { transform: translateY(0) scale(0.98); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-submit:disabled::before { display: none; }

/* ── DIVIDER ── */
.divider {
    display: flex; align-items: center; gap: 14px;
    color: var(--text-muted); font-size: .78rem;
    margin: 22px 0; font-weight: 500;
}
.divider::before, .divider::after {
    content: ''; flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── LIEN SECONDAIRE ── */
.register-link, .login-link {
    text-align: center; color: var(--text-muted); font-size: .88rem;
}
.register-link a, .login-link a {
    color: var(--orange); font-weight: 700; text-decoration: none;
    transition: color .2s;
}
.register-link a:hover, .login-link a:hover {
    color: #fbbf24; text-decoration: underline;
}

/* ── TRUST BADGES ── */
.trust-badges {
    display: flex; justify-content: center;
    flex-wrap: wrap; gap: 12px;
    margin-top: 28px;
    padding-bottom: 40px;
}
.trust-badge {
    display: flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-size: .74rem; font-weight: 500;
    padding: 6px 12px;
    border-radius: 50px;
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}
.trust-badge i {
    font-size: .68rem;
    color: var(--brand-blue);
}

/* ── LANGUE (retiré — FR uniquement) ── */
.lang-switch { display: none; }

/* ── SPINNER ── */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
    body { padding: 16px 12px; }
    .auth-wrap, .auth-wrap.wide { max-width: 100%; }
    .auth-card { padding: 28px 22px 24px; border-radius: 18px; }
    .auth-title { font-size: 1.35rem; }
    .form-row { grid-template-columns: 1fr; }
    .trust-badges { gap: 8px; }
    .trust-badge { font-size: .7rem; padding: 5px 10px; }
    body::before { width: 350px; height: 350px; }
    body::after  { width: 280px; height: 280px; }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
