/* ══════════════════════════════════════════════════
   auth.css — Login & Register styles
   ══════════════════════════════════════════════════ */

/* ── Import base vars (from style.css) ── */
/* auth.css doit être chargé APRÈS style.css */

/* ══ BODY ══ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

/* ══ WRAPPER ══ */
.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    opacity: 0;
}

/* ══ DECO PANEL (gauche) ══ */
.auth-deco {
    flex: 0 0 42%;
    background: linear-gradient(160deg, var(--surface) 0%, var(--bg2) 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 3rem;
    position: relative;
    overflow: hidden;
}

.auth-deco::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(0,245,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.auth-deco::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(191,0,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.register-deco::before {
    background: radial-gradient(circle, rgba(0,255,136,0.06) 0%, transparent 70%);
}
.register-deco::after {
    background: radial-gradient(circle, rgba(0,245,255,0.06) 0%, transparent 70%);
}

/* Back button */
.deco-top { position: relative; z-index: 1; }
.deco-back {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    transition: color 0.2s ease;
    cursor: none;
}
.deco-back:hover { color: var(--c1); }

/* Center content */
.deco-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    text-align: center;
}

.deco-logo {
    font-family: var(--font-title);
    font-size: 3rem;
    letter-spacing: 0.1em;
    color: white;
}
.deco-logo .dot { color: var(--c1); }

.deco-tagline {
    font-family: var(--font-title);
    font-size: 2.8rem;
    line-height: 1.05;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}
.deco-accent {
    color: var(--c1);
    display: block;
    filter: drop-shadow(0 0 20px rgba(0,245,255,0.4));
}
.register-accent {
    color: var(--c4);
    filter: drop-shadow(0 0 20px rgba(0,255,136,0.4));
}

/* Rings */
.deco-rings {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}
.d-ring {
    position: absolute;
    border-radius: 50%;
    border-style: solid;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.d-ring-1 {
    width: 100px; height: 100px;
    border-width: 1px;
    border-color: rgba(0,245,255,0.2);
    border-top-color: var(--c1);
    animation: spin 8s linear infinite;
}
.d-ring-2 {
    width: 140px; height: 140px;
    border-width: 1px;
    border-color: rgba(191,0,255,0.15);
    border-right-color: var(--c2);
    border-style: dashed;
    animation: spin 12s linear infinite reverse;
}
.d-ring-3 {
    width: 180px; height: 180px;
    border-width: 1px;
    border-color: rgba(255,0,110,0.1);
    border-bottom-color: var(--c3);
    animation: spin 20s linear infinite;
}
.register-ring { border-top-color: var(--c4); border-bottom-color: var(--c4); }

@keyframes spin { from{transform:translate(-50%,-50%) rotate(0deg)} to{transform:translate(-50%,-50%) rotate(360deg)} }

.d-ring-center {
    font-size: 2rem;
    z-index: 1;
    animation: float-pulse 3s ease-in-out infinite;
}
@keyframes float-pulse {
    0%,100%{transform:scale(1)} 50%{transform:scale(1.1)}
}

.deco-sub {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 280px;
}

/* Perks (register) */
.deco-perks {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    text-align: left;
    width: 100%;
    max-width: 240px;
}
.perk {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    padding: 0.6rem 1rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.3s ease;
}
.perk:hover { border-color: rgba(0,255,136,0.3); color: var(--text); }
.perk-icon { font-size: 1rem; }

/* Footer */
.deco-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}
.deco-stat-num { color: var(--c1); }
.deco-sep { color: var(--border); }

/* ══ AUTH PANEL (droite) ══ */
.auth-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ══ AUTH HEADER ══ */
.auth-header { display: flex; flex-direction: column; gap: 0.6rem; }

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--c1);
}
.register-eyebrow { color: var(--c4); }
.auth-eyebrow-line {
    display: block;
    width: 30px; height: 1px;
    background: currentColor;
}

.auth-title {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    letter-spacing: 0.03em;
    line-height: 1;
    color: white;
}
.title-dot { color: var(--c1); }
.register-dot { color: var(--c4); }

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
}
.auth-link {
    color: var(--c1);
    transition: opacity 0.2s ease;
    cursor: none;
}
.auth-link:hover { opacity: 0.7; }
.register-link { color: var(--c4); }

/* ══ ALERTS ══ */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }

.auth-alert.error {
    background: rgba(255,0,110,0.08);
    border: 1px solid rgba(255,0,110,0.25);
    color: var(--c3);
}
.auth-alert.success {
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.25);
    color: var(--c4);
}
.alert-icon { font-size: 1rem; flex-shrink: 0; }
.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    font-size: 0.75rem;
    cursor: none;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* ══ FORM FIELDS ══ */
.auth-form { display: flex; flex-direction: column; gap: 1.4rem; }

.form-field {
    position: relative;
}

.form-field .field-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
.form-field:has(textarea) .field-icon { top: 1rem; transform: none; }
.form-field:focus-within .field-icon { opacity: 1; }

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1rem 1rem 2.6rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    cursor: none;
    resize: none;
    appearance: none;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: var(--c1);
    box-shadow: 0 0 0 3px rgba(0,245,255,0.06), 0 0 20px rgba(0,245,255,0.04);
}

.form-field label {
    position: absolute;
    top: 1rem;
    left: 2.6rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
}

.form-field input:not(:placeholder-shown) ~ label,
.form-field input:focus ~ label,
.form-field textarea:not(:placeholder-shown) ~ label,
.form-field textarea:focus ~ label {
    top: -0.55rem;
    left: 0.7rem;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    color: var(--c1);
    background: var(--surface);
    padding: 0 0.3rem;
}

.field-line {
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--c1), var(--c2));
    transition: width 0.4s ease;
    border-radius: 0 0 6px 6px;
}
.register-line {
    background: linear-gradient(90deg, var(--c4), var(--c1));
}
.form-field:focus-within .field-line { width: 100%; }

.field-toggle {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1rem;
    opacity: 0.4;
    cursor: none;
    transition: opacity 0.2s ease;
}
.field-toggle:hover { opacity: 0.8; }

.field-hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    padding-left: 0.2rem;
}

.match-indicator {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    pointer-events: none;
}

/* ══ PASSWORD STRENGTH ══ */
.pwd-strength {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: -0.8rem;
}
.strength-bar {
    height: 3px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}
.strength-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    transition: color 0.4s ease;
}

/* ══ FORM META ══ */
.form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-dim);
    cursor: none;
    user-select: none;
}
.checkbox-wrap input { display: none; }
.checkbox-custom {
    width: 16px; height: 16px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.checkbox-wrap input:checked + .checkbox-custom {
    background: var(--c1);
    border-color: var(--c1);
}
.checkbox-wrap input:checked + .checkbox-custom::after {
    content: '✓';
    font-size: 0.6rem;
    color: var(--bg);
    font-weight: 700;
}
.register-check { }
.checkbox-wrap:has(input:checked) .register-check {
    background: var(--c4);
    border-color: var(--c4);
}
.forgot-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    cursor: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.forgot-link:hover { color: var(--c1); }

/* ══ TERMS ══ */
.terms-wrap { margin-top: -0.5rem; }

/* ══ SUBMIT BUTTON ══ */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    border: none;
    border-radius: 6px;
    cursor: none;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    margin-top: 0.5rem;
}
.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.3s ease;
}
.auth-btn:hover {
    box-shadow: 0 8px 40px rgba(0,245,255,0.35), 0 0 0 1px rgba(0,245,255,0.2);
}
.auth-btn:hover::before { background: rgba(255,255,255,0.07); }
.register-btn {
    background: linear-gradient(135deg, var(--c4) 0%, var(--c1) 100%);
}
.register-btn:hover {
    box-shadow: 0 8px 40px rgba(0,255,136,0.35), 0 0 0 1px rgba(0,255,136,0.2);
}

.btn-loader {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: var(--bg);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.btn-arrow { flex-shrink: 0; }

/* ══ DIVIDER ══ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ══ OAUTH ══ */
.oauth-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    cursor: none;
    transition: all 0.2s ease;
}
.oauth-btn:hover {
    border-color: rgba(0,245,255,0.25);
    color: var(--text);
    background: var(--surface2);
    transform: translateY(-1px);
}

/* ══ RESPONSIVE ══ */
@media (max-width: 800px) {
    .auth-deco { display: none; }
    .auth-panel { padding: 2rem 1.5rem; }
}
