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

:root {
    --bg:       #0b0d14;
    --surface:  #141821;
    --border:   #232838;
    --accent:   #6c63ff;
    --accent-h: #8b85ff;
    --accent-2: #38bdf8;
    --green:    #22c55e;
    --red:      #ef4444;
    --amber:    #f59e0b;
    --text:     #e7ebf3;
    --muted:    #8b93a7;
    --radius:   12px;
    --shadow:   0 4px 32px rgba(0,0,0,.4);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
}

a { color: var(--accent); }

/* ── Layout ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.5rem; width: 100%; max-width: 480px; margin: auto; }
.card-wide { max-width: 900px; }

.logo { display: flex; align-items: center; gap: .6rem; margin-bottom: 2rem; }
.logo svg { flex-shrink: 0; }
.logo-text { font-size: 1.35rem; font-weight: 700; letter-spacing: -.5px; }
.logo-text span { color: var(--accent); }

h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; }
h2 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.subtitle { font-size: .875rem; color: var(--muted); margin-bottom: 2rem; }

.back-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); text-decoration: none; margin-bottom: 1.25rem; }
.back-link:hover { color: var(--text); }

/* ── Form ── */
.field { margin-bottom: 1.25rem; }
label { display: block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .5rem; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
    width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: .95rem; padding: .75rem 1rem; outline: none; font-family: inherit;
    transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.8rem; }
.pw-toggle { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; line-height: 1; padding: 0; }
.pw-toggle:hover { color: var(--text); }

.hint { font-size: .78rem; color: var(--muted); margin-top: .4rem; }

/* ── Button ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--accent); color: #fff; border: none; border-radius: 8px;
    font-size: .95rem; font-weight: 700; padding: .8rem 1.4rem; cursor: pointer;
    transition: background .15s, transform .1s; text-decoration: none; width: 100%; text-align: center;
}
.btn:hover { background: var(--accent-h); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--red); }
.btn-sm { font-size: .85rem; padding: .55rem 1rem; width: auto; }
.btn-auto { width: auto; }

/* ── Alert ── */
.alert { border-radius: 8px; padding: .85rem 1rem; font-size: .875rem; margin-bottom: 1.5rem; display: flex; align-items: flex-start; gap: .6rem; }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }
.alert-info    { background: rgba(108,99,255,.1);  border: 1px solid rgba(108,99,255,.3); color: #a5b4fc; }
.alert-warn    { background: rgba(245,158,11,.1);   border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

/* ── Status badge ── */
.status-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .3rem .7rem; border-radius: 999px; }
.status-essai  { background: rgba(56,189,248,.15); color: var(--accent-2); }
.status-actif  { background: rgba(34,197,94,.15);  color: var(--green); }
.status-expire { background: rgba(239,68,68,.15);  color: var(--red); }
.status-resilie{ background: rgba(139,147,167,.15); color: var(--muted); }

/* ── Plan card ── */
.plan-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin: 1.25rem 0; text-align: center; }
.plan-price { font-size: 2.2rem; font-weight: 800; margin: .5rem 0; }
.plan-price span { font-size: 1rem; font-weight: 500; color: var(--muted); }

/* ── Devices list ── */
.device-list { display: flex; flex-direction: column; gap: .6rem; margin: 1.25rem 0; }
.device-row {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .85rem 1rem;
    flex-wrap: wrap;
}
.device-row-label { font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: .5rem; }
.device-row-meta { font-size: .76rem; color: var(--muted); }
.device-row form { margin: 0; }
.device-row button {
    font-size: .78rem; padding: .4rem .75rem; border-radius: 6px; border: 1px solid var(--border);
    background: transparent; color: var(--muted); cursor: pointer; font-family: inherit;
}
.device-row button:hover { color: var(--red); border-color: var(--red); }
.device-current { color: var(--green); font-size: .7rem; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Annonces ── */
.announcement { background: rgba(108,99,255,.08); border: 1px solid rgba(108,99,255,.3); border-radius: 8px; padding: .9rem 1rem; margin-top: 1rem; font-size: .88rem; }
.announcement p { margin-top: .35rem; line-height: 1.55; color: var(--muted); white-space: pre-wrap; }
.announcement-date { display: block; margin-top: .4rem; font-size: .72rem; color: var(--muted); }

/* ── Messages ── */
textarea { resize: vertical; line-height: 1.5; }
.thread { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.5rem; }
.bubble { max-width: 85%; padding: .75rem .95rem; border-radius: 12px; font-size: .88rem; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.bubble-meta { display: block; font-size: .7rem; color: var(--muted); margin-bottom: .25rem; white-space: normal; }
.bubble-them { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); }
.bubble-me { align-self: flex-end; background: rgba(108,99,255,.12); border: 1px solid rgba(108,99,255,.3); }

/* Champ piège anti-robots du formulaire de contact. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

footer { margin-top: 2rem; font-size: .78rem; color: var(--muted); text-align: center; max-width: 640px; }
footer a { color: var(--muted); text-decoration: underline; }

/* ── CGV page ── */
.legal { max-width: 720px; width: 100%; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.legal h1 { font-size: 1.6rem; margin-bottom: .5rem; }
.legal h2 { font-size: 1.05rem; margin: 1.75rem 0 .6rem; }
.legal p, .legal li { font-size: .9rem; line-height: 1.7; color: var(--muted); margin-bottom: .5rem; }
.legal ul { padding-left: 1.25rem; }
.legal strong { color: var(--text); }

/* ── Petits écrans (mobile) ── */
@media (max-width: 480px) {
    body { padding: 1rem; }
    .card { padding: 1.5rem; }
}
