/* SAAVEX login — matches saavex-landing-v11 color system */
:root {
  --deep:      #082F49;
  --growth:    #00B8D4;
  --fresh:     #00E5FF;
  --action:    #8B5CF6;
  --flame2:    #A78BFA;
  --bg:        #FAFAFA;
  --card:      #FFFFFF;
  --surface-2: #F4F4F5;
  --text:      #082F49;
  --t2:        rgba(8,47,73,0.65);
  --t3:        rgba(8,47,73,0.42);
  --divider:   #E4E4E7;
  --border:    rgba(8,47,73,0.10);
  --hero-from: #04182A;
  --hero-mid:  #0A2942;
  --hero-to:   #0F4060;
  --ink:       #E8F4FA;
  --muted:     #8FB3C7;
  --line:      rgba(0,229,255,0.14);
  --login-card:rgba(10,42,66,0.72);
}

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

body {
  font-family: 'Sora', sans-serif;
  background: var(--hero-from);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── layout ── */
.shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

/* ── LEFT: hero panel (matches landing hero) ── */
.left {
  padding: 38px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: linear-gradient(145deg, var(--hero-from) 0%, var(--hero-mid) 40%, var(--hero-to) 100%);
  overflow: hidden;
  color: #fff;
}

.left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: float 6s ease-in-out infinite;
}

.blob.a {
  width: 300px;
  height: 300px;
  background: rgba(0,229,255,0.15);
  top: 10%;
  right: 15%;
  animation-delay: 0s;
}

.blob.b {
  width: 200px;
  height: 200px;
  background: rgba(139,92,246,0.12);
  bottom: 20%;
  right: 25%;
  animation-delay: 2s;
}

.blob.c {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,229,255,0.12) 0%, transparent 70%);
  top: -120px;
  left: -80px;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.grain { display: none; }

.topbar,
.hero,
.stats {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand .mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--fresh), var(--action));
  display: grid;
  place-items: center;
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  color: var(--deep);
  font-size: 25px;
  box-shadow: 0 8px 24px rgba(139,92,246,0.35);
}

.brand .name {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand .name .l-saa { color: var(--action); }
.brand .name .l-v   { color: #fff; }
.brand .name .l-ex  { color: var(--fresh); }

.nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav a {
  color: rgba(255,255,255,0.68);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover { color: var(--fresh); }

.hero { max-width: 560px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(0,229,255,0.10);
  border: 1px solid rgba(0,229,255,0.25);
  font-size: 11px;
  font-weight: 600;
  color: var(--fresh);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fresh);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  font-size: clamp(38px, 4.4vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  color: #fff;
}

.hero h1 em {
  font-style: normal;
  color: var(--fresh);
}

.hero p {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255,255,255,0.60);
  max-width: 480px;
  margin-bottom: 36px;
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  max-width: 500px;
}

.feat {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.feat .ic {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(0,229,255,0.10);
  border: 1px solid rgba(0,229,255,0.20);
}

.feat .ic svg {
  width: 19px;
  height: 19px;
  stroke: var(--fresh);
}

.feat h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  color: #fff;
}

.feat p {
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  line-height: 1.45;
  margin: 0;
}

.stats {
  display: flex;
  gap: 40px;
  margin-top: 8px;
}

.stat .n {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--fresh);
}

.stat .l {
  font-size: 12px;
  color: rgba(255,255,255,0.50);
  margin-top: 2px;
}

/* ── RIGHT: login panel (dark — blends with hero) ── */
.right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: linear-gradient(180deg, rgba(6,40,61,0.55) 0%, rgba(8,47,73,0.35) 100%);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.right::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(139,92,246,0.10) 0%, transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(0,229,255,0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.right::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  position: relative;
  z-index: 1;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.card {
  background: var(--login-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
}

.head {
  text-align: center;
  margin-bottom: 24px;
}

.head h2 {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 6px;
  color: var(--ink);
}

.head p {
  color: var(--muted);
  font-size: 14px;
}

.roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 22px;
  position: relative;
}

.role-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: 11px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.25s;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.role-btn svg {
  width: 18px;
  height: 18px;
}

.role-btn.active { color: var(--deep); }

.role-pill {
  position: absolute;
  top: 5px;
  left: 5px;
  height: calc(100% - 10px);
  width: calc((100% - 10px) / 3);
  border-radius: 10px;
  z-index: 1;
  background: linear-gradient(135deg, var(--fresh), var(--growth));
  box-shadow: 0 6px 18px rgba(0,229,255,0.30);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.field input::placeholder { color: #5d8198; }

.field input:focus {
  border-color: var(--fresh);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.12);
}

/* ── password visibility toggle ── */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .pwd-input {
  width: 100%;
  padding: 13px 48px 13px 15px;
  border-radius: 12px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.password-wrap .pwd-input::placeholder { color: #5d8198; }

.password-wrap .pwd-input:focus {
  border-color: var(--fresh);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.12);
}

.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #5d8198;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  line-height: 1;
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
}

.toggle-password svg {
  pointer-events: none;
}

/* default: eye-icon visible, eye-off-icon hidden */
.toggle-password .eye-icon { display: block; }
.toggle-password .eye-off-icon { display: none; }

/* when showing password: eye-icon hidden, eye-off-icon visible */
.toggle-password.showing .eye-icon { display: none; }
.toggle-password.showing .eye-off-icon { display: block; }

.toggle-password:hover {
  color: var(--fresh);
}

.toggle-password:focus {
  outline: none;
  color: var(--fresh);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 20px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.remember input {
  accent-color: var(--fresh);
  width: 15px;
  height: 15px;
}

.forgot {
  font-size: 13px;
  color: var(--fresh);
  text-decoration: none;
  font-weight: 600;
}

.forgot:hover { text-decoration: underline; }

.submit {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--deep);
  background: linear-gradient(135deg, var(--fresh), var(--action));
  box-shadow: 0 10px 28px rgba(0,229,255,0.22), 0 4px 16px rgba(139,92,246,0.25);
  transition: transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.02em;
}

.submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(139,92,246,0.35);
}

.submit:active { transform: translateY(0); }
.submit .ctx { font-weight: 600; opacity: 0.85; }

.foot {
  text-align: center;
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--muted);
}

.foot a {
  color: var(--fresh);
  text-decoration: none;
  font-weight: 600;
}

.foot a:hover { text-decoration: underline; }

.hint {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  color: #5d8198;
  line-height: 1.5;
}

/* ── responsive ── */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .left { padding: 30px 28px 44px; }
  .right {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 36px 24px 56px;
  }
  .right::before,
  .right::after { left: 0; }
  .features { max-width: none; }
  .nav { display: none; }
  .hero { margin: 34px 0; }
}

@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .stats { gap: 26px; flex-wrap: wrap; }
  .left { padding: 24px 20px 36px; }
  .right { padding: 30px 18px 48px; }
}

/* ── Server-side validation banner (invalid credentials, blocked account, …) ── */
.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.42);
  color: #FCA5A5;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.login-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
