/* Transitions natives entre pages (API View Transitions, navigation
   cross-document) — le contenu s'estompe en douceur et la barre d'onglets
   reste stable, comme une vraie app. Safari 18+/WKWebView récent, Chrome 126+. */
@view-transition { navigation: auto; }

:root {
    --noir: #07060f;
    --surface: #12111f;
    --surface-2: #1a1830;
    --ligne: rgba(255, 255, 255, .1);
    --cyan: #22d3ee;
    --violet: #a855f7;
    --degrade: linear-gradient(135deg, var(--cyan), var(--violet));
    --texte: #f1f0fa;
    --texte-att: #8886a8;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.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; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: var(--noir);
    background-image:
        radial-gradient(60% 40% at 15% 0%, rgba(168, 85, 247, .16), transparent),
        radial-gradient(50% 35% at 100% 15%, rgba(34, 211, 238, .12), transparent);
    background-attachment: fixed;
    color: var(--texte);
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-font-smoothing: antialiased;
}

.ecran { padding: 20px 20px 40px; max-width: 480px; margin: 0 auto; }
.ecran.avec-onglets { padding-bottom: 100px; }

.marque { font-size: 20px; font-weight: 900; letter-spacing: -.02em; background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }

.entete { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.entete h1 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.retour { background: none; border: none; color: var(--texte); font-size: 22px; padding: 4px 6px 4px 0; cursor: pointer; }
.icone-btn { background: var(--surface); border: 1px solid var(--ligne); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.icone-btn svg { width: 18px; height: 18px; stroke: var(--texte); fill: none; stroke-width: 1.8; }
.icone-btn .pastille { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }

.bouton {
    display: block; width: 100%; background: var(--degrade); color: #050308; border: none;
    padding: 16px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    border-radius: 99px; cursor: pointer; margin-top: 8px; font-family: inherit;
}
.bouton:active { opacity: .85; }
.bouton-secondaire { background: var(--surface); color: var(--texte); border: 1px solid var(--ligne); }
.bouton-erreur { color: #ff6b8a; font-size: 13px; margin-top: 12px; min-height: 16px; }

.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-att); margin-bottom: 7px; }
.champ input, .champ textarea {
    width: 100%; background: var(--surface); border: 1px solid var(--ligne); color: var(--texte);
    padding: 14px 15px; font-size: 15px; border-radius: 12px; font-family: inherit;
}
.champ input:focus, .champ textarea:focus { outline: none; border-color: var(--cyan); }

.lien-discret { display: block; text-align: center; color: var(--texte-att); font-size: 13px; margin-top: 14px; text-decoration: none; }

/* ── Onboarding ─────────────────────────────────────────────────────────── */
.onboard-visuel {
    height: 320px; border-radius: 24px; margin-bottom: 26px; position: relative; overflow: hidden;
    background:
        radial-gradient(60% 60% at 30% 20%, rgba(168, 85, 247, .5), transparent),
        radial-gradient(55% 55% at 80% 70%, rgba(34, 211, 238, .45), transparent),
        var(--surface);
    border: 1px solid var(--ligne);
    display: flex; align-items: flex-end; padding: 22px;
}
.onboard-visuel h1 { font-size: 27px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.point-progression { display: flex; justify-content: center; gap: 6px; margin: 18px 0 26px; }
.point-progression span { width: 7px; height: 7px; border-radius: 50%; background: var(--ligne); }
.point-progression span.actif { background: var(--cyan); width: 22px; border-radius: 4px; }

/* ── Pastille de navigation flottante (bas) ────────────────────────────────
   Une capsule posée au-dessus du bord plutôt qu'une barre pleine largeur —
   esprit appli sociale récente, et une silhouette différente des barres
   pleine largeur des trois autres démos. */
.onglets {
    position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20;
    transform: translateX(-50%);
    display: flex; gap: 2px;
    background: rgba(18, 17, 31, .82); backdrop-filter: blur(18px);
    border: 1px solid var(--ligne); border-radius: 999px;
    padding: 7px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
    view-transition-name: barre-onglets;
}
.onglet { display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--texte-att); cursor: pointer; position: relative; width: 46px; height: 46px; border-radius: 50%; transition: background .2s, color .2s; }
.onglet svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.onglet.actif { color: #050308; background: var(--degrade); }
.onglet .pastille { position: absolute; top: 5px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); border: 2px solid #12111f; }

/* ── Avatar ─────────────────────────────────────────────────────────────── */
.avatar { width: 74px; height: 74px; border-radius: 50%; background: var(--degrade); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: #050308; margin: 0 auto 14px; }
.avatar-petit { width: 46px; height: 46px; font-size: 16px; flex-shrink: 0; }
.avatar-mini { width: 34px; height: 34px; font-size: 12px; flex-shrink: 0; }
.anneau-actif { position: relative; }
.anneau-actif::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--cyan); }
.profil-nom { text-align: center; font-size: 19px; font-weight: 800; }
.profil-sous { text-align: center; font-size: 13px; color: var(--texte-att); margin-bottom: 20px; }

.stats-rangee { display: flex; justify-content: center; gap: 28px; margin-bottom: 24px; }
.stat-item { text-align: center; }
.stat-valeur { font-size: 18px; font-weight: 800; }
.stat-label { font-size: 11px; color: var(--texte-att); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ── Feed ───────────────────────────────────────────────────────────────── */
.stories-rangee { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 24px; scrollbar-width: none; }
.stories-rangee::-webkit-scrollbar { display: none; }
.story-item { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.story-item span { font-size: 11px; color: var(--texte-att); }

.carte-post { background: var(--surface); border: 1px solid var(--ligne); border-radius: 20px; padding: 16px; margin-bottom: 16px; }
.post-entete { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-auteur { font-size: 14px; font-weight: 700; }
.post-moment { font-size: 12px; color: var(--texte-att); }
.post-texte { font-size: 14px; line-height: 1.6; color: #e4e2f5; margin-bottom: 12px; }
.post-visuel { height: 180px; border-radius: 14px; margin-bottom: 12px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.post-visuel::after { content: attr(data-lettre); font-size: 56px; font-weight: 900; color: rgba(255,255,255,.14); }
.post-actions { display: flex; gap: 20px; }
.post-action { display: flex; align-items: center; gap: 6px; color: var(--texte-att); font-size: 12.5px; font-weight: 600; }
.post-action svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.post-action.actif { color: var(--cyan); }
.post-action.actif svg { fill: var(--cyan); stroke: var(--cyan); }

/* ── Messages ───────────────────────────────────────────────────────────── */
.carte-conversation { display: flex; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--ligne); cursor: pointer; }
.carte-conversation:last-child { border-bottom: none; }
.conversation-corps { flex: 1; min-width: 0; }
.conversation-nom { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.conversation-apercu { font-size: 12.5px; color: var(--texte-att); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; max-width: 220px; }
.conversation-meta { text-align: right; flex-shrink: 0; }
.conversation-heure { font-size: 11px; color: var(--texte-att); }
.badge-ia { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 99px; background: var(--degrade); color: #050308; }

.fil-messages { display: flex; flex-direction: column; gap: 10px; padding-bottom: 84px; }
.bulle { max-width: 78%; padding: 11px 15px; border-radius: 18px; font-size: 14px; line-height: 1.5; }
.bulle-recue { align-self: flex-start; background: var(--surface); border: 1px solid var(--ligne); border-bottom-left-radius: 4px; }
.bulle-envoyee { align-self: flex-end; background: var(--degrade); color: #050308; font-weight: 500; border-bottom-right-radius: 4px; }
.bulle-ia { align-self: flex-start; background: linear-gradient(135deg, rgba(34,211,238,.14), rgba(168,85,247,.14)); border: 1px solid rgba(168,85,247,.35); border-bottom-left-radius: 4px; }

.barre-saisie { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(18,17,31,.9); backdrop-filter: blur(14px); border-top: 1px solid var(--ligne); }
.barre-saisie input { flex: 1; background: var(--surface-2); border: 1px solid var(--ligne); color: var(--texte); padding: 11px 15px; border-radius: 99px; font-size: 14px; font-family: inherit; }
.barre-saisie input:focus { outline: none; border-color: var(--cyan); }
.barre-saisie button { background: var(--degrade); color: #050308; border: none; width: 42px; height: 42px; border-radius: 50%; font-size: 16px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.barre-saisie button svg { width: 18px; height: 18px; }
.barre-saisie .icone-appel { background: var(--surface-2); }
.barre-saisie .icone-appel svg { stroke: var(--texte); }

.entete-conversation { display: flex; align-items: center; gap: 12px; }
.entete-conversation-infos { flex: 1; }
.entete-conversation-nom { font-size: 15px; font-weight: 800; }
.entete-conversation-statut { font-size: 11.5px; color: var(--texte-att); }
.entete-conversation-statut.en-ligne { color: #4ade80; }
.entete-actions { display: flex; gap: 8px; }

.frappe-ia { display: flex; gap: 4px; padding: 12px 15px; }
.frappe-ia span { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); animation: frappe 1.2s infinite ease-in-out; }
.frappe-ia span:nth-child(2) { animation-delay: .15s; }
.frappe-ia span:nth-child(3) { animation-delay: .3s; }
@keyframes frappe { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ── Appels ─────────────────────────────────────────────────────────────── */
.ecran-appel { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 60px 24px 50px; text-align: center; position: relative; overflow: hidden; }
.ecran-appel::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(70% 50% at 50% 0%, rgba(168,85,247,.28), transparent), radial-gradient(60% 40% at 50% 100%, rgba(34,211,238,.2), transparent);
}
.appel-avatar { width: 140px; height: 140px; border-radius: 50%; background: var(--degrade); display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 900; color: #050308; position: relative; z-index: 1; box-shadow: 0 0 60px rgba(168,85,247,.4); }
.appel-nom { font-size: 24px; font-weight: 800; margin-top: 20px; position: relative; z-index: 1; }
.appel-statut { font-size: 14px; color: var(--texte-att); margin-top: 6px; position: relative; z-index: 1; }
.appel-statut.chrono { font-variant-numeric: tabular-nums; color: var(--cyan); }
.appel-controles { display: flex; gap: 20px; position: relative; z-index: 1; }
.appel-btn { width: 60px; height: 60px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.appel-btn svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 2; }
.appel-btn.raccrocher { background: #ef4444; }
.appel-btn.raccrocher svg { transform: rotate(135deg); }
.appel-btn.decrocher { background: #22c55e; }
.appel-btn.secondaire { background: var(--surface); border: 1px solid var(--ligne); }
.appel-btn.secondaire.actif { background: var(--degrade); }
.appel-btn.secondaire.actif svg { stroke: #050308; }
.appel-controles-rangee { display: flex; flex-direction: column; gap: 30px; align-items: center; position: relative; z-index: 1; }
.appel-sous-controles { display: flex; gap: 24px; }

.video-pip { position: absolute; top: 70px; right: 24px; width: 90px; height: 130px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--ligne); z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: var(--texte-att); }

/* ── Assistant IA ───────────────────────────────────────────────────────── */
.ia-intro { text-align: center; padding: 20px 10px 28px; }
.ia-intro .avatar { width: 64px; height: 64px; font-size: 22px; box-shadow: 0 0 40px rgba(168,85,247,.4); }
.ia-intro h2 { font-size: 17px; font-weight: 800; margin: 12px 0 6px; }
.ia-intro p { font-size: 13px; color: var(--texte-att); max-width: 280px; margin: 0 auto; line-height: 1.6; }
.ia-suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.ia-suggestion { background: var(--surface); border: 1px solid var(--ligne); border-radius: 12px; padding: 12px 14px; font-size: 13px; text-align: left; color: var(--texte); cursor: pointer; }

/* ── Découvrir ──────────────────────────────────────────────────────────── */
.filtres { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 2px; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.puce-filtre { flex-shrink: 0; font-size: 12.5px; font-weight: 700; background: var(--surface); border: 1px solid var(--ligne); color: var(--texte-att); padding: 9px 16px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.puce-filtre.actif { background: var(--degrade); border-color: transparent; color: #050308; }

.carte-suggestion { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.suggestion-corps { flex: 1; }
.suggestion-nom { font-size: 14px; font-weight: 700; }
.suggestion-sous { font-size: 12px; color: var(--texte-att); margin-top: 2px; }
.btn-suivre { background: var(--surface-2); border: 1px solid var(--ligne); color: var(--texte); font-size: 12px; font-weight: 700; padding: 8px 16px; border-radius: 99px; cursor: pointer; }
.btn-suivre.suivi { background: var(--degrade); border-color: transparent; color: #050308; }

/* ── Découvrir : pile de cartes à glisser ────────────────────────────────── */
.pile-cartes { position: relative; height: 62vh; max-height: 480px; margin-bottom: 22px; }
.carte-swipe {
    position: absolute; inset: 0; border-radius: 24px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--ligne);
    display: flex; flex-direction: column; justify-content: flex-end;
    touch-action: pan-y; cursor: grab; will-change: transform;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s;
}
.carte-swipe:active { cursor: grabbing; }
.carte-swipe-fond {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.carte-swipe-fond::after { content: attr(data-lettre); font-size: 120px; font-weight: 900; color: rgba(255,255,255,.16); }
.carte-swipe-degrade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,6,15,.92) 10%, transparent 60%); }
.carte-swipe-info { position: relative; z-index: 1; padding: 22px; }
.carte-swipe-nom { font-size: 21px; font-weight: 800; }
.carte-swipe-sous { font-size: 13px; color: #d8d6ea; margin-top: 4px; }
.carte-swipe-etiquette {
    position: absolute; top: 26px; padding: 7px 16px; border: 3px solid; border-radius: 8px;
    font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
    opacity: 0; transform: rotate(-18deg);
}
.carte-swipe-etiquette.suivre { left: 22px; color: var(--cyan); border-color: var(--cyan); }
.carte-swipe-etiquette.passer { right: 22px; color: #f472b6; border-color: #f472b6; transform: rotate(18deg); }

.swipe-actions { display: flex; justify-content: center; gap: 26px; }
.swipe-btn { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); border: 1px solid var(--ligne); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.swipe-btn svg { width: 24px; height: 24px; stroke: var(--texte); fill: none; stroke-width: 1.8; }
.swipe-btn.suivre { background: var(--degrade); border-color: transparent; }
.swipe-btn.suivre svg { stroke: #050308; }
.swipe-btn.passer svg { stroke: #f472b6; }

.pile-vide { display: flex; align-items: center; justify-content: center; height: 100%; text-align: center; color: var(--texte-att); font-size: 14px; padding: 0 30px; }

/* ── Paramètres / options ──────────────────────────────────────────────── */
.ligne-option { display: flex; justify-content: space-between; align-items: center; padding: 15px 2px; border-bottom: 1px solid var(--ligne); cursor: pointer; }
.ligne-option:last-child { border-bottom: none; }
.ligne-option-titre { font-size: 14.5px; font-weight: 600; }
.ligne-option-sous { font-size: 12px; color: var(--texte-att); margin-top: 2px; }
.interrupteur { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.interrupteur input { opacity: 0; width: 0; height: 0; }
.interrupteur-piste { position: absolute; inset: 0; background: var(--ligne); border-radius: 99px; transition: background .15s; cursor: pointer; }
.interrupteur-piste::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.interrupteur input:checked + .interrupteur-piste { background: var(--degrade); }
.interrupteur input:checked + .interrupteur-piste::before { transform: translateX(18px); }

.vide, .chargement { text-align: center; color: var(--texte-att); font-size: 14px; padding: 40px 0; }

.grille-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 20px; }
.mini-post { aspect-ratio: 1; border-radius: 4px; position: relative; display: flex; align-items: center; justify-content: center; }
.mini-post::after { content: attr(data-lettre); font-size: 22px; font-weight: 900; color: rgba(255,255,255,.18); }
