/* ============ ALTA ROLEPLAY — espace /compte (v2) ============ */
:root {
    --bg: #141417;
    --bg2: #1a1a1f;
    --panel: rgba(32, 32, 38, .82);
    --panel-solid: #202026;
    --panel2: #2a2a32;
    --border: #33333d;
    --border-hi: #45454f;
    --text: #f4f4f7;
    --muted: #9d9da9;
    --accent: #ff4444;
    --accent2: #ff7a66;
    --accent-grad: linear-gradient(135deg, #ff4444, #ff7a3d);
    --ok: #3ecf6f;
    --warn: #f5b942;
    --info: #7c8cff;
    --radius: 16px;
    --shadow: 0 10px 32px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { scrollbar-color: #3a3a44 var(--bg); }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Outfit", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.bg-glow {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(600px 300px at 85% -5%, rgba(255, 68, 68, .09), transparent 70%),
        radial-gradient(700px 380px at -10% 110%, rgba(124, 140, 255, .06), transparent 70%);
}

/* ---------- Transitions de page ---------- */
main.container { animation: pageIn .34s cubic-bezier(.22, .61, .36, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
body.page-leaving main.container { animation: pageOut .2s ease forwards; }
@keyframes pageOut { to { opacity: 0; transform: translateY(-16px); } }
@media (prefers-reduced-motion: reduce) {
    main.container, body.page-leaving main.container { animation: none; }
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Icônes Material Symbols ---------- */
.ms {
    font-family: 'Material Symbols Rounded';
    font-weight: normal; font-style: normal;
    font-size: 1.25em; line-height: 1;
    display: inline-block; vertical-align: -0.24em;
    letter-spacing: normal; text-transform: none; white-space: nowrap;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    -webkit-font-smoothing: antialiased;
}
h1 .ms, h2 .ms { color: var(--accent2); margin-right: 6px; }

/* ---------- Barre supérieure ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(20, 20, 24, .78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-weight: 700; font-size: 19px; letter-spacing: .2px; }
.brand em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 2px 8px rgba(255, 68, 68, .35)); }
.brand:hover { text-decoration: none; }

.userbox { position: relative; }
.userbtn {
    display: flex; align-items: center; gap: 10px;
    background: var(--panel2); color: #fff;
    border: 1px solid var(--border); border-radius: 999px;
    padding: 5px 12px 5px 5px; cursor: pointer;
    font-family: inherit; font-size: 15px;
    transition: border-color .2s, background .2s;
}
.userbtn:hover { background: #32323b; border-color: var(--border-hi); }
.userbtn .avatar { width: 34px; height: 34px; border-radius: 50%; }
.userbtn .chev { color: var(--muted); font-size: 20px; transition: transform .2s; }
.userbtn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.dropdown {
    position: absolute; right: 0; top: calc(100% + 10px);
    min-width: 270px;
    background: var(--panel-solid); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
    padding: 8px;
    display: flex; flex-direction: column;
    opacity: 0; transform: translateY(-6px) scale(.98);
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dd-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dd-head img { width: 42px; height: 42px; border-radius: 50%; }
.dd-head small { color: var(--muted); display: block; }
.dropdown a {
    display: flex; align-items: center; gap: 12px;
    color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 14.5px;
    transition: background .12s;
}
.dropdown a .ms { color: var(--muted); font-size: 21px; }
.dropdown a:hover { background: var(--panel2); text-decoration: none; }
.dropdown a.active { background: var(--panel2); font-weight: 600; }
.dropdown a.active .ms, .dropdown a:hover .ms { color: var(--accent2); }
.dropdown a.danger, .dropdown a.danger .ms { color: var(--accent); }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 6px; }

/* ---------- Contenu ---------- */
.container { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 30px 20px 70px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; border-top: 1px solid var(--border); }
h1.page { font-size: 30px; margin: 4px 0 6px; letter-spacing: -.3px; }
p.sub { color: var(--muted); margin: 0 0 26px; font-size: 15.5px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}
.card h2 { margin: 0 0 14px; font-size: 18.5px; display: flex; align-items: center; gap: 4px; }
.card.center { text-align: center; }
.card.center h2 { justify-content: center; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
.tile {
    position: relative;
    background: var(--panel2); border: 1px solid var(--border); border-radius: 14px;
    padding: 18px; color: var(--text); display: block;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    overflow: hidden;
}
.tile:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 68, 68, .55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
    text-decoration: none;
}
.tile .ms.tico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; font-size: 23px; margin-bottom: 12px;
    color: var(--accent2);
    background: rgba(255, 68, 68, .12);
    border: 1px solid rgba(255, 68, 68, .22);
    border-radius: 12px;
}
.tile b { font-size: 15.5px; display: block; }
.tile small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; font-size: 13px; }

/* ---------- Formulaires ---------- */
label { display: block; margin: 13px 0 5px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
input, select, textarea {
    width: 100%; padding: 11px 13px;
    background: var(--bg2); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px;
    font-family: inherit; font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, .18);
}
textarea { resize: vertical; min-height: 90px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 22px; margin-top: 14px;
    background: var(--accent-grad); color: #fff; border: none; border-radius: 10px;
    font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
    transition: filter .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 14px rgba(255, 68, 68, .25);
}
.btn:hover { filter: brightness(1.1); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.secondary { background: var(--panel2); border: 1px solid var(--border); box-shadow: none; }
.btn.secondary:hover { border-color: var(--border-hi); }
.btn.small { padding: 6px 14px; font-size: 13px; margin-top: 0; }
.btn-discord { background: #5865F2; box-shadow: 0 4px 14px rgba(88, 101, 242, .3); }
.btn-roblox { background: #17191d; border: 1px solid #3a3d44; box-shadow: none; }
.btn .ms { font-size: 18px; }

/* ---------- Tableaux ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.list td { padding: 10px; border-bottom: 1px solid #2c2c34; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: rgba(255, 255, 255, .018); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge .ms { font-size: 14px; }
.badge.ok { background: rgba(62, 207, 111, .13); color: var(--ok); }
.badge.warn { background: rgba(245, 185, 66, .13); color: var(--warn); }
.badge.ko { background: rgba(255, 68, 68, .13); color: var(--accent); }
.badge.info { background: rgba(124, 140, 255, .15); color: var(--info); }

/* ---------- Navigation RP (retour + switch) ---------- */
.rp-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.rp-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 999px;
    background: var(--panel2); border: 1px solid var(--border); color: var(--text);
    font-size: 14px; font-weight: 500;
}
.rp-back:hover { border-color: var(--border-hi); text-decoration: none; }
.rp-back .ms { font-size: 19px; }
.rp-switch { position: relative; }
.rp-switch-btn {
    display: inline-flex; align-items: center; gap: 8px; min-width: 210px;
    padding: 9px 16px; border-radius: 999px; cursor: pointer;
    background: var(--panel2); border: 1px solid var(--border); color: var(--text);
    font-family: inherit; font-size: 14px; font-weight: 500;
}
.rp-switch-btn:hover { border-color: var(--border-hi); }
.rp-switch-btn .ms { font-size: 19px; color: var(--accent2); }
.rp-switch-menu {
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 90; min-width: 230px;
    background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 6px;
    display: none; flex-direction: column;
}
.rp-switch-menu.open { display: flex; }
.rp-switch-menu a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    color: var(--text); font-size: 14px;
}
.rp-switch-menu a .ms { font-size: 19px; color: var(--muted); }
.rp-switch-menu a:hover { background: var(--panel2); text-decoration: none; }
.rp-switch-menu a.on { background: var(--panel2); font-weight: 600; }
.rp-switch-menu a.on .ms, .rp-switch-menu a:hover .ms { color: var(--accent2); }

/* ---------- Sélecteur d'accès (jolis toggles) ---------- */
.acces-choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.acces-toggle { position: relative; cursor: pointer; }
.acces-toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.acces-toggle .ac-box {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px;
    background: var(--panel2); border: 1.5px solid var(--border); color: var(--muted);
    font-size: 14px; font-weight: 500; transition: all .15s;
}
.acces-toggle .ac-box .ms { font-size: 19px; }
.acces-toggle:hover .ac-box { border-color: var(--border-hi); }
.acces-toggle input:checked + .ac-box {
    background: rgba(255, 68, 68, .14); border-color: var(--accent); color: var(--text);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, .12);
}
.acces-toggle input:checked + .ac-box .ms { color: var(--accent2); }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.tabs a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: 999px;
    background: var(--panel2); border: 1px solid var(--border);
    color: var(--text); font-size: 14px; font-weight: 500;
    transition: border-color .15s, background .15s, transform .1s;
}
.tabs a .ms { font-size: 18px; color: var(--muted); }
.tabs a:hover { border-color: var(--border-hi); text-decoration: none; transform: translateY(-1px); }
.tabs a.on { background: var(--accent-grad); border-color: transparent; font-weight: 600; box-shadow: 0 4px 14px rgba(255, 68, 68, .25); }
.tabs a.on .ms { color: #fff; }

.flash { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14.5px; }
.flash::before { font-family: 'Material Symbols Rounded'; font-variation-settings: 'FILL' 1; font-size: 20px; }
.flash-success { background: rgba(62, 207, 111, .1); border: 1px solid rgba(62, 207, 111, .35); color: var(--ok); }
.flash-success::before { content: "check_circle"; }
.flash-error { background: rgba(255, 68, 68, .1); border: 1px solid rgba(255, 68, 68, .35); color: var(--accent); }
.flash-error::before { content: "error"; }
.flash-info { background: rgba(124, 140, 255, .1); border: 1px solid rgba(124, 140, 255, .35); color: var(--info); }
.flash-info::before { content: "info"; }

/* ---------- Résumé du compte ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-head img.big { width: 92px; height: 92px; border-radius: 50%; border: 3px solid transparent; background: var(--accent-grad) border-box; box-shadow: 0 6px 22px rgba(255, 68, 68, .3); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); margin-top: 18px; }
.stat { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 15px; text-align: center; }
.stat b { display: block; font-size: 21px; letter-spacing: -.3px; }
.stat span { color: var(--muted); font-size: 12.5px; }
.guilds { display: flex; flex-wrap: wrap; gap: 8px; }
.guilds .g {
    display: flex; align-items: center; gap: 8px;
    background: var(--panel2); border: 1px solid var(--border); border-radius: 999px;
    padding: 5px 13px 5px 5px; font-size: 13.5px;
}
.guilds .g img { width: 26px; height: 26px; border-radius: 50%; }
.guilds .g .ms { font-size: 15px; color: var(--warn); }

/* ---------- Carte Nationale d'Identité ---------- */
.cni {
    width: 470px; max-width: 100%; aspect-ratio: 1.586;
    border-radius: 16px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #dfe9f5 0%, #cdd9ec 45%, #e8eef7 100%);
    color: #1b2a4a; font-family: "Outfit", sans-serif;
    box-shadow: 0 20px 46px rgba(0, 0, 0, .55);
    margin: 0 auto;
}
.cni::before {
    content: ""; position: absolute; inset: 0;
    background:
      radial-gradient(circle at 82% 20%, rgba(0, 85, 164, .10), transparent 42%),
      repeating-linear-gradient(115deg, transparent 0 22px, rgba(27, 42, 74, .035) 22px 23px);
}
.cni .band { position: absolute; top: 0; left: 0; right: 0; height: 7px;
    background: linear-gradient(90deg, #0055A4 33%, #fff 33% 66%, #EF4135 66%); }
.cni .head { padding: 13px 16px 4px; position: relative; }
.cni .head .rep { font-size: 10.5px; letter-spacing: 1.5px; font-weight: 700; color: #0055A4; }
.cni .head .type { font-size: 13px; font-weight: 800; letter-spacing: .6px; }
.cni .body { display: flex; gap: 12px; padding: 4px 16px; position: relative; }
.cni .photo { width: 98px; height: 120px; border-radius: 6px; object-fit: cover; background: #b9c6da; border: 1px solid #9fb0ca; }
.cni .fields { flex: 1; font-size: 11px; }
.cni .fields .f { margin-bottom: 4.5px; }
.cni .fields .l { color: #5a6c8f; font-size: 8.5px; text-transform: uppercase; letter-spacing: .6px; }
.cni .fields .v { font-weight: 700; font-size: 12px; }
.cni .num { position: absolute; top: 14px; right: 16px; text-align: right; font-size: 10px; color: #5a6c8f; }
.cni .num b { display: block; font-size: 12.5px; color: #1b2a4a; letter-spacing: 1px; }
.cni .mrz {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: #eef2f8; border-top: 1px dashed #9fb0ca;
    font-family: "Courier New", monospace; font-size: 11.5px; font-weight: 700;
    letter-spacing: 1.2px; color: #33415e; padding: 6px 14px; white-space: nowrap; overflow: hidden;
}

/* ============================================================
   TÉLÉPHONE — interface smartphone
   ============================================================ */
.phone-wrap { display: flex; justify-content: center; padding: 8px 0 20px; }
.phone {
    width: 384px; max-width: 100%; height: 760px; max-height: calc(100vh - 160px); min-height: 560px;
    background: #000; border-radius: 44px; position: relative;
    border: 3px solid #2c2c34;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .6), inset 0 0 0 2px #0a0a0c;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.p-status {
    height: 34px; flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px; font-size: 12.5px; font-weight: 600; color: #fff;
    position: relative; z-index: 5;
}
.p-status .notch {
    position: absolute; left: 50%; top: 7px; transform: translateX(-50%);
    width: 105px; height: 22px; background: #0a0a0c; border-radius: 999px;
}
.p-status .ms { font-size: 15px; }
.p-screen { flex: 1; overflow: hidden; position: relative; }
.p-app {
    position: absolute; inset: 0; display: none; flex-direction: column;
    background: #101014;
    animation: appIn .18s ease;
}
.p-app.on { display: flex; }
@keyframes appIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* Écran d'accueil */
.p-home { background: linear-gradient(180deg, #1d1030 0%, #101014 55%, #0d1420 100%); justify-content: space-between; }
.p-clock { text-align: center; margin-top: 42px; }
.p-clock b { font-size: 52px; font-weight: 300; letter-spacing: -1px; display: block; }
.p-clock span { color: rgba(255, 255, 255, .65); font-size: 14px; text-transform: capitalize; }
.p-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; padding: 26px 20px; }
.p-appicon { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; color: #fff; font-family: inherit; font-size: 11px; }
.p-appicon .ic {
    width: 56px; height: 56px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: transform .12s;
}
.p-appicon:active .ic, .p-appicon:hover .ic { transform: scale(1.08); }
.p-appicon .ic .ms { font-size: 28px; color: #fff; }
.ic-msg { background: linear-gradient(135deg, #34c759, #28a745); }
.ic-gram { background: linear-gradient(135deg, #f0416c, #b93bd4 60%, #7048e8); }
.ic-tel { background: linear-gradient(135deg, #4f8ef7, #2f6ae0); }
.ic-cont { background: linear-gradient(135deg, #8e8e93, #636366); }
.ic-set { background: linear-gradient(135deg, #55555e, #3a3a41); }
.ic-sos { background: linear-gradient(135deg, #ff453a, #c62828); }
.ic-notes { background: linear-gradient(135deg, #ffcf3f, #f5a623); }
.ic-pwd { background: linear-gradient(135deg, #34c1c9, #2b8f96); }
.p-dock { background: rgba(255, 255, 255, .07); margin: 0 14px 14px; border-radius: 24px; padding: 10px; display: flex; justify-content: space-around; }

/* Barre d'app */
.p-bar {
    flex: none; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: rgba(255, 255, 255, .04);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    min-height: 50px;
}
.p-bar b { font-size: 16px; flex: 1; text-align: center; }
.p-bar .p-back { background: none; border: none; color: #4f8ef7; cursor: pointer; display: flex; align-items: center; font-family: inherit; font-size: 14px; padding: 4px; }
.p-bar .p-back .ms { font-size: 22px; }
.p-body { flex: 1; overflow-y: auto; padding: 12px 14px; scrollbar-width: thin; }

/* Messages */
.p-conv { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; color: #fff; padding: 11px 6px; border-bottom: 1px solid rgba(255, 255, 255, .06); cursor: pointer; font-family: inherit; }
.p-conv .pp { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #5a5a64, #3c3c44); display: flex; align-items: center; justify-content: center; flex: none; }
.p-conv .pp .ms { font-size: 22px; color: #ddd; }
.p-conv b { display: block; font-size: 14.5px; }
.p-conv small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.p-conv .dot { width: 9px; height: 9px; border-radius: 50%; background: #4f8ef7; margin-left: auto; flex: none; }

.sms { max-width: 76%; padding: 9px 13px; border-radius: 18px; margin-bottom: 6px; font-size: 14.5px; line-height: 1.35; width: fit-content; word-break: break-word; }
.sms.me { background: linear-gradient(135deg, #34c759, #28a745); margin-left: auto; border-bottom-right-radius: 5px; }
.sms.them { background: #2c2c34; border-bottom-left-radius: 5px; }
.sms small { display: block; opacity: .6; font-size: 10.5px; margin-top: 3px; text-align: right; }

.p-input { flex: none; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .03); }
.p-input input, .p-input textarea { flex: 1; background: #1d1d23; border: 1px solid #34343e; border-radius: 999px; padding: 9px 15px; color: #fff; font-family: inherit; font-size: 14px; min-height: 0; }
.p-input textarea { border-radius: 16px; resize: none; }
.p-send { flex: none; width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--accent-grad); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; align-self: flex-end; }
.p-send .ms { font-size: 19px; }
.p-send:disabled { opacity: .4; }

/* AltaGram */
.g-post { border-bottom: 1px solid rgba(255, 255, 255, .07); padding: 12px 2px; }
.g-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.g-head img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #2c2c34; }
.g-head b { font-size: 14px; display: block; }
.g-head small { color: var(--muted); font-size: 11.5px; }
.g-text { font-size: 14.5px; white-space: pre-wrap; line-height: 1.4; }
.g-media { width: 100%; border-radius: 12px; margin-top: 8px; }
.g-like { background: none; border: none; color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 13.5px; padding: 6px 2px; }
.g-like .ms { font-size: 22px; transition: transform .12s; }
.g-like.liked .ms { color: #ff2d55; }
.g-like:active .ms { transform: scale(1.25); }
.g-compose { border-bottom: 1px solid rgba(255, 255, 255, .07); padding-bottom: 12px; margin-bottom: 6px; }
.g-compose textarea { width: 100%; background: #1d1d23; border: 1px solid #34343e; border-radius: 12px; padding: 10px 13px; color: #fff; font-size: 14px; min-height: 64px; }
.g-compose input { width: 100%; margin-top: 6px; background: #1d1d23; border: 1px solid #34343e; border-radius: 10px; padding: 8px 12px; color: #fff; font-size: 12.5px; }

/* Urgences / appel */
.sos-btns { display: flex; flex-direction: column; gap: 14px; padding: 10px 6px; }
.sos-btn {
    display: flex; align-items: center; gap: 14px; width: 100%;
    border: none; border-radius: 18px; padding: 18px; cursor: pointer;
    color: #fff; font-family: inherit; text-align: left;
    transition: transform .12s, filter .15s;
}
.sos-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.sos-btn .ms { font-size: 30px; }
.sos-btn b { font-size: 17px; display: block; }
.sos-btn small { opacity: .85; font-size: 12.5px; }
.sos-police { background: linear-gradient(135deg, #2f6ae0, #1e4db7); }
.sos-ems { background: linear-gradient(135deg, #e0342f, #b71c1c); }

.call-screen { display: flex; flex-direction: column; align-items: center; justify-content: space-between; flex: 1; padding: 46px 20px 40px; background: linear-gradient(180deg, #17233c, #101014); }
.call-screen.ems { background: linear-gradient(180deg, #3c1717, #101014); }
.call-top { text-align: center; }
.call-top .who { font-size: 24px; font-weight: 600; }
.call-top .state { color: rgba(255, 255, 255, .65); font-size: 14px; margin-top: 6px; }
.call-avatar {
    width: 96px; height: 96px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .1); position: relative;
}
.call-avatar .ms { font-size: 44px; }
.call-avatar::before, .call-avatar::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .25);
    animation: pulse 1.8s infinite;
}
.call-avatar::after { animation-delay: .9s; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.85); opacity: 0; } }
.call-hang { width: 64px; height: 64px; border-radius: 50%; border: none; background: #ff3b30; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(255, 59, 48, .4); }
.call-hang .ms { font-size: 30px; }
.call-form { width: 100%; }
.call-form label { color: rgba(255, 255, 255, .7); }

/* Réglages / listes iOS */
.p-cell { display: flex; align-items: center; gap: 12px; padding: 13px 8px; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 14.5px; }
.p-cell .ms { color: var(--muted); }
.p-cell small { color: var(--muted); display: block; font-size: 12px; }
.p-cell .right { margin-left: auto; color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 46px; height: 27px; margin-left: auto; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 2; }
.switch .tr { position: absolute; inset: 0; border-radius: 999px; background: #3a3a42; transition: background .18s; }
.switch .tr::after { content: ""; position: absolute; top: 2.5px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked + .tr { background: #34c759; }
.switch input:checked + .tr::after { transform: translateX(18px); }
.p-empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; }
.p-empty .ms { font-size: 40px; display: block; margin-bottom: 10px; opacity: .5; }

/* ---------- Champ d'upload (dropzone + aperçu) ---------- */
.filedrop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--border-hi); border-radius: 12px; padding: 18px 16px;
    background: var(--bg2); color: var(--muted); transition: border-color .15s, background .15s;
}
.filedrop:hover, .filedrop.over { border-color: var(--accent); background: rgba(255, 68, 68, .06); color: var(--text); }
.filedrop .ms { font-size: 30px; color: var(--accent2); }
.filedrop .fd-label { font-weight: 600; font-size: 14.5px; color: var(--text); }
.filedrop .fd-hint { font-size: 12px; }
.filedrop .fd-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.filedrop .fd-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.filedrop.has { padding: 12px; }
.fd-thumb { width: 62px; height: 62px; border-radius: 8px; overflow: hidden; background: var(--panel2); border: 1px solid var(--border); font-size: 10px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.fd-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Journal ---------- */
.jrn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jrn-img { width: 100%; border-radius: 12px; margin: 12px 0; object-fit: cover; }
.jrn-hero { max-height: 360px; }
.jrn-txt { white-space: pre-wrap; line-height: 1.6; }
.jrn-mag { column-count: 2; column-gap: 28px; }
.jrn-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.jrn-gal img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; }
.jrn-archive { opacity: .92; }
.jrn-archive:hover { opacity: 1; }
@media (max-width: 640px) { .jrn-mag { column-count: 1; } }

/* ---------- Stepper (progression carte d'identité) ---------- */
.stepper { display: flex; align-items: center; gap: 4px; margin: 4px 0 22px; flex-wrap: wrap; }
.stepper .step { display: flex; align-items: center; gap: 9px; }
.stepper .st-dot {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--panel2); border: 2px solid var(--border); color: var(--muted); font-weight: 700; font-size: 14px;
    transition: all .25s;
}
.stepper .st-dot .ms { font-size: 19px; }
.stepper .st-label { font-size: 13.5px; color: var(--muted); }
.stepper .step.done .st-dot { background: rgba(62, 207, 111, .16); border-color: var(--ok); color: var(--ok); }
.stepper .step.active .st-dot { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px rgba(255, 68, 68, .18); }
.stepper .step.active .st-label { color: var(--text); font-weight: 600; }
.stepper .st-line { width: 34px; height: 2px; background: var(--border); border-radius: 2px; }
.stepper .step.done + .st-line { background: var(--ok); }
@media (max-width: 640px) { .stepper .st-label { display: none; } .stepper .st-line { width: 16px; } }

/* ---------- Modales & notifications in-page ---------- */
.alta-modal-back {
    position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center;
    background: rgba(8, 6, 10, .7); backdrop-filter: blur(5px); padding: 16px;
    opacity: 0; transition: opacity .18s;
}
.alta-modal-back.on { opacity: 1; }
.alta-modal {
    width: 440px; max-width: 100%; background: var(--panel-solid); border: 1px solid var(--border);
    border-radius: 18px; padding: 24px; text-align: center; box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
    transform: translateY(14px) scale(.97); transition: transform .2s;
}
.alta-modal-back.on .alta-modal { transform: none; }
.alta-modal-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 68, 68, .14); border: 1px solid rgba(255, 68, 68, .3); }
.alta-modal-ic .ms { font-size: 30px; color: var(--accent2); }
.alta-modal h3 { margin: 0 0 8px; font-size: 20px; }
.alta-modal-body { color: var(--muted); font-size: 15px; line-height: 1.5; }
.alta-modal-body p { margin: 0 0 6px; }
.alta-modal-acts { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.alta-modal-acts .btn { margin-top: 0; }
.btn.danger { background: var(--accent); box-shadow: 0 4px 14px rgba(255, 68, 68, .3); }

#alta-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 650; display: flex; flex-direction: column; gap: 10px; }
.alta-toast {
    display: flex; align-items: center; gap: 10px; max-width: 340px;
    background: var(--panel-solid); border: 1px solid var(--border); border-left-width: 3px;
    border-radius: 12px; padding: 12px 15px; font-size: 14px; color: var(--text);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
    transform: translateX(120%); opacity: 0; transition: transform .3s, opacity .3s;
}
.alta-toast.on { transform: none; opacity: 1; }
.alta-toast .ms { font-size: 20px; }
.alta-toast.info { border-left-color: var(--info); } .alta-toast.info .ms { color: var(--info); }
.alta-toast.success { border-left-color: var(--ok); } .alta-toast.success .ms { color: var(--ok); }
.alta-toast.error { border-left-color: var(--accent); } .alta-toast.error .ms { color: var(--accent); }
@media (max-width: 520px) { #alta-toasts { left: 12px; right: 12px; } .alta-toast { max-width: none; } }

/* ---------- Mini-jeux RP illégal ---------- */
#mj-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(8, 6, 10, .82); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
#mj-overlay[hidden] { display: none; }
#mj-box {
    width: 480px; max-width: 100%; background: var(--panel-solid);
    border: 1px solid var(--border); border-radius: 18px; padding: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
#mj-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#mj-head b { font-size: 17px; }
.mj-progress-wrap { height: 8px; border-radius: 999px; background: var(--bg2); overflow: hidden; margin-bottom: 14px; }
#mj-progress { height: 100%; width: 0; background: var(--accent-grad); transition: width .2s; }
.mj-phase { font-size: 12.5px; font-weight: 700; letter-spacing: .3px; color: var(--accent2);
    text-transform: uppercase; text-align: center; margin-bottom: 2px; }
/* mode réduit : petite pastille en bas à droite */
#mj-overlay.mini { position: fixed; inset: auto 18px 18px auto; background: none; backdrop-filter: none; display: block; padding: 0; }
#mj-overlay.mini #mj-box { width: 250px; padding: 12px; }
#mj-overlay.mini #mj-zone, #mj-overlay.mini #mj-foot .btn.secondary { display: none; }
#mj-overlay.mini #mj-reduce .ms { transform: rotate(180deg); }
#mj-zone { min-height: 240px; display: flex; flex-direction: column; gap: 12px; }
#mj-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
#mj-score b { color: var(--accent2); }
.mj-hint { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 0; }
.mj-action { margin: 6px auto 0; }
/* champ de cueillette */
.mj-field { position: relative; height: 220px; border-radius: 14px; overflow: hidden;
    background: radial-gradient(circle at 30% 20%, #1c2e18, #0e1410); border: 1px solid var(--border); }
.mj-bud { position: absolute; width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transform: scale(0); animation: budIn .18s forwards; }
.mj-bud .ms { font-size: 24px; color: #fff; }
.mj-bud.ripe { background: radial-gradient(circle, #45d67a, #1f9d52); box-shadow: 0 0 14px rgba(62, 207, 111, .6); }
.mj-bud.unripe { background: radial-gradient(circle, #caa23e, #7c6620); }
@keyframes budIn { to { transform: scale(1); } }
/* barre de précision */
.mj-bar { position: relative; height: 46px; border-radius: 999px; background: var(--bg2);
    border: 1px solid var(--border); overflow: hidden; transition: box-shadow .16s; }
.mj-target { position: absolute; top: 0; bottom: 0; background: rgba(62, 207, 111, .3); border-left: 2px solid var(--ok); border-right: 2px solid var(--ok); }
.mj-cursor { position: absolute; top: 0; bottom: 0; width: 4px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.mj-danger { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,59,48,.25) 0 12px, transparent 12px 24px); }
/* pavé séquence */
.mj-pad { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mj-key { height: 92px; border-radius: 14px; border: 1px solid var(--border); cursor: pointer;
    background: var(--panel2); transition: transform .1s, box-shadow .12s, background .12s; }
.mj-key:nth-child(1){ background:#3a2140 } .mj-key:nth-child(2){ background:#213a3a }
.mj-key:nth-child(3){ background:#3a3021 } .mj-key:nth-child(4){ background:#21293a }
.mj-key.on { box-shadow: 0 0 0 3px var(--accent2), 0 0 22px var(--accent2); transform: scale(.97); filter: brightness(1.7); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .topbar { padding: 8px 12px; }
    .brand span { display: none; }
    .userbtn .pseudo { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .container { padding: 20px 12px 56px; }
    .grid { grid-template-columns: 1fr 1fr; }
    .cni { width: 100%; }
    .cni .photo { width: 80px; height: 98px; }
    table.list { display: block; overflow-x: auto; }
    .phone { height: calc(100vh - 150px); border-radius: 30px; }
    h1.page { font-size: 25px; }
}
@media (max-width: 400px) {
    .grid { grid-template-columns: 1fr; }
}
