/**
 * auth.css — Styles partagés pour toutes les pages d'authentification
 * Utilisé par : login.php, register.php, set-password.php, forgot_password.php, reset_password.php
 */

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

/* ── Variables CSS ────────────────────────────────────── */
:root {
    --primary: #0f766e;
    --primary-light: #14b8a6;
    --primary-dark: #0d5d56;
    --accent: #10b981;
    --accent-dark: #059669;
    --white: #ffffff;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --error: #ef4444;
    --error-light: #fef2f2;
    --success: #10b981;
    --success-light: #f0fdf4;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ── Base ─────────────────────────────────────────────── */
html { font-size: 16px; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 50%, var(--primary-dark) 100%);
    padding: 1.5rem;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Éléments décoratifs */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(20, 184, 166, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, 2%) rotate(1deg); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Layout : Container + Card ────────────────────────── */
.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

/* ── Header ───────────────────────────────────────────── */
.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2.5rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    position: relative;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--white);
    letter-spacing: -0.02em;
    position: relative;
}

.login-subtitle {
    opacity: 0.85;
    font-size: 0.9375rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
}

/* ── Body ─────────────────────────────────────────────── */
.login-body {
    padding: 2rem;
}

/* ── Formulaires ──────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--slate-800);
    background: var(--slate-50);
    border: 2px solid var(--slate-200);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.form-input::placeholder {
    color: var(--slate-600);
    opacity: 0.6;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--slate-600);
    margin-top: 0.375rem;
}

/* ── Password toggle ──────────────────────────────────── */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--slate-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* ── Bouton principal ─────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    display: block;
    text-align: center;
    text-decoration: none;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* ── Alertes ──────────────────────────────────────────── */
.alert-error {
    background: var(--error-light);
    color: #b91c1c;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid #fecaca;
}

.alert-error a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.alert-error a:hover {
    text-decoration: underline;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid #bbf7d0;
    line-height: 1.5;
}

/* ── Liens retour ─────────────────────────────────────── */
.back-link {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--slate-600);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary);
}

/* ── Footer ───────────────────────────────────────────── */
.login-footer {
    text-align: center;
    padding: 1.25rem 2rem;
    background: var(--slate-50);
    border-top: 1px solid var(--slate-200);
}

.login-footer p {
    font-size: 0.8125rem;
    color: var(--slate-600);
}

.login-footer a {
    color: var(--slate-600);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ── Credits ──────────────────────────────────────────── */
.credits {
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
}

.credits a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
    body { padding: 1rem; }
    .login-header { padding: 2rem 1.5rem; }
    .login-body { padding: 1.5rem; }
    .login-logo { width: 70px; height: 70px; font-size: 2rem; }
    .login-title { font-size: 1.5rem; }
}

/* ── ALTCHA Widget ────────────────────────────────────── */
altcha-widget {
    display: block;
    margin-bottom: 1.25rem;
    --altcha-max-width: 100%;
    --altcha-border-radius: 8px;
    --altcha-border-color: var(--slate-200);
    --altcha-color-base: var(--slate-50);
    --altcha-color-text: var(--slate-700);
}
