/* =========================================================================
   FREECOM WIFI — pages de connexion / inscription : « le ticket Wi-Fi »
   Une scène nocturne (réseau de zones qui émettent) et une carte en forme
   de ticket : talon de marque, ligne de découpe, talon « Créer mon espace ».
   ========================================================================= */
body.guest {
  --night: #081226; --navy: #0B1730; --blue: #2B5BA8; --green: #8CC63F; --green-d: #6aa62a;
  --paper: #fffdf7; --ink: #0B1730; --ink-2: #4a5568; --rule: #e7e3d6;
  --cut: 98px; --stub: 84px; --hole: 13px;
  margin: 0; padding: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink);
  background:
    radial-gradient(70% 60% at 22% 18%, rgba(43, 91, 168, .55), transparent 70%),
    radial-gradient(50% 50% at 88% 92%, rgba(140, 198, 63, .22), transparent 70%),
    linear-gradient(165deg, #0d1d40 0%, var(--night) 60%, #050b18 100%) fixed;
  overflow-x: hidden;
}
/* Grain léger */
body.guest::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Carte du réseau ---------- */
.net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.net-links path { fill: none; stroke: rgba(140, 170, 230, .16); stroke-width: 1.2; }
.net-flow path { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 26; opacity: .55; animation: netFlow 3.2s linear infinite; }
.net-flow path:nth-child(2) { animation-duration: 4.4s; animation-direction: reverse; }
.net-flow path:nth-child(3) { animation-duration: 5.6s; stroke: #7fb2ff; }
@keyframes netFlow { to { stroke-dashoffset: -280; } }
.net-nodes .core { fill: var(--green); filter: drop-shadow(0 0 6px rgba(140, 198, 63, .9)); }
.net-nodes .ring { fill: none; stroke: var(--green); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: 0; animation: netPing 3.6s ease-out infinite; animation-delay: var(--d); }
@keyframes netPing { 0% { transform: scale(.25); opacity: .9; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---------- Mise en page ---------- */
.auth {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: clamp(32px, 6vw, 110px);
  max-width: 1240px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 64px);
}

/* ---------- Accroche ---------- */
.auth-hero { color: #fff; max-width: 560px; animation: authUp .7s cubic-bezier(.2, .8, .2, 1) both; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 600 .78rem 'JetBrains Mono', monospace; letter-spacing: .2em; text-transform: uppercase; color: var(--green); }
.auth-live { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: authPulse 2s infinite; }
@keyframes authPulse { 0% { box-shadow: 0 0 0 0 rgba(140, 198, 63, .6); } 70% { box-shadow: 0 0 0 10px rgba(140, 198, 63, 0); } 100% { box-shadow: 0 0 0 0 rgba(140, 198, 63, 0); } }
.auth-hero h2 { margin: 0; font: 800 clamp(2.4rem, 4.6vw, 4.1rem)/1.0 var(--f-display); letter-spacing: -.035em; color: #fff; }
.auth-hero h2 em { font-style: normal; color: var(--green); }
.auth-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin: 38px 0 0; padding: 0; }
.auth-chips li {
  display: grid; justify-items: center; gap: 10px; width: 112px; padding: 18px 10px 14px; border-radius: 20px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(8px);
  font: 700 .9rem var(--f-display); color: #dbe5f7; animation: authUp .6s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-chips li:nth-child(2) { animation-delay: .1s; } .auth-chips li:nth-child(3) { animation-delay: .2s; }
.auth-chips .ti { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; font-size: 30px; color: var(--night); background: var(--green); box-shadow: 0 10px 24px -10px rgba(140, 198, 63, .8); }
.auth-chips li:nth-child(2) .ti { background: #7fb2ff; box-shadow: 0 10px 24px -10px rgba(127, 178, 255, .8); }
.auth-chips li:nth-child(3) .ti { background: #ffc94d; box-shadow: 0 10px 24px -10px rgba(255, 201, 77, .8); }
@keyframes authUp { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Le ticket ---------- */
.auth-main { display: grid; justify-items: center; gap: 16px; }
.tkt { width: 430px; max-width: 100%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)) drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); animation: tktIn .8s cubic-bezier(.2, .8, .2, 1) both .1s; }
.tkt.is-wide { width: 580px; }
@keyframes tktIn { from { opacity: 0; transform: translateY(-26px) rotate(-1.5deg); } }
.auth-card {
  position: relative; background: var(--paper); border-radius: 22px; overflow: hidden;
  /* Encoches de découpe de chaque côté, sous le talon */
  -webkit-mask: radial-gradient(circle var(--hole) at 0 var(--cut), #0000 98%, #000) , radial-gradient(circle var(--hole) at 100% var(--cut), #0000 98%, #000);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle var(--hole) at 0 var(--cut), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% var(--cut), #0000 98%, #000);
  mask-composite: intersect;
}
/* Ticket avec talon bas : 2 encoches de plus */
.auth-card:has(.auth-stub) {
  -webkit-mask:
    radial-gradient(circle var(--hole) at 0 var(--cut), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% var(--cut), #0000 98%, #000),
    radial-gradient(circle var(--hole) at 0 calc(100% - var(--stub)), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% calc(100% - var(--stub)), #0000 98%, #000);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle var(--hole) at 0 var(--cut), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% var(--cut), #0000 98%, #000),
    radial-gradient(circle var(--hole) at 0 calc(100% - var(--stub)), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% calc(100% - var(--stub)), #0000 98%, #000);
  mask-composite: intersect;
}

/* Talon de marque */
.tkt-top {
  position: relative; height: var(--cut); box-sizing: border-box; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  align-content: center; column-gap: 14px; padding: 0 30px; text-decoration: none !important; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #1f4b94 0%, var(--navy) 60%);
}
.tkt-top::before { content: ""; position: absolute; inset: 0; opacity: .35; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 20px); }
.tkt-top::after { content: ""; position: absolute; left: var(--hole); right: var(--hole); bottom: -1px; border-bottom: 2px dashed rgba(11, 23, 48, .25); }
.tkt-top img { grid-row: 1 / 3; width: 50px; height: auto; position: relative; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.tkt-brand { position: relative; font: 800 1.35rem/1.1 var(--f-display); letter-spacing: .06em; }
.tkt-brand b { color: var(--green); }
.tkt-tag { position: relative; display: inline-flex; align-items: center; gap: 6px; font: 600 .7rem 'JetBrains Mono', monospace; letter-spacing: .16em; text-transform: uppercase; color: #9fb4dc; }
.tkt-tag .ti { font-size: 14px; color: var(--green); }

/* Corps */
.tkt-body { display: grid; gap: 18px; padding: 30px 30px 28px; }
.auth-head { text-align: left; }
.auth-head h1 { margin: 0; font: 800 1.85rem/1.1 var(--f-display); letter-spacing: -.025em; color: var(--ink); }
.auth-head p { margin: 6px 0 0; color: var(--ink-2); font-size: .95rem; }
.auth-form { display: grid; gap: 16px; }
.auth-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.auth-field { display: grid; gap: 7px; align-content: start; }
.auth-field > span:first-child, .auth-field > label { font-size: .82rem; font-weight: 700; color: #3b4658; }
.auth-field small { color: #8a93a3; font-size: .76rem; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > .ti { position: absolute; left: 16px; font-size: 21px; color: #9aa3b2; pointer-events: none; transition: color .15s; z-index: 1; }
.auth-input input, .auth-input select, .auth-select {
  width: 100%; height: 56px; padding: 0 50px 0 50px; border-radius: 16px; border: 2px solid var(--rule); background: #fff; color: var(--ink);
  font: 600 16px var(--f-body); transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.auth-input select, .auth-select { padding-right: 14px; appearance: auto; }
.auth-input input::placeholder { color: #b3b9c4; font-weight: 500; }
.auth-input input:focus, .auth-input select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(43, 91, 168, .15); }
.auth-input:focus-within > .ti { color: var(--blue); }
.auth-eye { position: absolute; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #9aa3b2; cursor: pointer; display: grid; place-items: center; }
.auth-eye:hover { background: #f1efe6; color: var(--blue); }
.auth-eye .ti { font-size: 21px; }
.auth-forgot { justify-self: end; margin-top: -6px; display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; font-weight: 700; color: var(--blue); }
.auth-forgot .ti { font-size: 16px; }
.auth-submit {
  height: 58px; border: 0; border-radius: 16px; margin-top: 2px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 800 1.08rem var(--f-display); letter-spacing: .01em; color: #fff;
  background: linear-gradient(135deg, var(--blue), #1c3f7c); box-shadow: 0 14px 26px -14px rgba(43, 91, 168, .9);
  transition: transform .15s, filter .15s, box-shadow .15s;
}
.auth-submit.is-green { color: var(--night); background: linear-gradient(135deg, #9fd34f, var(--green-d)); box-shadow: 0 14px 28px -14px rgba(106, 166, 42, .95), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.auth-submit:hover { transform: translateY(-2px); filter: brightness(1.05); border: 0; color: inherit; }
.auth-submit.is-green:hover { color: var(--night); }
.auth-submit:not(.is-green):hover { color: #fff; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit .ti { font-size: 22px; transition: transform .2s; }
.auth-submit:hover .ti { transform: translateX(4px); }
.auth-sep { display: flex; align-items: center; gap: 12px; color: #9aa3b2; font-size: .8rem; font-weight: 600; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.auth-alt { height: 54px; border-radius: 16px; border: 2px solid #d9ecc0; background: #f4fae9; color: #3f6f14; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.auth-alt:hover { background: var(--green); border-color: var(--green); color: var(--night); }
.auth-alt.is-blue { border-color: #d3def2; background: #f2f6fd; color: #1c3f7c; }
.auth-alt.is-blue:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.auth-card .flash { box-shadow: none; margin: 0; }
.auth-card .demo-box { max-width: none; margin: 0; background: #f6f4ec; border-color: var(--rule); font-size: .8rem; }

/* Talon bas « Créer mon espace » (se détache du ticket) */
.auth-stub {
  position: relative; height: var(--stub); box-sizing: border-box; margin: 4px -30px -28px; padding: 0 30px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  background: #f3f8e9; color: #2f5410; text-decoration: none !important; transition: background .2s;
}
.auth-stub::before { content: ""; position: absolute; top: 0; left: var(--hole); right: var(--hole); border-top: 2px dashed #cfd8bd; }
.auth-stub > .ti:first-child { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-size: 24px; background: var(--green); color: var(--night); }
.auth-stub span { display: grid; line-height: 1.2; }
.auth-stub b { font: 800 1.05rem var(--f-display); color: var(--ink); }
.auth-stub small { font-size: .84rem; color: #4d7a1f; font-weight: 600; }
.auth-stub > .ti:last-child { font-size: 22px; color: #6aa62a; transition: transform .2s; }
.auth-stub:hover { background: #e9f4d6; }
.auth-stub:hover > .ti:last-child { transform: translateX(4px); }

.auth-foot { margin: 0; display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #8193b8; }

/* ---------- Tablette / mobile : le ticket seul, plein écran ---------- */
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 0; padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); }
  .auth-hero { display: none; }
  .auth-main { justify-items: stretch; }
  .tkt, .tkt.is-wide { width: 100%; max-width: 480px; justify-self: center; }
  .auth-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  body.guest { --cut: 86px; --stub: 78px; }
  .tkt-top { padding: 0 22px; column-gap: 12px; }
  .tkt-top img { width: 42px; }
  .tkt-brand { font-size: 1.15rem; }
  .tkt-body { padding: 24px 20px 22px; gap: 16px; }
  .auth-stub { margin: 2px -20px -22px; padding: 0 20px; }
  .auth-head h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .net-flow path, .net-nodes .ring, .auth-live, .tkt, .auth-hero, .auth-chips li { animation: none !important; }
}
.auth-hero .nw { white-space: nowrap; }
.auth:has(.tkt.is-wide) .auth-hero h2 { font-size: clamp(2rem, 3.6vw, 3.3rem); }
