/* Terra Hotspot — design system premium.
   Palette tirée du logo : noir encre, jaune vif, or, orange. Clair + sombre automatiques. */
:root {
    --brand-black: #0a0a0a;
    --brand-yellow: #ffd400;
    --brand-yellow-hi: #ffe94d;
    --brand-gold: #f5a000;
    --brand-orange: #ff8a00;
    --grad: linear-gradient(135deg, #ffe600 0%, #ffc400 55%, #ff9a00 100%);

    --bg: #f6f5f0;
    --bg-glow: rgba(255, 212, 0, .16);
    --card: #ffffff;
    --card-2: #fbfaf5;
    --text: #15140f;
    --muted: #6b6858;
    --border: #e8e4d3;
    --field: #ffffff;
    --soft: #fff7d1;
    --price: #0a0a0a;
    --link: #8a5a00;
    --ring: rgba(245, 160, 0, .35);
    --bar: rgba(255, 255, 255, .86);
    --danger: #b3261e;  --danger-bg: #fdecea;  --danger-bd: #f5c2be;
    --good: #17703a;    --good-bg: #e6f4ea;    --good-bd: #b9dfc4;
    --shadow-sm: 0 1px 2px rgba(21, 20, 15, .06);
    --shadow: 0 1px 2px rgba(21, 20, 15, .05), 0 12px 28px -12px rgba(21, 20, 15, .16);
    --shadow-lg: 0 2px 4px rgba(21, 20, 15, .06), 0 24px 48px -16px rgba(21, 20, 15, .22);
    --r: 16px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0b09;
        --bg-glow: rgba(255, 212, 0, .09);
        --card: #15140f;
        --card-2: #1a1913;
        --text: #f5f2e6;
        --muted: #a8a490;
        --border: #2d2b22;
        --field: #0f0f0c;
        --soft: #2a2610;
        --price: #ffd400;
        --link: #ffd400;
        --ring: rgba(255, 212, 0, .35);
        --bar: rgba(15, 15, 12, .82);
        --danger: #ff8a80;  --danger-bg: #2d1513;  --danger-bd: #6b2b27;
        --good: #7fd69a;    --good-bg: #12241a;    --good-bd: #2c5a3c;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
        --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 30px -14px rgba(0, 0, 0, .8);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, .5), 0 26px 52px -16px rgba(0, 0, 0, .9);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; color: var(--text); min-height: 100vh;
    background: radial-gradient(900px 420px at 50% -120px, var(--bg-glow), transparent 70%), var(--bg);
    font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { max-width: 780px; margin: 0 auto; padding: 0 18px 40px;  }
@media (prefers-reduced-motion: reduce) { main { animation: none; } * { transition: none !important; } }
a { color: var(--link); }
::selection { background: var(--brand-yellow); color: #000; }

/* ---------- Bandeau de marque : verre dépoli + filet or ---------- */
.brandbar { position: sticky; top: 0; z-index: 20; background: var(--bar); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); }
.brandbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); }
.brandbar .in { max-width: 780px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 12px; min-height: 62px; }
body.admin .brandbar .in { max-width: 1040px; }
.brandbar .home { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brandbar img.wordmark { height: 40px; width: auto; display: block; }
.brandbar img.mark { width: 42px; height: 42px; display: block; border-radius: 11px; box-shadow: var(--shadow-sm); }
.brandbar .name { font-weight: 800; letter-spacing: -.01em; font-size: 1.08rem; line-height: 1.15; }
/* Logo personnalisé d'un opérateur : pastille blanche par défaut (visible quel que soit le logo) */
.brandbar img.custom { width: 42px; height: 42px; object-fit: contain; border-radius: 11px; }
.brandbar img.custom.chip { background: #fff; padding: 3px; box-shadow: var(--shadow-sm); }
footer.powered { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .8rem; padding: 4px 16px 28px; }
footer.powered img { height: 22px; width: auto; opacity: .9; }

/* ---------- Typographie ---------- */
header { margin: 26px 0 18px; }
h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 800; }
h2 { font-size: 1.1rem; letter-spacing: -.01em; margin: 0 0 8px; font-weight: 750; }
h3 { font-size: 1rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.back { color: var(--link); text-decoration: none; font-size: .9rem; font-weight: 600; }
.back:hover { text-decoration: underline; }

/* ---------- Accueil (hero) ---------- */
.hero { text-align: center; padding: 38px 0 12px; }
.hero img.hero-logo { width: min(440px, 88%); height: auto; display: block; margin: 0 auto 22px; filter: drop-shadow(0 14px 22px rgba(255, 170, 0, .22)); }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); max-width: 24ch; margin: 0 auto 10px; }
.hero p.lead { color: var(--muted); max-width: 46ch; margin: 0 auto 18px; font-size: 1.05rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 440px; margin: 0 auto; }
.hero .cta .btn { flex: 1 1 190px; margin-top: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin: 26px 0 16px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; margin-bottom: 10px; box-shadow: 0 6px 14px -6px rgba(255, 150, 0, .7); }
.feature .ic svg { width: 22px; height: 22px; stroke: #111; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature b { display: block; margin-bottom: 2px; }
.feature span { color: var(--muted); font-size: .9rem; }
.pricing { text-align: center; border-top: 0; position: relative; overflow: hidden; }
.pricing::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--grad); }
.pricing .price { font-size: 2.2rem; margin-top: 8px; }
.pricing ul { text-align: left; max-width: 420px; margin: 12px auto; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.card ul { padding-left: 0; margin: 10px 0; list-style: none; }
.card ul li { position: relative; padding-left: 26px; margin: 6px 0; }
.card ul li::before { content: ""; position: absolute; left: 0; top: .3em; width: 16px; height: 16px; border-radius: 50%; background: var(--grad) ; }
.card ul li::after { content: ""; position: absolute; left: 5px; top: calc(.3em + 3px); width: 4px; height: 7px; border: solid #111; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.offers .card { margin-bottom: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; box-shadow: var(--shadow); }
.offers .card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--grad); }
.offers .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.offers .card h2 { margin-top: 6px; }
.offers .btn { margin-top: auto; }

/* Prix : gros chiffre noir surligné d'un trait jaune (clair) / jaune pur (sombre) */
.price { font-size: 1.9rem; font-weight: 850; letter-spacing: -.02em; color: var(--price); margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.price .hl { box-shadow: inset 0 -.38em 0 var(--brand-yellow); }
@media (prefers-color-scheme: dark) { .price .hl { box-shadow: none; } }

/* Ticket : code en relief, bords crantés */
.code { font: 800 2rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .16em; background: var(--soft); border: 2px dashed var(--brand-gold); border-radius: 14px; padding: 16px 10px; margin: 10px 0; user-select: all; position: relative; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 650; font-size: .92rem; margin: 10px 0 5px; }
input, select, textarea { width: 100%; padding: 12px 14px; font: inherit; color: var(--text); border: 1px solid var(--border); border-radius: 12px; background: var(--field); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-gold); box-shadow: 0 0 0 4px var(--ring); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand-gold); }

/* Boutons : dégradé jaune -> or du logo, texte NOIR */
.btn { display: inline-block; width: 100%; margin-top: 12px; padding: 13px 18px; font: inherit; font-weight: 800; text-align: center; text-decoration: none; color: var(--brand-black); background: var(--grad); border: 0; border-radius: 12px; cursor: pointer; box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 8px 18px -8px rgba(255, 150, 0, .75); transition: transform .12s, box-shadow .12s, filter .12s; }
.btn:hover { filter: brightness(1.04) saturate(1.05); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 12px 22px -8px rgba(255, 150, 0, .85); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { border-color: var(--brand-gold); filter: none; }
.btn.danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn.inline { width: auto; margin-top: 0; padding: 7px 12px; font-size: .85rem; border-radius: 10px; }

.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-bd); border-radius: 12px; padding: 11px 14px; }
.ok { background: var(--good-bg); color: var(--good); border: 1px solid var(--good-bd); border-radius: 12px; padding: 11px 14px; }
code { background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; font-size: .92em; }
.notice { background: var(--soft); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; }

/* ---------- Administration / espace opérateur ---------- */
body.admin main { max-width: 1040px; }
nav.admin { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; padding: 5px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
nav.admin a { padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: .93rem; transition: background .15s, color .15s; }
nav.admin a:hover { background: var(--soft); color: var(--text); }
nav.admin a.on { background: var(--brand-black); color: var(--brand-yellow); box-shadow: var(--shadow-sm); }
@media (prefers-color-scheme: dark) { nav.admin a.on { background: var(--brand-yellow); color: #0a0a0a; } }
.table-wrap { overflow-x: auto; margin-bottom: 18px; border-radius: var(--r); border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--card); }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); font-size: .9rem; }
.table-wrap table { border: 0; }
table:not(.table-wrap table) { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--card-2); color: var(--muted); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 750; }
tr:last-child td { border-bottom: 0; }
.table-wrap th, .table-wrap td { white-space: nowrap; }
.table-wrap td form { white-space: normal; }
tbody tr:hover td, table tr:hover td { background: var(--card-2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 16px 16px 20px; box-shadow: var(--shadow-sm); overflow: hidden; color: var(--muted); font-size: .85rem; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--grad); }
.stat b { display: block; font-size: 1.65rem; letter-spacing: -.02em; color: var(--text); line-height: 1.25; font-variant-numeric: tabular-nums; }

/* Admin : gestion manuelle d'une licence (déroulant par site) */
details summary { cursor: pointer; color: var(--link); font-weight: 700; }
.lic-box { display: grid; gap: 8px; min-width: 280px; margin-top: 8px; }
.lic-box form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: var(--card-2); }
.lic-box input { width: auto; flex: 1 1 110px; min-width: 0; padding: 7px 9px; font-size: .9rem; }
.lic-box .btn { flex: 0 0 auto; }

/* Mobile : le tableau des sites devient une pile de cartes (rien n'est coupé) */
@media (max-width: 640px) {
    h1 { font-size: 1.45rem; }
    table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
    table.stack tr:first-child { display: none; }
    table.stack tr { border-bottom: 8px solid var(--bg); padding: 4px 0; }
    table.stack td { border: 0; padding: 6px 12px; }
    table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
    .lic-box { min-width: 0; }
    .brandbar img.wordmark { height: 34px; }
}

/* Double authentification, rôles, rapports */
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { border: 1px solid var(--border); border-radius: 14px; max-width: 100%; height: auto; box-shadow: var(--shadow-sm); }
code.secret { display: inline-block; margin-top: 4px; padding: 6px 10px; background: var(--soft); border-radius: 10px; font-weight: 800; letter-spacing: .08em; user-select: all; word-break: break-all; }
ul.codes { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
ul.codes li { font: 800 1.05rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; text-align: center; background: var(--soft); border: 2px dashed var(--brand-gold); border-radius: 10px; padding: 8px; user-select: all; }
ul.codes li::before, ul.codes li::after { display: none; }
ol.steps { padding-left: 20px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--soft); border: 1px solid var(--border); color: var(--muted); }
.badge.on { background: var(--good-bg); color: var(--good); border-color: var(--good-bd); }
.badge.off { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.row-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.row-form input, .row-form select { width: auto; flex: 1 1 120px; min-width: 0; padding: 7px 9px; font-size: .9rem; }
.row-form .btn { flex: 0 0 auto; }
.period { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; align-items: end; }
.period .btn { margin-top: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.presets a { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; text-decoration: none; color: var(--text); background: var(--card); transition: border-color .15s; }
.presets a:hover { border-color: var(--brand-gold); }
.presets a.on { background: var(--grad); border-color: transparent; color: var(--brand-black); font-weight: 800; }
.exports { display: flex; flex-wrap: wrap; gap: 8px; }
.exports .btn { width: auto; flex: 1 1 200px; }

/* ---------- Connexion / inscription (cartes centrées) ---------- */
.auth { max-width: 440px; margin: 28px auto 0; }
.auth header { margin-top: 0; }
.auth .card { box-shadow: var(--shadow-lg); padding: 24px; }
.auth .auth-logo { display: block; width: min(300px, 80%); margin: 0 auto 14px; height: auto; }

@media print { .brandbar, nav.admin, footer.powered { display: none; } body { background: #fff; } }

/* Statuts dans les tableaux : pastilles */
td .ok, td .alert { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }

/* ---------- Carrousel (informations / publicités du site) ---------- */
.carousel { position: relative; margin: 18px 0 14px; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); background: var(--card); }
.carousel .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.carousel .track::-webkit-scrollbar { display: none; }
.carousel .slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 12 / 5; background: var(--card-2); }
.carousel .slide img, .carousel .slide a { display: block; width: 100%; height: 100%; }
.carousel .slide img { object-fit: cover; user-select: none; }
.carousel .dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.carousel .dot { pointer-events: auto; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); cursor: pointer; transition: width .2s, background .2s; }
.carousel .dot.on { width: 22px; background: var(--brand-yellow); }
.banner-admin { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; }
.banner-admin img { width: 150px; aspect-ratio: 12 / 5; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
@media (max-width: 520px) { .banner-admin { grid-template-columns: 1fr; } .banner-admin img { width: 100%; } }

/* ---------- Afficher / masquer le mot de passe ---------- */
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--soft); }
.pw-toggle:focus-visible { outline: 3px solid var(--ring); }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
