/* =========================
   AUTH (LOGIN) PAGE STYLES
   Refined + Glass Upgrade
========================= */

:root{
  --bg0:#070a10;
  --bg1:#0b1220;
  --ink:#ffffff;
  --muted: rgba(255,255,255,.72);
  --muted2: rgba(255,255,255,.52);

  --accent:#9c6bff;
  --accent2:#6c63ff;

  --glassA: rgba(255,255,255,.10);
  --glassB: rgba(255,255,255,.06);
  --glassC: rgba(255,255,255,.03);

  --stroke: rgba(255,255,255,.14);
  --stroke2: rgba(255,255,255,.18);

  --shadow: 0 26px 90px rgba(0,0,0,.55);
  --radius: 26px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  background: var(--bg0);
  color: var(--ink);
}

.theme-dark{ background: var(--bg0); color: var(--ink); }

/* ===== Full screen auth layout ===== */
.auth-screen{
  min-height:100vh;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  padding: 22px;
}

/* ===== Same-style background as welcome page ===== */
.auth-bg{
  position:absolute;
  inset:-20%;
  background:
    radial-gradient(circle at top, rgba(26,31,61,0.95), rgba(11,18,32,0.92) 55%),
    radial-gradient(circle at 70% 30%, rgba(140,80,255,0.20), transparent 55%),
    radial-gradient(circle at 25% 70%, rgba(255,120,60,0.18), transparent 60%),
    var(--bg0);
  filter: saturate(1.05);
  z-index:0;
}

/* Optional subtle vignette */
.auth-bg::after{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(circle at 50% 40%, transparent 35%, rgba(0,0,0,.35) 100%);
  pointer-events:none;
}

/* ===== Main 2-column wrapper ===== */
.auth-wrap{
  width: min(1200px, 94vw);
  min-height: 640px;
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  position:relative;
  z-index:1;
}

/* ===== Left panel ===== */
.auth-left{
  border-radius: var(--radius);
  padding: 34px;
  position:relative;
  overflow:hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 26px 80px rgba(0,0,0,0.55);
}

.auth-left::before{
  content:"";
  position:absolute;
  inset:-60%;
  background: radial-gradient(circle at 25% 25%, rgba(156,107,255,.22), transparent 55%);
  transform: rotate(12deg);
  pointer-events:none;
}

.auth-left-inner{
  height:100%;
  display:flex;
  flex-direction:column;
  gap: 16px;
  position:relative;
  z-index:1;
}

.auth-brand{
  display:flex;
  align-items:center;
  gap: 12px;
}

.auth-logo{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: conic-gradient(from 220deg, #4f46e5, #4338ca, #059669, #4f46e5);
  box-shadow: 0 12px 26px rgba(0,0,0,0.35);
}

.auth-brand-title{
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 16px;
  line-height: 1.2;
}
.auth-brand-sub{
  margin-top: 2px;
  color: rgba(255,255,255,0.72);
  font-weight: 650;
  font-size: 12.5px;
}

.auth-hero-title{
  margin-top: 10px;
  font-size: 54px;
  line-height: 1.02;
  letter-spacing: -1px;
  font-weight: 950;
}
.auth-hero-title .accent{ color: var(--accent); }

.auth-hero-sub{
  max-width: 52ch;
  color: rgba(255,255,255,0.72);
  font-weight: 550;
  line-height: 1.6;
  margin-top: 4px;
}

/* Illustration */
.auth-illustration{
  margin-top: auto;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  min-height: 300px;
  position:relative;
}

.auth-illustration::before{
  content:"";
  position:absolute;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(120,170,255,0.18) 0%, rgba(0,0,0,0) 65%);
  filter: blur(60px);
  z-index:0;
  pointer-events:none;
}

.auth-illustration img{
  width: min(520px, 92%);
  height:auto;
  opacity: 0.98;
  position:relative;
  z-index:1;

  /* Glow + color dodge vibe */
  mix-blend-mode: color-dodge;
  filter:
    drop-shadow(0 0 24px rgba(120,170,255,0.45))
    drop-shadow(0 0 54px rgba(160,120,255,0.28))
    drop-shadow(0 0 120px rgba(120,170,255,0.18));
}

/* ===== Right panel ===== */
.auth-right{
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ===== Glass card ===== */
.auth-card{
  width: min(520px, 94%);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  position: relative;
  overflow: hidden;

  background:
    linear-gradient(135deg,
      rgba(255,255,255,.11) 0%,
      rgba(255,255,255,.06) 45%,
      rgba(255,255,255,.03) 100%);
  border: 1px solid rgba(255,255,255,.18);

  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);

  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255,255,255,.10);
}

/* glass shine */
.auth-card::before{
  content:"";
  position:absolute;
  inset:-45%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 58%);
  transform: rotate(12deg);
  pointer-events:none;
  opacity:.95;
}

/* subtle edge glow */
.auth-card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
  pointer-events:none;
}

.auth-card > *{
  position:relative;
  z-index:1;
}

.auth-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.auth-card-kicker{
  color: rgba(255,255,255,0.65);
  font-weight: 700;
  font-size: 12.5px;
}
.auth-card-title{
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.5px;
  margin-top: 4px;
}

.role-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.14);
  font-weight: 750;
  font-size: 12.5px;
  color: rgba(255,255,255,0.78);
  white-space:nowrap;
}
.role-pill b{ color:#fff; }

/* Alerts */
.auth-alert{
  display:none;
  padding: 12px 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-weight: 650;
  line-height: 1.35;
}
.auth-alert.on{ display:block; }
.auth-alert.good{
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.22);
  color: rgba(220,255,245,0.92);
}
.auth-alert.bad{
  background: rgba(251,113,133,0.12);
  border: 1px solid rgba(251,113,133,0.22);
  color: rgba(255,230,234,0.92);
}

/* Form */
.auth-form{ display:flex; flex-direction:column; gap: 14px; }

.field span{
  display:block;
  font-weight: 750;
  font-size: 12.5px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 8px;
}

.field input{
  width:100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  color:#fff;
  outline:none;
  transition: .18s ease;
}

.field input::placeholder{ color: rgba(255,255,255,0.42); }

.field input:focus{
  background: rgba(0,0,0,.14);
  border-color: rgba(156,107,255,.55);
  box-shadow: 0 0 0 4px rgba(156,107,255,.16);
}

/* Password toggle */
.pw-wrap{ position:relative; }
.pw-toggle{
  position:absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,0.85);
  cursor:pointer;
  font-weight: 750;
  font-size: 12px;
  transition: .16s ease;
}
.pw-toggle:hover{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.24);
}

/* hint text */
.hint{
  display:block;
  margin-top: 8px;
  color: rgba(255,255,255,0.52);
  font-size: 12px;
}

/* OTP */
.otp-field{ display:none; }
.otp-field.on{ display:block; }

.auth-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-top: 2px;
}

.check{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  color: rgba(255,255,255,0.72);
  font-weight: 650;
  font-size: 13px;
}
.check input{ accent-color: var(--accent); }

.link{
  color: rgba(156,107,255,0.95);
  font-weight: 750;
  text-decoration:none;
}
.link:hover{ text-decoration:underline; }

.muted{ color: rgba(255,255,255,0.60); }
.dot-sep{ color: rgba(255,255,255,0.28); }

/* Button */
.auth-btn{
  margin-top: 6px;
  width:100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 900;
  letter-spacing: .1px;
  color:#fff;
  cursor:pointer;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  box-shadow: 0 18px 40px rgba(156,107,255,0.18);
  transition: .18s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}
.auth-btn:hover{ transform: translateY(-1px); }
.auth-btn:active{ transform: translateY(0px); }
.auth-btn:disabled{ opacity: .55; cursor:not-allowed; transform:none; }

.btn-spinner{
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: rgba(255,255,255,0.95);
  display:none;
  animation: spin .8s linear infinite;
}
.auth-btn.loading .btn-spinner{ display:inline-block; }
.auth-btn.loading .btn-text{ opacity:.85; }

@keyframes spin{ to { transform: rotate(360deg); } }

.auth-foot{
  display:flex;
  justify-content:center;
  gap: 10px;
  margin-top: 10px;
  font-weight: 650;
  font-size: 13px;
  flex-wrap:wrap;
}

/* Lockout box */
.lockout{
  display:none;
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.22);
  color: rgba(255,245,220,0.92);
  font-weight: 700;
  text-align:center;
}
.lockout.on{ display:block; }

/* ===== Responsive ===== */
@media (max-width: 980px){
  .auth-wrap{
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 18px;
  }
  .auth-left{
    min-height: 420px;
    padding: 26px;
  }
  .auth-hero-title{ font-size: 46px; }
  .auth-card{
    width: min(560px, 100%);
  }
}

/* Tight phones */
@media (max-width: 520px){
  .auth-screen{ padding: 14px; }
  .auth-left{ border-radius: 22px; }
  .auth-card{ border-radius: 22px; padding: 18px 16px 16px; }
  .auth-card-title{ font-size: 24px; }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior:auto !important; }
  .auth-illustration img{ animation:none !important; }
}

.auth-card{
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.22);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
}

.auth-card::before{
  opacity: 1;
  background: radial-gradient(circle at 30% 15%, rgba(255,255,255,.22), transparent 60%);
}
