/* =========================================================
   Montix — thème commun à toutes les pages
   ========================================================= */

:root {
    --bg: #07090b;
    --bg-2: #0d1317;
    --card: #0f1316;
    --card-2: #141a1e;
    --border: #1f272c;
    --border-strong: #2c373e;
    --text: #e6f1f5;
    --muted: #8fa3ad;
    --primary: #00ff9f;
    --primary-2: #00ccff;
    --danger: #ff5c7a;
    --warning: #facc15;
    --gradient: linear-gradient(90deg, var(--primary), var(--primary-2));
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --glow: 0 0 24px rgba(0, 255, 159, 0.25);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-title: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --nav-h: 68px;
}

* { box-sizing: border-box; }

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(0, 255, 159, 0.08), transparent 60%),
        radial-gradient(800px 500px at 95% 0%, rgba(0, 204, 255, 0.08), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

main, .page { flex: 1 0 auto; }

h1, h2, h3, h4 {
    font-family: var(--font-title);
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 0.6em;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ---------- Barre de navigation ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1160px;
    height: var(--nav-h);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img {
    height: 44px;
    width: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-links {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}
.nav-links a.active { color: var(--primary); }
.nav-actions {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    min-height: 0;
    box-shadow: none;
}

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px 20px 20px;
        background: rgba(7, 9, 11, 0.97);
        border-bottom: 1px solid var(--border);
    }
    .nav-menu.open { display: flex; }
    .nav-links { flex-direction: column; }
    .nav-links a { padding: 12px; }
    .nav-actions { margin-left: 0; flex-direction: column; align-items: stretch; }
    .nav-actions .btn { justify-content: center; }
}
@media (min-width: 901px) {
    .nav-menu { display: flex; align-items: center; flex: 1; gap: 28px; }
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--card);
    color: var(--text);
    font: 600 0.95rem/1.2 var(--font);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s, color 0.2s, background 0.2s;
    text-decoration: none;
}
.btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}
.btn-primary {
    background: var(--gradient);
    color: #04140d;
    border: none;
    box-shadow: var(--glow);
}
.btn-primary:hover {
    color: #04140d;
    transform: translateY(-1px);
    box-shadow: 0 0 34px rgba(0, 255, 159, 0.4);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; border-radius: 999px; }
.btn-block { width: 100%; }
.btn:disabled,
.btn.is-disabled {
    background: var(--card-2);
    color: var(--muted);
    border: 1px solid var(--border);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Mise en page ---------- */
.wrap {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}
.wrap-wide { max-width: 1160px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card h2:first-child,
.card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 4px; }
.grid p { margin: 0; }

/* Texte long (aide, mentions, confidentialité) */
.prose { color: var(--text); }
.prose p, .prose li { color: #c9d6dc; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--text); }
.page-header { margin-bottom: 32px; }
.page-header h1 { margin-bottom: 8px; }

/* ---------- Formulaires ---------- */
.auth {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}
.auth-box { width: 100%; max-width: 440px; }
.auth-box .card { padding: 32px; }
.auth-title { text-align: center; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--muted); margin-bottom: 26px; }
.auth-switch { text-align: center; color: var(--muted); margin-top: 22px; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-row label { font-weight: 600; font-size: 0.92rem; }
.form-row .row-between { display: flex; justify-content: space-between; align-items: baseline; }
.form-help { font-size: 0.88rem; color: var(--muted); margin: 0 0 18px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: 16px var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 159, 0.18);
}

.strength {
    font-size: 0.88rem;
    color: var(--muted);
    margin: -6px 0 4px;
}

/* Messages flash */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--card-2);
    margin-bottom: 18px;
    font-size: 0.95rem;
}
.alert-success { border-color: rgba(0, 255, 159, 0.4); color: var(--primary); }
.alert-danger, .alert-error { border-color: rgba(255, 92, 122, 0.45); color: var(--danger); }
.alert-warning { border-color: rgba(250, 204, 21, 0.45); color: var(--warning); }

/* Pages de statut (succès, 404) */
.status {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}
.status .card { max-width: 520px; width: 100%; text-align: center; padding: 44px 32px; }
.status-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #04140d;
    background: var(--gradient);
    box-shadow: var(--glow);
}
.status-code {
    font-family: var(--font-title);
    font-size: clamp(4.5rem, 14vw, 7rem);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 12px;
}
.status .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Pied de page ---------- */
.footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: rgba(7, 9, 11, 0.6);
    padding: 26px 20px;
    margin-top: auto;
}
.footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}
.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--primary); }
@media (max-width: 600px) {
    .footer-inner { flex-direction: column; text-align: center; }
}

hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.prose .card h2 { font-size: 1.25rem; }

/* ---------- Fenêtres de confirmation (SweetAlert2) ---------- */
/* « body » devant chaque règle : SweetAlert ajoute ses styles après les nôtres */
body .swal2-container.swal2-backdrop-show { background: rgba(4, 6, 8, 0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body .swal2-popup {
    width: min(440px, 92vw);
    padding: 34px 28px 28px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    font-family: var(--font);
}
body .swal2-title { color: var(--text); font-family: var(--font-title); font-size: 1.5rem; font-weight: 700; padding: 6px 0 0; }
body .swal2-html-container { color: var(--muted); font-size: 1rem; line-height: 1.6; margin: 10px 0 0; }
body .swal2-actions { margin-top: 26px; }
body .swal2-styled.swal2-confirm {
    background: var(--gradient);
    color: #04140d;
    border-radius: 999px;
    padding: 11px 30px;
    font: 600 1rem var(--font);
    box-shadow: var(--glow);
}
body .swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(0, 255, 159, 0.3); }
body .swal2-styled.swal2-cancel { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); border-radius: 999px; }
body .swal2-loader { border-color: var(--primary) transparent var(--primary-2) transparent; }

/* Icône « succès » aux couleurs du site (les pièces blanches doivent prendre la couleur du fond) */
body .swal2-icon.swal2-success { border-color: rgba(0, 255, 159, 0.35); }
body .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(0, 255, 159, 0.3); }
body .swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--primary); }
body .swal2-icon.swal2-success [class^="swal2-success-circular-line"],
body .swal2-icon.swal2-success .swal2-success-fix { background-color: var(--card); }
/* Erreur et avertissement */
body .swal2-icon.swal2-error { border-color: rgba(255, 92, 122, 0.5); }
body .swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--danger); }
body .swal2-icon.swal2-warning { border-color: rgba(250, 204, 21, 0.5); color: var(--warning); }

/* Bêta gratuite */
.pastille-beta {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 159, 0.35);
    background: rgba(0, 255, 159, 0.08);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.encart-beta {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 255, 159, 0.3);
    background: rgba(0, 255, 159, 0.06);
    font-size: 0.93rem;
}
.encart-beta i { color: var(--primary); margin-top: 3px; }
.encart-beta strong { color: var(--text); }

/* Bouton et fenêtre « Suggestions » */
.bouton-suggestions {
    position: fixed; right: 18px; bottom: 18px; z-index: 50;
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px;
    border: 1px solid rgba(0, 255, 159, 0.4); background: var(--card); color: var(--text);
    font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
/* Sélecteurs plus précis : certaines pages (Montage) stylent tous les boutons en pleine largeur */
button.bouton-suggestions { width: auto; min-height: 0; padding: 11px 16px; border: 1px solid rgba(0, 255, 159, 0.4); background: var(--card); color: var(--text); }
.fenetre-suggestions button.btn { width: auto; min-height: 0; }
.fenetre-suggestions button.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.bouton-suggestions i { color: var(--primary); }
.bouton-suggestions:hover { border-color: var(--primary); }
@media (max-width: 560px) { .bouton-suggestions span { display: none; } button.bouton-suggestions { padding: 13px; } }
.fenetre-suggestions {
    width: min(520px, calc(100vw - 32px)); padding: 24px; border-radius: var(--radius);
    border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
}
.fenetre-suggestions::backdrop { background: rgba(0, 0, 0, 0.6); }
.fenetre-suggestions h2 { font-size: 1.25rem; margin: 0 0 6px; }
.fenetre-suggestions h2 i { color: var(--primary); }
.fenetre-suggestions textarea {
    width: 100%; margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); resize: vertical;
    border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: inherit;
}
.actions-suggestions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.message-suggestion { min-height: 1.2em; margin: 8px 0 0; font-size: 0.9rem; }
.message-suggestion.ok { color: var(--primary); }
.message-suggestion.erreur { color: var(--danger); }
