/* =========================================================
   TERRA NOVA — Mode hors connexion (bandeau, actions indisponibles, page /mode-hors-ligne)
   ========================================================= */

/* ---------- Bandeau réseau ---------- */
.tn-net { position: fixed; z-index: 95; left: 50%; top: calc(var(--hh, 76px) + .7rem); width: min(46rem, calc(100% - 1.5rem)); display: flex; align-items: center; gap: .85rem; padding: .7rem .8rem .7rem .75rem; border-radius: 16px; color: #eef1ff; background: rgba(8, 11, 24, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .1); transform: translate(-50%, -14px); opacity: 0; transition: transform .45s cubic-bezier(.2, 1.3, .4, 1), opacity .3s }
.tn-net.is-in { transform: translate(-50%, 0); opacity: 1 }
.tn-net::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 16px 0 0 16px; background: var(--net, #ffb020) }
.tn-net--off { --net: #ffb020 }
.tn-net--on { --net: #34d399 }
.tn-net-ico { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; color: var(--net); background: color-mix(in srgb, var(--net) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--net) 45%, transparent) }
.tn-net--off .tn-net-ico svg { animation: tn-net-float 2.6s ease-in-out infinite }
.tn-net-txt { flex: 1; min-width: 0; display: grid; gap: .1rem; line-height: 1.35 }
.tn-net-txt b { font: 700 .92rem var(--tech, inherit); letter-spacing: .04em; color: #fff }
.tn-net-txt span { font-size: .82rem; color: #b9bed6 }
.tn-net-act { flex: none; display: flex; gap: .45rem; flex-wrap: wrap; justify-content: flex-end }
.tn-net-btn { display: inline-flex; align-items: center; padding: .42rem .85rem; border: 0; border-radius: 999px; cursor: pointer; font: 700 .78rem var(--tech, inherit); letter-spacing: .03em; text-decoration: none; color: #1a1200; background: var(--net) }
.tn-net-btn--ghost { color: #eef1ff; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18) }
.tn-net-btn:hover, .tn-net-btn:focus-visible { filter: brightness(1.1) }
.tn-net-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px }
.tn-net.is-shake { animation: tn-net-shake .45s ease }
@keyframes tn-net-float { 50% { transform: translateY(-2px) } }
@keyframes tn-net-shake { 20%, 60% { margin-left: -6px } 40%, 80% { margin-left: 6px } }
@media (max-width: 640px) { .tn-net { flex-wrap: wrap; top: auto; bottom: .8rem; transform: translate(-50%, 14px) } .tn-net.is-in { transform: translate(-50%, 0) } .tn-net-act { width: 100%; justify-content: stretch } .tn-net-btn { flex: 1; justify-content: center } }
html[data-theme=light] .tn-net { color: #1d1b2c; background: rgba(255, 255, 255, .96); box-shadow: 0 18px 40px -16px rgba(29, 27, 44, .45), inset 0 0 0 1px rgba(29, 27, 44, .1) }
html[data-theme=light] .tn-net-txt b { color: #1d1b2c } html[data-theme=light] .tn-net-txt span { color: #4a4c60 }
html[data-theme=light] .tn-net-btn--ghost { color: #1d1b2c; background: rgba(29, 27, 44, .05); box-shadow: inset 0 0 0 1px rgba(29, 27, 44, .15) }
html[data-theme=light] .tn-net--off { --net: #c77700 } html[data-theme=light] .tn-net--on { --net: #059669 }
html[data-theme=light] .tn-net-btn { color: #fff }

/* ---------- Hors connexion : actions indisponibles ---------- */
html.tn-offline form [data-tn-off] { opacity: .45; cursor: not-allowed; filter: grayscale(.6) }
html.tn-offline .ai-fab { filter: grayscale(1); opacity: .55 }
html.tn-offline .ai-panel .ai-form { opacity: .5; pointer-events: none }
html.tn-offline .tn-start { display: none }

/* ---------- Page /mode-hors-ligne ---------- */
.off-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.2rem; align-items: stretch }
.off-state { position: relative; display: grid; gap: .9rem; padding: 1.4rem; overflow: hidden }
.off-state::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 18rem; height: 18rem; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--st, #34d399) 30%, transparent), transparent 70%); pointer-events: none }
.off-state.is-on { --st: #34d399 } .off-state.is-off { --st: #ffb020 }
.off-pill { display: inline-flex; align-items: center; gap: .55rem; width: fit-content; padding: .35rem .85rem .35rem .6rem; border-radius: 999px; font: 700 .82rem var(--tech, inherit); letter-spacing: .08em; text-transform: uppercase; color: var(--st); background: color-mix(in srgb, var(--st) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 50%, transparent) }
.off-pill::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 0 var(--st); animation: off-pulse 1.8s ease-out infinite }
@keyframes off-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st) 70%, transparent) } 70%, 100% { box-shadow: 0 0 0 9px transparent } }
.off-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem }
.off-fig { padding: .8rem .9rem; border-radius: 12px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line) }
.off-fig b { display: block; font: 700 1.05rem var(--tech, inherit); color: var(--ink) }
.off-fig small { color: var(--mute); font-size: .78rem }
.off-acts { display: flex; flex-wrap: wrap; gap: .5rem }
.off-app { display: grid; gap: .8rem; align-content: start; padding: 1.4rem; text-align: center; place-items: center }
.off-app img { width: 5.5rem; height: 5.5rem; border-radius: 22px; box-shadow: 0 16px 40px -12px rgba(255, 45, 122, .55), 0 0 0 1px rgba(255, 255, 255, .12) }
.off-app p { margin: 0; color: var(--mute); font-size: .9rem }
.off-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin-top: 1.2rem }
.off-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .35rem; max-height: 24rem; overflow: auto }
.off-list a { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px; text-decoration: none; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s }
.off-list a:hover, .off-list a:focus-visible { box-shadow: inset 0 0 0 1px var(--cyan); transform: translateX(2px) }
.off-list b { flex: 1; font-weight: 600 }
.off-list small { color: var(--mute); font-size: .78rem }
.off-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399 }
.off-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem }
.off-cols ul { margin: .4rem 0 0; padding-inline-start: 1.1rem; display: grid; gap: .35rem; font-size: .9rem }
.off-yes h3 { color: #34d399 } .off-no h3 { color: #ffb020 }
.off-steps { counter-reset: s; list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .6rem }
.off-steps li { counter-increment: s; position: relative; padding: .7rem .8rem .7rem 3rem; border-radius: 12px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); font-size: .92rem }
.off-steps li::before { content: counter(s); position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font: 700 .85rem var(--tech, inherit); color: #05060c; background: linear-gradient(135deg, #3fd6ff, #ff2d7a) }
[dir=rtl] .off-steps li { padding: .7rem 3rem .7rem .8rem } [dir=rtl] .off-steps li::before { left: auto; right: .75rem }
@media (max-width: 860px) { .off-hero, .off-grid, .off-cols { grid-template-columns: 1fr } .off-figs { grid-template-columns: 1fr 1fr } }
html[data-theme=light] .off-fig, html[data-theme=light] .off-list a, html[data-theme=light] .off-steps li { background: var(--ink-soft) }
@media (prefers-reduced-motion: reduce) { .tn-net, .tn-net-ico svg, .off-pill::before { animation: none; transition: none } }
@media print { .tn-net { display: none } }
.tn-off-note { display: flex; align-items: center; gap: .45rem; margin: .5rem 0 0; padding: .45rem .7rem; border-radius: 10px; font-size: .82rem; color: #ffcf73; background: rgba(255, 176, 32, .1); box-shadow: inset 0 0 0 1px rgba(255, 176, 32, .35) }
.tn-off-note::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: #ffb020 }
html[data-theme=light] .tn-off-note { color: #8a5300; background: rgba(199, 119, 0, .08) }
