/* Chiffrex ID : identité visuelle (kit v1, octobre 2026)
   Tokens et composants partagés par toutes les pages d'auth.chiffrex.fr */

:root {
    --cx-ink: #0F1A2B;
    --cx-paper: #F6F4EF;
    --cx-sand: #EFECE4;
    --cx-muted: #4A5568;
    --cx-body: #333F52;
    --cx-line: #E2DDD1;
    --cx-rule: #C9C3B4;
    --cx-field: #CFC9BB;
    --cx-blue: #1E3FE0;
    --cx-blue-light: #6B85FF;
    --cx-error: #B42318;
    --cx-error-bg: #FEF3F2;
    --cx-ok: #0B6B4A;
    --cx-ok-bg: #ECF8F2;
    --accent: var(--cx-blue);
    --font-display: 'Host Grotesk', 'Inter', sans-serif;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

body {
    margin: 0;
    background: var(--cx-paper);
    color: var(--cx-ink);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cx-ink); }
a:hover { color: var(--cx-blue); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 2px solid var(--cx-blue);
    outline-offset: 2px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Gabarit de page ---------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px clamp(20px, 4vw, 48px);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--cx-ink);
}
.auth-logo img { display: block; height: 26px; width: auto; }

.auth-header-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--cx-muted);
}

.auth-main {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 8px clamp(16px, 3vw, 32px) 24px;
    align-items: stretch;
}

.auth-form-col {
    flex: 1 1 460px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 8px;
}
.auth-form-col.is-wide .auth-card { max-width: 560px; }

.auth-card {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(36px, 4vw, 48px);
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--cx-ink);
}
.auth-title .dot { color: var(--cx-blue); }

.auth-lead { margin: 0; font-size: 17px; line-height: 1.5; color: var(--cx-body); }
.auth-lead b, .auth-lead strong { color: var(--cx-ink); }

.auth-head { display: flex; flex-direction: column; gap: 10px; }

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 18px clamp(20px, 4vw, 48px);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--cx-muted);
}
.auth-footer a { color: var(--cx-muted); }
.auth-footer a:hover { color: var(--cx-ink); }

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-size: 17px; font-weight: 600; line-height: 1.2;
    padding: 15px 20px;
    border: 1.5px solid var(--cx-ink); border-radius: 12px;
    background: var(--cx-ink); color: #fff;
    text-decoration: none; cursor: pointer;
    transition: background-color .15s, color .15s;
}
.btn:hover { background: #1d2a40; color: #fff; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; color: var(--cx-ink); }
.btn-outline:hover { background: var(--cx-ink); color: #fff; }
.btn-sm { font-size: 15px; padding: 8px 14px; border-radius: 10px; white-space: nowrap; }
.btn-danger { background: var(--cx-error); border-color: var(--cx-error); }
.btn-danger:hover { background: #8E1B11; color: #fff; }
.btn-light { background: #fff; color: var(--cx-ink); border-color: #fff; }
.btn-light:hover { background: var(--cx-paper); color: var(--cx-ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Champs ---------- */

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

.field {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 14px; font-weight: 600; color: var(--cx-ink);
}
.field .opt { font-weight: 400; color: var(--cx-muted); }
.field .hint { font-weight: 400; font-size: 13px; color: var(--cx-muted); }

.field-wrap { position: relative; display: block; }

.input, .select {
    width: 100%;
    font: inherit; font-size: 16px; font-weight: 400;
    padding: 13px 14px;
    border-radius: 12px; border: 1.5px solid var(--cx-field);
    background: #fff; color: var(--cx-ink);
}
.input::placeholder { color: #6B7280; }
.input:hover, .select:hover { border-color: var(--cx-muted); }
.input:focus, .select:focus { outline: none; border-color: var(--cx-ink); box-shadow: 0 0 0 3px rgba(30, 63, 224, .25); }
.input[disabled] { background: var(--cx-sand); color: var(--cx-muted); }
.input.has-toggle { padding-right: 84px; }
textarea.input { resize: vertical; line-height: 1.5; }

.toggle-pw {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font: inherit; font-size: 14px; font-weight: 600; color: var(--cx-ink);
    background: none; border: 0; padding: 8px; cursor: pointer; border-radius: 8px;
}

.phone-row { display: flex; gap: 8px; }
.phone-row .select { width: auto; flex: 0 0 auto; padding-right: 8px; }
.phone-row .input { flex: 1 1 auto; min-width: 0; }

.check {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 15px; font-weight: 400; line-height: 1.4; color: var(--cx-body); cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cx-ink); flex: none; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-strong { font-size: 15px; font-weight: 600; }
.fine { margin: 0; font-size: 15px; color: var(--cx-muted); }
.fine.center { text-align: center; }
.fine a { font-weight: 600; }

/* ---------- Messages ---------- */

.alert {
    margin: 0; padding: 12px 14px; border-radius: 12px;
    font-size: 15px; line-height: 1.45;
    border: 1.5px solid var(--cx-error); background: var(--cx-error-bg); color: var(--cx-error);
}
.alert.is-ok { border-color: var(--cx-ok); background: var(--cx-ok-bg); color: var(--cx-ok); }
.alert strong { font-weight: 700; }

/* ---------- Surtitre, carte, liste ---------- */

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--cx-muted);
}
.eyebrow::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex: none; }

.card {
    background: #fff; border: 1px solid var(--cx-line); border-radius: 16px; padding: 24px;
}

.notes.card-notes { background: #fff; border: 1px solid var(--cx-line); border-radius: 16px; padding: 16px 18px; }
.badge-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--cx-blue); color: #fff; display: flex; align-items: center; justify-content: center; }
.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--cx-body); }
.notes li { display: flex; gap: 10px; }
.notes li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--cx-blue); margin-top: 8px; flex: none; }

/* ---------- Bloc sombre (réseau Chiffrex) ---------- */

.auth-aside {
    flex: 1 1 420px; max-width: 640px; min-width: 0;
    background: var(--cx-ink); color: #fff;
    border-radius: 24px; padding: clamp(28px, 4vw, 48px);
    display: flex; flex-direction: column; gap: 22px;
}
.auth-aside .eyebrow-dark { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #C9D0DC; }
.auth-aside h2 {
    margin: 0; font-family: var(--font-display); font-weight: 800;
    font-size: clamp(30px, 3vw, 42px); line-height: 1.02; letter-spacing: -0.035em;
}
.auth-aside h2 .dot { color: var(--cx-blue-light); }
.auth-aside .lead { margin: 0; font-size: 17px; line-height: 1.5; color: #D5DCE8; max-width: 440px; }
.network-list {
    list-style: none; margin: 6px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); column-gap: 28px;
}
.network-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid #243046; }
.network-list .pill { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; margin-top: 6px; }
.network-list .name { display: block; font-weight: 600; font-size: 15px; color: #fff; }
.network-list .host { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 12px; color: #A3ADBF; overflow-wrap: anywhere; }
.auth-aside-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.auth-aside-foot p { margin: 0; font-size: 14px; color: #A3ADBF; max-width: 300px; }
.auth-aside-foot a { color: #fff; font-weight: 600; }
.auth-aside-foot a:hover { color: var(--cx-blue-light); }
.auth-aside-x { font-family: var(--font-display); font-weight: 800; font-size: clamp(72px, 11vw, 180px); line-height: .72; color: var(--cx-blue-light); }

@media (max-width: 600px) {
    .hide-s, .network-list .host.hide-s { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .auth-aside-x { font-size: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------- Pages à colonne unique (sans bloc réseau) ---------- */

.auth-single {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px clamp(16px, 3vw, 32px) 48px;
}
.auth-single .auth-card { max-width: 480px; }
.auth-single .auth-card.is-prose { max-width: 720px; }

.prose { display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.55; color: var(--cx-body); }
.prose p, .prose ol, .prose ul { margin: 0; }
.prose ol, .prose ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose h2 { margin: 14px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: var(--cx-ink); }
.prose strong { color: var(--cx-ink); }
.notice { margin: 0; padding: 16px 18px; border-radius: 12px; background: var(--cx-sand); border: 1px solid var(--cx-line); font-size: 15px; line-height: 1.5; color: var(--cx-body); }

/* ---------- Espace compte (profil) ---------- */

.account {
    flex: 1;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 1248px;
    margin: 0 auto;
    padding: 8px clamp(16px, 3vw, 32px) 48px;
}
.account-side { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 28px 24px; }
.account-main { display: flex; flex-direction: column; gap: 32px; padding: clamp(20px, 3vw, 36px); }
.account-section { display: flex; flex-direction: column; gap: 20px; }
.account-section + .account-section { border-top: 1px solid var(--cx-line); padding-top: 32px; }
.account-section h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 3vw, 34px); line-height: 1.05; letter-spacing: -0.03em; }
.account-section h1 .dot { color: var(--cx-blue); }
.account-section p.sub { margin: 4px 0 0; font-size: 16px; color: var(--cx-body); }

.avatar { position: relative; width: 96px; height: 96px; }
.avatar-img {
    width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    background: var(--cx-ink); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -0.02em;
}
.avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit {
    position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%;
    background: #fff; color: var(--cx-ink); border: 1.5px solid var(--cx-ink);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.avatar-edit:hover { background: var(--cx-ink); color: #fff; }
.avatar-edit svg { width: 16px; height: 16px; }
.avatar input[type=file]:focus-visible + .avatar-edit { outline: 2px solid var(--cx-blue); outline-offset: 2px; }

.account-name { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.account-meta { margin: 2px 0 0; font-size: 14px; color: var(--cx-muted); overflow-wrap: anywhere; }
.account-meta.mono { font-family: var(--font-mono); font-size: 12px; }

.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.badge {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
    padding: 6px 10px; border-radius: 8px; border: 1px solid var(--cx-line); background: var(--cx-paper); color: var(--cx-ink);
}
.badge::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--cx-ok); }
.badge.is-plus::before { background: var(--cx-blue); }

.account-note { margin: 0; font-size: 14px; line-height: 1.45; color: var(--cx-muted); }
.account-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--cx-line); }
.account-actions .muted-link { font-size: 14px; color: var(--cx-muted); }

@media (max-width: 860px) {
    .account { grid-template-columns: 1fr; }
}

/* ---------- Chiffrex+ (premium) ---------- */

.plus { width: 100%; max-width: 960px; display: flex; flex-direction: column; gap: 28px; }
.plus-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.plus-card { display: flex; flex-direction: column; gap: 20px; padding: clamp(20px, 3vw, 32px); }
.plus-status { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--cx-line); background: var(--cx-paper); }
.plus-status::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--cx-muted); }
.plus-status.is-active::before { background: var(--cx-ok); }
.plus-price { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; }
.plus-price small { font-family: var(--font-mono); font-weight: 400; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--cx-muted); margin-left: 8px; }
.plus-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 16px; color: var(--cx-body); }
.plus-list li { display: flex; gap: 10px; }
.plus-list li::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--cx-blue); margin-top: 7px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1.5px solid var(--cx-ink); border-radius: 16px; background: #fff; }
.plan-card h3 { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--cx-muted); }
.plan-price { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.plan-price span { font-family: var(--font-sans); font-weight: 400; font-size: 15px; letter-spacing: 0; color: var(--cx-muted); }
.plan-card p { margin: 0 0 6px; font-size: 15px; color: var(--cx-body); }
.plus-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.plus-hint { margin: 0; font-size: 14px; color: var(--cx-muted); line-height: 1.5; }
.plus-meta { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.plus-meta-item span { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--cx-muted); }
.plus-meta-item strong { display: block; margin-top: 4px; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 860px) {
    .plus-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .plan-grid { grid-template-columns: 1fr; }
}
