/*
 * auth.css — Style commun pour les pages d'authentification
 * Même design system que le dashboard syndic
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark:       #151923;
    --bg-card:       rgba(30, 37, 54, 0.98);
    --card-shadow:   0 4px 24px rgba(0,0,0,0.5);
    --border-subtle: rgba(255,255,255,0.12);
    --text-primary:  #f1f5f9;
    --text-muted:    #64748b;
    --text-secondary:#94a3b8;
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; box-sizing: border-box; }

html {
    background: var(--bg-dark) !important;
}

body {
    background-color: var(--bg-dark) !important;
    background-image:
        radial-gradient(at 20% 20%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(34, 197, 94, 0.05) 0px, transparent 50%) !important;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    color: #e2e8f0;
    margin: 0;
}

/* Dot grid identique au dashboard */
body::before {
    content: ''; position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none; z-index: 0;
}

.auth-wrapper {
    position: relative; z-index: 1;
    width: 100%; max-width: 400px; padding: 1.25rem;
}

/* ── Brand ── */
.brand {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-bottom: 2rem;
    animation: slideDown 0.4s ease;
}
.brand-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
}
.brand-name {
    color: var(--text-primary); font-size: 1.05rem;
    font-weight: 700; margin: 0; letter-spacing: -0.3px;
}

/* ── Card ── */
.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    animation: slideUp 0.4s ease;
}

/* ── Role tag ── */
.role-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.68rem; font-weight: 600;
    padding: 4px 12px; border-radius: 20px;
    letter-spacing: 0.5px; text-transform: uppercase;
    margin-bottom: 1.2rem;
    border: 1px solid transparent;
}
.role-tag.admin   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.22);  color: #fca5a5; }
.role-tag.syndic  { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.22); color: #a5b4fc; }
.role-tag.user    { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.22);  color: #86efac; }

/* ── Title ── */
.auth-title {
    font-size: 1.3rem; font-weight: 700;
    color: var(--text-primary); margin: 0 0 1.5rem;
    letter-spacing: -0.4px;
}

/* ── Form ── */
.form-group { margin-bottom: 1.15rem; }

.f-label {
    display: block; color: var(--text-secondary);
    font-size: 0.78rem; font-weight: 500;
    margin-bottom: 6px;
}

.input-wrap { position: relative; }

.f-input {
    width: 100%;
    background: rgba(30,41,59,0.8);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 40px 12px 14px;
    color: var(--text-primary); font-size: 0.88rem;
    transition: all 0.2s ease; outline: none;
    font-family: inherit;
}
.f-input::placeholder { color: #475569; }
.f-input:focus {
    background: rgba(30,41,59,0.95);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.f-icon {
    position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    color: #475569; font-size: 0.78rem; pointer-events: none;
}

/* ── Links ── */
.forgot-link {
    display: block; text-align: right;
    color: var(--text-muted); font-size: 0.73rem;
    margin-top: 5px; text-decoration: none;
    transition: color 0.2s;
}
.forgot-link:hover { color: var(--accent-light); }

/* ── Remember me ── */
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 1.4rem; }
.check-box { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.check-lbl { color: var(--text-muted); font-size: 0.8rem; cursor: pointer; user-select: none; }

/* ── Button ── */
.btn-auth {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none; border-radius: 10px; padding: 12px;
    color: #fff; font-size: 0.88rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: 0 4px 16px var(--accent-glow);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit;
}
.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow-strong);
}
.btn-auth:active { transform: none; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border-subtle); margin: 1.25rem 0; }

/* ── Back link ── */
.back-link {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    color: #475569; font-size: 0.78rem;
    text-decoration: none; transition: color 0.2s;
}
.back-link:hover { color: var(--text-secondary); }

/* ── Info box ── */
.info-box {
    background: rgba(14,165,233,0.08);
    border: 1px solid rgba(14,165,233,0.18);
    border-left: 3px solid #0ea5e9;
    border-radius: 8px; padding: 10px 12px;
    color: #7dd3fc; font-size: 0.78rem;
    display: flex; align-items: flex-start; gap: 8px;
    margin-bottom: 1.4rem; line-height: 1.5;
}
.info-box i { margin-top: 2px; flex-shrink: 0; }

/* ── Alert ── */
.alert-auth {
    border-radius: 8px; padding: 10px 12px;
    font-size: 0.8rem;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 0.85rem; border: 1px solid transparent;
    border-left: 3px solid;
}
.alert-auth.error   { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2);  border-left-color: #ef4444; color: #fca5a5; }
.alert-auth.success { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2);  border-left-color: #22c55e; color: #86efac; }
.alert-auth.info    { background: rgba(14,165,233,0.08);border-color: rgba(14,165,233,0.18);border-left-color: #0ea5e9; color: #7dd3fc; }
.alert-auth.warning { background: rgba(234,179,8,0.08); border-color: rgba(234,179,8,0.2);  border-left-color: #eab308; color: #fde68a; }

/* ── Animations ── */
@keyframes slideUp   { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideDown { from { opacity:0; transform:translateY(-14px); } to { opacity:1; transform:translateY(0); } }
