/* Login / sign-up / password pages. Split screen: a live neural visual and a glass form card. */

.auth { min-height: 100vh; overflow-x: clip; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100dvh; }
.glass { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }

/* ---------- Visual side ---------- */
.visual { position: relative; order: 2; display: grid; align-content: end; padding: 48px; overflow: hidden; isolation: isolate; border-inline-start: 1px solid var(--border);
  background: radial-gradient(120% 80% at 50% 20%, #0c1a14 0%, var(--bg) 70%); }
[data-theme="light"] .visual { background: radial-gradient(120% 80% at 50% 20%, #e6f6ee 0%, var(--bg) 70%); }
.net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.aurora { position: absolute; inset: -20%; z-index: -2; filter: blur(70px); opacity: .55; }
.aurora i { position: absolute; width: 50%; height: 50%; border-radius: 50%; mix-blend-mode: screen; animation: drift 14s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { top: 10%; left: 10%; background: var(--accent); }
.aurora i:nth-child(2) { top: 30%; right: 5%; background: var(--accent-2); animation-duration: 18s; animation-delay: -4s; }
.aurora i:nth-child(3) { bottom: 5%; left: 30%; background: var(--accent-3); animation-duration: 22s; animation-delay: -8s; }
@keyframes drift { to { transform: translate(12%, -10%) scale(1.25) rotate(40deg); } }
[data-theme="light"] .aurora { opacity: .25; }

.core { position: absolute; top: 14%; left: 50%; width: min(36vw, 360px); aspect-ratio: 1; translate: -50% 0; display: grid; place-items: center; perspective: 800px; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; transform-style: preserve-3d; }
.ring.r1 { border-top-color: var(--accent); border-bottom-color: color-mix(in srgb, var(--accent) 30%, transparent); animation: spin3d 7s linear infinite; box-shadow: 0 0 40px rgba(61, 255, 160, .12); }
.ring.r2 { inset: 9%; border-left-color: var(--accent-2); border-right-color: color-mix(in srgb, var(--accent-2) 30%, transparent); animation: spin3d-b 9s linear infinite; }
.ring.r3 { inset: 20%; border-top-color: var(--accent-3); border-left-color: color-mix(in srgb, var(--accent-3) 40%, transparent); animation: spin3d-c 5s linear infinite; }
@keyframes spin3d { to { transform: rotateX(70deg) rotateZ(360deg); } }
@keyframes spin3d-b { from { transform: rotateY(65deg) rotateZ(0); } to { transform: rotateY(65deg) rotateZ(-360deg); } }
@keyframes spin3d-c { from { transform: rotateX(-50deg) rotateY(30deg) rotateZ(0); } to { transform: rotateX(-50deg) rotateY(30deg) rotateZ(360deg); } }
.core-orb { width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(from var(--spin, 0deg), var(--accent), var(--accent-2), var(--accent-3), var(--accent)); animation: mark-spin 3s linear infinite; filter: drop-shadow(0 0 40px rgba(61, 255, 160, .45)); }
.core-orb b { width: 76%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #1a2b25, var(--bg) 70%); box-shadow: inset 0 0 30px rgba(61, 255, 160, .25); animation: core 2.6s ease-in-out infinite; }
[data-theme="light"] .core-orb b { background: radial-gradient(circle at 35% 30%, #ffffff, #e8f3ee 70%); }

.visual-copy { position: relative; display: grid; gap: 18px; max-width: 460px; }
.visual-copy .tag { margin: 0; }
.visual-copy h2 { margin: 0; font-size: clamp(28px, 3.4vw, 44px); font-weight: 900; line-height: 1.3; }
.models { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.models li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px);
  animation: rise .6s var(--ease) both; transition: border-color var(--normal), transform var(--normal) var(--ease); }
.models li:hover { border-color: var(--accent); transform: translateY(-2px); }
.models li:nth-child(2) { animation-delay: .1s; } .models li:nth-child(3) { animation-delay: .2s; } .models li:nth-child(4) { animation-delay: .3s; }
.models .dot { grid-row: span 2; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: ping 2s infinite; }
.models b { font-size: 13px; direction: ltr; text-align: right; }
.models li > span:last-child { font-size: 12px; color: var(--muted); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61, 255, 160, .6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(61, 255, 160, 0); } }
.live-card { justify-self: start; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 12px; min-width: 280px; }
.live-card .ok { color: var(--accent); }

/* ---------- Form side ---------- */
.panel-side { position: relative; order: 1; display: flex; flex-direction: column; padding: 24px clamp(16px, 4vw, 56px) 32px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.logo-text { font-weight: 800; font-size: 17px; }
.card-wrap { flex: 1; display: grid; place-content: center; gap: 16px; padding: 24px 0; }
.card { position: relative; width: min(440px, calc(100vw - 32px)); padding: 28px clamp(20px, 4vw, 36px) 32px; border-radius: 28px; border: 1px solid var(--border); box-shadow: var(--shadow), 0 40px 120px rgba(61, 255, 160, .08); overflow: hidden; }
.card.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.card-border { position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--spin, 0deg), transparent 0 55%, var(--accent) 70%, var(--accent-2) 80%, var(--accent-3) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: mark-spin 5s linear infinite; }
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(61, 255, 160, .08), transparent 60%); }

.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
.seg button { position: relative; z-index: 1; min-height: 42px; border: 0; background: none; font-weight: 700; color: var(--muted); border-radius: 12px; transition: color var(--normal); }
.seg button[aria-selected="true"] { color: var(--on-accent); }
.seg-pill { position: absolute; top: 5px; bottom: 5px; width: calc(50% - 5px); inset-inline-start: 5px; border-radius: 12px; background: var(--accent-strong); box-shadow: var(--glow); transition: transform .45s cubic-bezier(.65, 0, .25, 1.3); }
.seg[data-active="signup"] .seg-pill { transform: translateX(-100%); }
.seg.hidden { display: none; }

.view { display: grid; gap: 20px; animation: view-in .5s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px) scale(.98); filter: blur(6px); } }
.view-head { display: grid; gap: 6px; }
.view-head h1 { margin: 0; font-size: clamp(26px, 3vw, 32px); font-weight: 900; }
.view-head p { margin: 0; }
.badge-ico { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); animation: bob 4s ease-in-out infinite; }
.badge-ico svg { width: 26px; height: 26px; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.back { justify-self: start; }

.form { display: grid; gap: 14px; }
.float { position: relative; display: block; }
.float input {
  width: 100%; height: 58px; padding: 22px 46px 6px 46px; border: 1.5px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  font-size: 16px; text-align: right; transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.float input[dir="ltr"] { text-align: left; }
.float input:focus { outline: none; border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 24px rgba(61, 255, 160, .12); }
.float > span { position: absolute; inset-inline-start: 46px; top: 18px; color: var(--muted); font-size: 15px; pointer-events: none; transition: top .2s var(--ease), font-size .2s var(--ease), color .2s; }
.float input:focus + span, .float input:not(:placeholder-shown) + span { top: 7px; font-size: 11.5px; color: var(--accent); font-weight: 600; }
.float .ico { position: absolute; inset-inline-start: 16px; top: 19px; width: 20px; height: 20px; color: var(--muted); transition: color var(--fast); pointer-events: none; }
.float input:focus ~ .ico { color: var(--accent); }
.float .eye { position: absolute; inset-inline-end: 8px; top: 9px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--muted); }
.float .eye:hover { color: var(--text); background: var(--surface-3); }
.float input.bad { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.strength { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.strength .bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.strength .bars i { height: 5px; border-radius: 5px; background: var(--surface-3); transition: background .3s, box-shadow .3s; }
.strength[data-level="1"] .bars i:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .bars i:nth-child(-n+2) { background: var(--warning); }
.strength[data-level="3"] .bars i:nth-child(-n+3) { background: var(--accent-2); }
.strength[data-level="4"] .bars i { background: var(--accent); box-shadow: 0 0 10px rgba(61, 255, 160, .5); }
.strength-label { min-width: 70px; text-align: end; }
.caps { margin: -4px 0 0; font-size: 12px; color: var(--warning); }
.row-between { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.link { color: var(--accent); background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.alert { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-size: 14px; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); animation: rise .3s var(--ease); }
.alert.info { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.alert .link { margin-inline-start: 6px; }
.btn-xl { min-height: 56px; border-radius: 16px; font-size: 16px; font-weight: 800; }
.btn .spin { display: none; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(3, 20, 11, .25); border-top-color: var(--on-accent); animation: spin .7s linear infinite; }
.btn.loading .label { display: none; }
.btn.loading .spin { display: block; }
.btn.done { background: var(--accent); }
.switch-line { margin: 0; text-align: center; font-size: 14px; }
.fine { margin: 0; text-align: center; }
.secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; }
.secure svg { width: 16px; height: 16px; color: var(--accent); }

/* Sent: animated envelope */
.sent { display: grid; gap: 14px; justify-items: center; text-align: center; padding-top: 8px; }
.sent h1 { margin: 0; font-size: 28px; font-weight: 900; }
.sent p { margin: 0; }
.tip { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.envelope { position: relative; width: 120px; height: 84px; margin: 8px 0 12px; animation: bob 3.5s ease-in-out infinite; }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; border-radius: 12px; }
.env-back { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); }
.env-letter { position: absolute; inset: 10px 12px auto; height: 70px; display: grid; gap: 7px; align-content: start; padding: 12px; border-radius: 8px; background: var(--text); animation: letter 2.4s var(--ease) infinite; }
.env-letter i { height: 5px; border-radius: 3px; background: var(--muted); opacity: .6; }
.env-letter i:nth-child(2) { width: 70%; } .env-letter i:nth-child(3) { width: 45%; background: var(--accent); opacity: 1; }
.env-front { clip-path: polygon(0 35%, 50% 72%, 100% 35%, 100% 100%, 0 100%); background: color-mix(in srgb, var(--accent) 40%, var(--surface-3)); }
.env-flap { clip-path: polygon(0 0, 100% 0, 50% 58%); background: color-mix(in srgb, var(--accent) 55%, var(--surface-3)); transform-origin: top; animation: flap 2.4s var(--ease) infinite; }
@keyframes letter { 0%, 25% { transform: translateY(20px); } 55%, 80% { transform: translateY(-34px); } 100% { transform: translateY(20px); } }
@keyframes flap { 0%, 15% { transform: rotateX(0); } 30%, 85% { transform: rotateX(180deg); } 100% { transform: rotateX(0); } }

/* Success burst */
.burst { position: fixed; z-index: 300; pointer-events: none; width: 8px; height: 8px; border-radius: 2px; animation: burst .9s var(--ease) forwards; }
@keyframes burst { to { transform: translate(var(--bx), var(--by)) rotate(var(--br)); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .visual { position: fixed; inset: 0; z-index: -1; order: 0; border: 0; padding: 0; }
  .visual-copy, .core { display: none; }
  .net { opacity: .55; }
  .panel-side { min-height: 100dvh; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .card-wrap { place-content: start center; padding-top: 6vh; }
}
@media (max-width: 420px) {
  .card { padding: 22px 18px 26px; border-radius: 24px; }
  .logo-text { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .net, .aurora { display: none; }
}
