/* ==========================================================================
   Dominex — Pages d'authentification (connexion / inscription)
   Même style et texture que la page d'accueil : navy #001634 / cyan #02d9f9
   ========================================================================== */

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

:root {
    --navy: #001634;
    --navy-2: #012a62;
    --navy-3: #052850;
    --cyan: #02d9f9;
    --cyan-2: #22d3ee;
    --cyan-deep: #0891b2;
    --cyan-deeper: #0e7490;
    --cyan-100: #cffafe;
    --cyan-50: #ecfeff;
    --text: #012a62;
    --text2: #0f2a4a;
    --muted: #5b6b83;
    --border: rgba(1, 42, 98, 0.14);
    --shadow: 0 24px 60px rgba(0, 22, 52, 0.16);
    --font: "Century Gothic", CenturyGothic, "Trebuchet MS", "Segoe UI",
        system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(900px 460px at 88% -10%, rgba(2, 217, 249, 0.16), transparent 60%),
        radial-gradient(700px 420px at 0% 12%, rgba(1, 42, 98, 0.10), transparent 60%),
        linear-gradient(160deg, #ffffff, #f8fafc);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.wave { display: block; width: 100%; height: 64px; line-height: 0; }
.wave svg { display: block; width: 100%; height: 64px; }

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px 40px;
    width: 100%;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: -70px;
    right: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(2, 217, 249, 0.18), transparent 70%);
    pointer-events: none;
}

.auth-logo { display: flex; justify-content: center; margin-bottom: 16px; position: relative; }
.auth-logo img {
    height: 56px;
    width: auto;
    background: #fff;
    border-radius: 12px;
    padding: 6px 10px;
    box-shadow: 0 2px 12px rgba(0, 22, 52, 0.12);
}

.auth-card h1 {
    text-align: center;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 6px;
    position: relative;
}
.auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 26px;
    position: relative;
}

.field { margin-bottom: 16px; position: relative; }
.field label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.field label .hint { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.field input,
.field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(2, 217, 249, 0.22);
}
.field input[readonly] { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 48px; }
.pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--muted);
    padding: 6px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.83rem;
    color: var(--muted);
    cursor: pointer;
    margin-bottom: 20px;
}
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--cyan-deep); }
.check a { color: var(--cyan-deeper); font-weight: 700; }
.check a:hover { text-decoration: underline; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.auth-row .check { margin-bottom: 0; }
.auth-forgot { color: var(--cyan-deeper); font-weight: 700; font-size: 0.82rem; white-space: nowrap; }
.auth-forgot:hover { text-decoration: underline; }

.btn-auth {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #012a62, #001634);
    color: #fff;
    font-family: var(--font);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 22, 52, 0.28); }
.btn-auth:disabled { opacity: 0.7; cursor: wait; transform: none; }

.auth-alt { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--muted); }
.auth-alt a { color: var(--cyan-deeper); font-weight: 700; }
.auth-alt a:hover { text-decoration: underline; }

.flashes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.flash { padding: 12px 15px; border-radius: 12px; font-size: 0.85rem; font-weight: 600; border: 1px solid; }
.flash--success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flash--danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.flash--warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.flash--info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.auth-footer { text-align: center; padding: 20px; font-size: 0.82rem; color: var(--muted); }
.auth-footer a { color: var(--cyan-deeper); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }
/* Classes utilitaires utilisées par auth.js (statut champs) */
.mt-1 { margin-top: 4px; }
.text-xs { font-size: 12px; }
.text-emerald-600 { color: #059669; }
.text-red-600 { color: #dc2626; }
.text-slate-500 { color: #64748b; }
.text-amber-600 { color: #d97706; }
.text-slate-400 { color: #94a3b8; }

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
    .field-row { grid-template-columns: 1fr; }
}

/* Bannière de notification (Web Push) — thème Solimi */
.push-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300;
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    padding: 14px 16px; box-shadow: 0 16px 40px rgba(0, 22, 52, 0.22);
    animation: bannerIn 0.3s ease;
}
.push-banner[hidden] { display: none; }
@keyframes bannerIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.push-banner__icon { font-size: 1.6rem; }
.push-banner__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.push-banner__text strong { color: var(--text); font-family: var(--font); }
.push-banner__text span { font-size: 0.85rem; color: var(--muted); }
.push-banner__actions { display: flex; gap: 8px; }
.push-banner__allow, .push-banner__later {
    border: 0; cursor: pointer; font-weight: 700; font-size: 0.85rem;
    padding: 9px 14px; border-radius: 10px; font-family: var(--font);
}
.push-banner__allow { background: linear-gradient(135deg, #012a62, #001634); color: #fff; }
.push-banner__allow:hover { box-shadow: 0 8px 18px rgba(0, 22, 52, 0.25); }
.push-banner__later { background: #eef2ff; color: var(--text); }
@media (max-width: 480px) {
    .push-banner { flex-wrap: wrap; }
    .push-banner__text { flex: 1 1 100%; }
    .push-banner__actions { width: 100%; justify-content: flex-end; }
}

* { touch-action: manipulation; }
