/* --- Reset & base --- */
* { box-sizing: border-box; }
:root{
  --bg1:#0f1220; --bg2:#151a2e; --accent:#ff2d2e; --accent2:#ff6a00;
  --text:#e8e8ee; --muted:#a5a8bd; --card:#0f1424cc; --ring:#4b8cff;
  --ok:#17b26a; --err:#ff4d4f;
}
html,body{ height:100%; }
body{
  margin:0; font-family: ui-sans-serif,system-ui,Segoe UI,Roboto,Arial;
  color:var(--text); background: radial-gradient(1200px 600px at 20% -10%, #222a50 0%, transparent 60%) ,
                      radial-gradient(1000px 600px at 120% 120%, #3b1d2a 0%, transparent 60%),
                      linear-gradient(180deg, var(--bg1), var(--bg2));
  display:grid; place-items:center; padding:24px;
}

/* --- Background glow layer --- */
.bg-aurora{
  position:fixed; inset:0; pointer-events:none; filter: blur(60px) saturate(140%);
  background:
    radial-gradient(600px 300px at 30% 20%, rgba(255,45,46,.2), transparent 60%),
    radial-gradient(500px 260px at 70% 80%, rgba(255,106,0,.18), transparent 60%),
    radial-gradient(400px 220px at 80% 10%, rgba(75,140,255,.18), transparent 60%);
}

/* --- Card --- */
.login-container{
  width:min(410px, 92vw); padding:28px 24px 22px; border-radius:18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  position:relative; overflow:hidden;
}
.glass{ background: var(--card); border:1px solid rgba(255,255,255,.08); }

/* --- Branding --- */
.logo-container{ display:flex; justify-content:center; margin-bottom:8px; }
.logo-img{ width:96px; height:auto; filter: drop-shadow(0 4px 16px rgba(0,0,0,.35)); }

.title{ text-align:center; margin:6px 0 4px; font-weight:700; letter-spacing:.2px; }
.subtitle{ text-align:center; margin:0 0 14px; color:var(--muted); font-size:.95rem; }

/* --- Form --- */
.form{ display:flex; flex-direction:column; gap:10px; }
label{ font-size:.85rem; color:var(--muted); margin-top:6px; }

.input-wrap{ position:relative; }
.input-wrap input{
  width:100%; background:#0b1020; color:var(--text); border:1px solid rgba(255,255,255,.08);
  border-radius:12px; padding:14px 14px; outline:0; font-size:1rem; transition:.2s border, .2s box-shadow, .2s transform, .2s background;
}
.input-wrap.has-icon input{ padding-right:44px; }
.icon-btn{
  position:absolute; right:8px; top:50%; transform:translateY(-50%); border:0; background:transparent;
  width:32px; height:32px; display:grid; place-items:center; cursor:pointer; opacity:.8;
}
.icon{ width:20px; height:20px; fill:#9aa3b2; }
.icon-btn:hover .icon{ fill:#c6ccda; }

.input-wrap input:focus{
  border-color:var(--ring);
  box-shadow:0 0 0 4px rgba(75,140,255,.18);
}
.focus-ring{ position:absolute; inset:-2px; border-radius:14px; pointer-events:none; }

/* --- Buttons --- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:1px solid rgba(255,255,255,.12); border-radius:12px; padding:12px 14px;
  font-weight:600; cursor:pointer; transition:.2s transform, .25s background, .25s border, .25s opacity;
  background: linear-gradient(180deg, #1a213b, #0d1228);
  color:#fff;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }

.btn.primary{
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-color: rgba(255,255,255,.18);
}
.btn.primary:disabled{ opacity:.65; cursor:not-allowed; }

.btn.ghost{
  background: transparent; color:var(--text);
  border-color: rgba(255,255,255,.16);
}

.btn-label{ position:relative; z-index:1; }
.spinner{
  width:16px; height:16px; border-radius:50%;
  border:2px solid rgba(255,255,255,.55); border-top-color: transparent;
  display:none; animation: spin 0.8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* --- Links / helper text --- */
.links{ display:flex; justify-content:center; margin:10px 0 0; }
.link-btn{
  background:none; border:0; color:#b9c1d6; cursor:pointer; font-size:.95rem; padding:6px 8px;
}
.link-btn:hover{ color:#e2e7f3; text-decoration:underline; }

.inline-error{ margin-top:10px; min-height:20px; text-align:center; color:var(--err); }

/* --- Footer --- */
.powered-by{ margin-top:18px; text-align:center; color:#9aa3b2; font-size:.85rem; }
.powered-by strong{ color:#dfe3f3; }

/* --- Modal --- */
.modal{ position:fixed; inset:0; display:none; place-items:center; background: rgba(6,10,20,.6); padding:16px; }
.modal[aria-hidden="false"]{ display:grid; }
.modal-card{
  width:min(420px,92vw); background:#0d1226; color:var(--text);
  border:1px solid rgba(255,255,255,.12); border-radius:16px; padding:18px; box-shadow:0 20px 60px rgba(0,0,0,.6);
}
.modal-card h3{ margin:0 0 6px; }
.modal-card p{ margin:0 0 12px; color:var(--muted); }
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }

/* --- Toast --- */
.toast{
  position:fixed; left:50%; bottom:22px; transform:translateX(-50%) translateY(20px);
  background:#10162b; color:#dfe3f3; border:1px solid rgba(255,255,255,.12);
  padding:10px 14px; border-radius:12px; box-shadow:0 8px 30px rgba(0,0,0,.45);
  opacity:0; pointer-events:none; transition:.25s transform, .25s opacity;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast.ok{ border-color: rgba(23,178,106,.5); }
.toast.err{ border-color: rgba(255,77,79,.5); }

.powered-by .powered-link{
  color: inherit;
  text-decoration: none;
}
.powered-by .powered-link:hover{
  text-decoration: underline;
  opacity: .9;
}