
:root {
  --bg: #04060f;
  --surface: #080d1e;
  --surface2: #0b1020;
  --border: rgba(100,150,255,0.12);
  --bf: rgba(61,127,255,0.45);
  --accent: #3d7fff;
  --accent2: #00e5c4;
  --accent3: #a855f7;
  --text: #e8eeff;
  --dim: #7a8aaa;
  --muted: #3a4560;
  --green: #00e5a0;
  --red: #ff4d6d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── BACKGROUND ── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(61,127,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,127,255,0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, black 0%, transparent 100%);
}

/* Circuit lines SVG overlay */
.circuits {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35;
}

/* Orbs */
.orb { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.o1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(61,127,255,0.14) 0%, transparent 70%); top: -180px; left: -160px; animation: oF 9s ease-in-out infinite; }
.o2 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(0,229,196,0.09) 0%, transparent 70%); bottom: -100px; right: -120px; animation: oF 11s ease-in-out infinite reverse; }
.o3 { width: 260px; height: 260px; background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%); top: 45%; left: 72%; animation: oF 7s ease-in-out infinite 1.5s; }
@keyframes oF { 0%,100%{transform:translate(0,0);} 33%{transform:translate(16px,-22px);} 66%{transform:translate(-16px,16px);} }

/* ── LAYOUT ── */
.wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px 52px;
}

/* ── LOGO ── */
.logo-wrap { margin-bottom: 36px; }
.logo {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 26px; letter-spacing: -0.5px;
  text-decoration: none; color: var(--text);
}
.logo span { color: var(--accent); }

/* ── CARD ── */
.card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 46px 40px 40px;
  position: relative;
  overflow: hidden;
  animation: fU .7s cubic-bezier(.22,1,.36,1) both;
}

/* Top accent line */
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
}

/* Corner glow */
.card::after {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(61,127,255,0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* Bottom corner glow */
.card-glow-bl {
  position: absolute; bottom: -60px; left: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(0,229,196,0.05) 0%, transparent 70%);
  pointer-events: none;
}

@keyframes fU { from{opacity:0;transform:translateY(30px);} to{opacity:1;transform:translateY(0);} }

/* ── WELCOME ── */
.welcome { text-align: center; margin-bottom: 32px; }

.ai-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(61,127,255,0.08);
  border: 1px solid rgba(61,127,255,0.18);
  padding: 5px 14px; border-radius: 100px;
  font-size: 11px; font-weight: 500;
  color: var(--accent); letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 18px;
}
.ai-dot {
  width: 6px; height: 6px;
  background: var(--accent2); border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:.4;transform:scale(.65);} }

.welcome h1 {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 26px; letter-spacing: -0.5px;
  line-height: 1.3; margin-bottom: 10px;
}
.welcome h1 em { font-style: normal; color: var(--accent); }

.welcome p { color: var(--dim); font-size: 13.5px; line-height: 1.6; }

/* ── DIVIDER ── */
.div { height: 1px; background: var(--border); margin: 0 0 28px; }

/* ── FORM ── */
.form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; }

label {
  font-size: 12px; font-weight: 500; color: var(--dim);
  letter-spacing: 0.3px; display: flex; align-items: center; gap: 6px;
}

.iw { position: relative; }

.ii {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
  transition: color .25s;
}
.iw:focus-within .ii { color: var(--accent); }

input {
  width: 100%;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 44px 13px 42px;
  border-radius: 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 300;
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
input::placeholder { color: var(--muted); }
input:focus {
  border-color: var(--bf);
  background: rgba(61,127,255,0.04);
  box-shadow: 0 0 0 3px rgba(61,127,255,0.08), 0 0 16px rgba(61,127,255,0.06);
}

/* PW toggle */
.pwt {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 15px; padding: 2px;
  transition: color .2s;
}
.pwt:hover { color: var(--accent); }

/* Forgot */
.forgot-row {
  display: flex; justify-content: flex-end; margin-top: -6px;
}
.forgot {
  font-size: 12px; color: var(--dim);
  text-decoration: none; transition: color .2s;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; padding: 0;
}
.forgot:hover { color: var(--accent); }

/* ── FIELD ERROR ── */
.ferr { font-size: 11px; color: var(--red); display: none; align-items: center; gap: 4px; }
.ferr.show { display: flex; }

/* ── SIGN-IN BUTTON ── */
.btn-signin {
  width: 100%;
  border: none; color: #fff;
  padding: 15px 32px;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  background: var(--accent);
  transition: transform .25s, box-shadow .25s, background .25s;
  /* Multi-layer glow */
  box-shadow:
    0 0 0 0 rgba(61,127,255,0),
    0 0 24px rgba(61,127,255,0.4),
    0 4px 20px rgba(61,127,255,0.25);
  animation: borderPulse 3s ease-in-out infinite;
}

@keyframes borderPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(61,127,255,.38), 0 4px 20px rgba(61,127,255,.22), 0 0 0 0 rgba(61,127,255,0); }
  50%       { box-shadow: 0 0 40px rgba(61,127,255,.55), 0 4px 28px rgba(61,127,255,.35), 0 0 60px rgba(61,127,255,.12); }
}

/* Inner glow sweep */
.btn-signin::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 50%,
    rgba(255,255,255,0.16) 0%, transparent 70%);
  opacity: 0;
  animation: innerGlow 2.8s ease-in-out infinite;
}

/* Shimmer */
.btn-signin::after {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg,
    transparent, rgba(255,255,255,0.13), transparent);
  animation: shimmer 3.4s ease-in-out infinite 0.8s;
}

@keyframes innerGlow { 0%,100%{opacity:0;} 50%{opacity:1;} }
@keyframes shimmer { 0%{left:-120%;} 50%{left:130%;} 100%{left:130%;} }

.btn-signin:hover {
  background: #5590ff;
  transform: translateY(-2px);
  box-shadow: 0 0 48px rgba(61,127,255,.62), 0 8px 32px rgba(61,127,255,.38);
  animation: none;
}
.btn-signin:active { transform: translateY(0); }

.btn-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* Animated AI indicator */
.btn-ring {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,229,196,0.6);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  animation: spin 4s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { from{transform:rotate(0deg);} to{transform:rotate(360deg);} }

.btn-ring::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  position: absolute;
  animation: spin 4s linear infinite reverse;
}

/* ── FORM FOOTER ── */
.fftr {
  text-align: center; margin-top: 22px;
  font-size: 13px; color: var(--dim);
}
.fftr a { color: var(--accent); text-decoration: none; font-weight: 400; }
.fftr a:hover { text-decoration: underline; }

/* ── OR SEPARATOR ── */
.or-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0; color: var(--muted); font-size: 12px;
}
.or-line { flex: 1; height: 1px; background: var(--border); }

/* ── TRUSTED ROW ── */
.trusted {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 22px;
  font-size: 11.5px; color: var(--muted);
}
.t-dot { width: 6px; height: 6px; border-radius: 50%; }
.td1 { background: var(--green); }
.td2 { background: var(--accent); }
.td3 { background: var(--accent3); }
.t-sep { width: 1px; height: 12px; background: var(--border); }

/* ── FORGOT MODAL ── */
.modal-bg {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.78); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 36px; width: 100%; max-width: 380px;
  position: relative; animation: fU .4s ease both;
}
.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
  border-radius: 20px 20px 0 0;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 4px;
  transition: color .2s;
}
.modal-close:hover { color: var(--text); }
.modal h3 {
  font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700;
  margin-bottom: 8px;
}
.modal p { color: var(--dim); font-size: 13.5px; line-height: 1.6; margin-bottom: 22px; }
.modal-btn {
  width: 100%; background: var(--accent); border: none; color: #fff;
  padding: 13px; border-radius: 12px; font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .2s, transform .2s;
  box-shadow: 0 0 18px rgba(61,127,255,.35);
}
.modal-btn:hover { background: #5590ff; transform: translateY(-1px); }
.modal-success { display: none; text-align: center; padding: 16px 0; }
.modal-success.show { display: block; }
.modal-success .ico { font-size: 36px; margin-bottom: 12px; }
.modal-success p { color: var(--green); font-size: 14px; font-weight: 500; }

/* ── SUCCESS STATE ── */
.sov {
  display: none; position: absolute; inset: 0;
  background: var(--surface); border-radius: 26px;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px; z-index: 10;
}
.sov.show { display: flex; }
.sico {
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(0,229,160,0.1); border: 1px solid rgba(0,229,160,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin-bottom: 22px;
  animation: sP .55s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes sP { from{transform:scale(0);opacity:0;} to{transform:scale(1);opacity:1;} }
.stit { font-family:'Syne',sans-serif;font-size:22px;font-weight:700;margin-bottom:10px;color:var(--green); }
.ssub { color:var(--dim);font-size:14px;line-height:1.65;margin-bottom:22px; }
.sdash { background:rgba(61,127,255,0.1);border:1px solid rgba(61,127,255,0.2);color:var(--accent);padding:10px 24px;border-radius:10px;font-size:13px;font-weight:500;cursor:pointer;font-family:'DM Sans',sans-serif;border:none;background:var(--accent);color:#fff;padding:12px 28px;border-radius:10px; }

/* ── PAGE FOOTER ── */
footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px; color: var(--muted);
  position: relative; z-index: 1;
}
footer a { color: var(--dim); text-decoration: none; margin: 0 10px; transition: color .2s; }
footer a:hover { color: var(--accent); }

@media (max-width: 480px) {
  .card { padding: 36px 22px 30px; border-radius: 20px; }
}