/* Pages publiques (accueil, connexion, inscription) : champ ASCII génératif + sablier de Kronos.
   Graphite ou pierre, contraste adouci (ni noir ni blanc purs), une seule couleur : le sang.
   data-theme est posé sur <html> par plan-theme.js, data-halloween par halloween.js.
   Mêmes valeurs que la palette du dashboard (style-dashboard.css). */

:root,
[data-theme="dark"] {
    --bg: #171615;
    --panel: #201F1D;
    --raise: #2C2A28;
    --ink: #E6E4DF;
    --ash: #9A968F;
    --blood: #D94452;
    --ok: #5FAF7C;
    --faint: #3B3936;
}

[data-theme="light"] {
    --bg: #D9CDB8;
    --panel: #E3D8C5;
    --raise: #CFC1A9;
    --ink: #2A241D;
    --ash: #574D40;
    --blood: #A63D40;
    --ok: #3F7A56;
    --faint: #A39276;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Geist', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color .4s, color .4s;
}

:focus-visible {
    outline: 2px solid var(--blood);
    outline-offset: 4px;
}

/* ── Boutons ── */
.btn-fill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .25s, color .25s;
}
.btn-fill:hover { background: var(--blood); color: #FFFFFF; }
button.btn-fill {
    gap: 10px;
    border: 0;
    font-family: inherit;
    cursor: pointer;
}
button.btn-fill:disabled { opacity: .7; cursor: default; }
button.btn-fill.ok { background: var(--ok); color: #FFFFFF; }

.btn-line {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 4px;
    border-bottom: 1px solid var(--ash);
    color: var(--ink);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .2s;
}
.btn-line:hover { border-color: var(--blood); }

/* ── Bandeau compte inactif ── */
.acc-banner {
    position: relative;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    padding: 16px 40px;
    border-bottom: 1px solid var(--blood);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
}
.acc-banner[hidden] { display: none; }
.acc-banner p { margin: 0; }
.acc-banner .sub { color: var(--ash); }

/* ── Hero ── */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
}

.hero-ascii {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}
.hero-ascii pre {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    line-height: 13px;
    white-space: pre;
}
#ascii-bg { color: var(--faint); }
#ascii-ob { color: var(--ink); }
#ascii-rd { color: var(--blood); }
:root:not([data-halloween]) #ascii-rd { color: var(--ash); }

.hero-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 40px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.hero-tools,
.lang {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ash);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color .2s;
}
.tool:hover,
.tool.active { color: var(--ink); }

/* Icône = thème vers lequel on bascule */
.t-dark,
[data-theme="light"] .t-light { display: none; }
[data-theme="light"] .t-dark { display: block; }

.hero-foot {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: flex-end;
    align-content: flex-end;
    justify-content: space-between;
    gap: 32px;
    /* Le bas (≈ 80 px) reste libre pour le zombie d'Halloween. */
    padding: 120px 40px 88px;
}

.hero-copy { max-width: 640px; }

.hero-copy h1 {
    max-width: 8em;
    margin: 0;
    font-size: clamp(44px, 6vw, 88px);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.hero-acts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    margin-top: 36px;
}

/* ── Connexion / inscription ── */
body.auth { --spider-left: 53%; }

.auth-main {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    padding: 24px 8vw 96px;
}

.auth-card {
    width: min(440px, 100%);
    padding: 32px;
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
}
.auth-card h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
}
.auth-card .sub {
    margin: 6px 0 0;
    color: var(--ash);
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.fld {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fld label {
    font-size: 14px;
    font-weight: 500;
}
.fld input,
.fld select {
    height: 44px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
}
.fld input::placeholder { color: var(--ash); }
.fld input:hover,
.fld select:hover { border-color: var(--raise); }
.fld input.error-field { border-color: var(--blood); }
[data-theme="dark"] .fld select { color-scheme: dark; }

.field-error,
.error-msg {
    display: none;
    margin: 0;
    color: var(--blood);
    font-size: 13px;
}

.pw-strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 2px;
}
.pw-bar {
    height: 3px;
    border-radius: 3px;
    background: var(--raise);
}

.fld-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ash);
    font-size: 13px;
    line-height: 1.5;
}
.fld-check input {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--ink);
}
.fld-check a { color: var(--ink); }

.captcha-wrap { min-height: 65px; }

.auth-form button.btn-fill { width: 100%; }

.auth-foot {
    margin: 20px 0 0;
    color: var(--ash);
    font-size: 14px;
    text-align: center;
}
.auth-foot a,
.auth-help a { color: var(--ink); }

.auth-help {
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--raise);
    color: var(--ash);
    font-size: 13px;
    line-height: 1.5;
}
.auth-help strong { color: var(--ink); font-weight: 500; }

/* ── Araignée (styles communs : halloween.css) ── */
.spider {
    position: absolute;
    top: 0;
    left: var(--spider-left, 43%);
    z-index: 3;
}
/* ── Pied de page ── */
.site-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px 24px;
    color: var(--ash);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}
.site-foot nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 24px;
}
.site-foot a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ash);
    text-decoration: none;
}
.site-foot a:hover { color: var(--ink); }
.site-foot p {
    max-width: 640px;
    margin: 0;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .spider { left: 78%; }
    .auth-main { justify-content: center; }
    .auth .spider { left: 4%; }
}

@media (max-width: 760px) {
    .acc-banner { padding: 14px 16px; }
    .hero-head { padding: 12px 16px; }
    .hero-foot { padding: 96px 16px 96px; }
    .spider { left: auto; right: 0; }
    .auth-main { padding: 8px 16px 96px; }
    .auth-card { padding: 24px 20px; }
    .auth .spider { display: none; }
}

/* Point de contact Discord dans l'en-tête (accueil, connexion, inscription) */
.tool-discord { gap: 8px; padding: 0 12px; text-decoration: none; }
@media (max-width: 560px) { .tool-discord span { display: none; } }
