:root {
  --blue: #1538ff;
  --blue-dark: #0c25c7;
  --cyan: #22b8ff;
  --ink: #10162b;
  --muted: #6f7892;
  --line: rgba(20, 50, 140, 0.12);
  --card: rgba(255, 255, 255, 0.80);
  --shadow: 0 30px 80px rgba(23, 56, 140, 0.14), 0 8px 24px rgba(23, 56, 140, 0.08);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(34,184,255,.20), transparent 30%),
    radial-gradient(circle at 82% 84%, rgba(21,56,255,.12), transparent 30%),
    linear-gradient(145deg, #f4fbff 0%, #ffffff 44%, #f4f7ff 100%);
  overflow-x: hidden;
}

.login-shell {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 72px 24px 52px;
  isolation: isolate;
}

.grid-glow {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: .28;
  background-image:
    linear-gradient(rgba(21,56,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,56,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

.ambient {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(8px);
  z-index: -2;
  opacity: .65;
  animation: drift 10s ease-in-out infinite alternate;
}

.ambient-one {
  left: -110px;
  top: -90px;
  background: radial-gradient(circle at 35% 35%, rgba(34,184,255,.38), rgba(34,184,255,.04) 68%);
}

.ambient-two {
  right: -100px;
  bottom: -120px;
  background: radial-gradient(circle at 40% 40%, rgba(21,56,255,.24), rgba(21,56,255,.03) 70%);
  animation-delay: -3s;
}

.brand-corner {
  position: fixed;
  top: 26px;
  left: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  font-size: 14px;
  text-decoration: none;
  letter-spacing: -.01em;
}

.brand-corner img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.login-card {
  width: min(100%, 470px);
  padding: 38px 40px 32px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  position: relative;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(34,184,255,.28), rgba(21,56,255,.14));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.brand-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.brand-mark img {
  width: min(100%, 245px);
  height: auto;
  display: block;
}

.portal-label {
  width: fit-content;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(21,56,255,.07);
  border: 1px solid rgba(21,56,255,.10);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
}

.portal-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(21,56,255,.10);
}

h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1;
  letter-spacing: -.045em;
}

.intro {
  margin: 12px auto 30px;
  max-width: 340px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
}

.login-form > label {
  display: block;
  margin: 17px 0 8px;
  font-size: 13px;
  font-weight: 760;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  background: rgba(255,255,255,.84);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.field-wrap:focus-within {
  border-color: rgba(21,56,255,.45);
  box-shadow: 0 0 0 4px rgba(21,56,255,.08);
  transform: translateY(-1px);
}

.field-wrap > svg {
  width: 19px;
  height: 19px;
  margin-left: 16px;
  fill: none;
  stroke: #8b95ad;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 44px 0 12px;
  color: var(--ink);
  font-size: 14px;
}

input::placeholder { color: #a1a9ba; }

.password-toggle {
  position: absolute;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #7d879f;
  cursor: pointer;
}

.password-toggle:hover { background: rgba(21,56,255,.05); color: var(--blue); }

.eye { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.form-options {
  margin: 16px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 12.5px;
}

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

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

.forgot, .help-text a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.forgot:hover, .help-text a:hover { text-decoration: underline; }

.login-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), #294dff 60%, var(--cyan));
  color: #fff;
  font-size: 14px;
  font-weight: 760;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 15px 32px rgba(21,56,255,.22);
  transition: transform .2s ease, box-shadow .2s ease;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 38px rgba(21,56,255,.29);
}

.button-arrow {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  font-size: 18px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: #9aa2b4;
  font-size: 11px;
  white-space: nowrap;
}

.divider::before, .divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
}

.trust-row p { margin: 0; }

.trust-badge {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: rgba(21,56,255,.08);
  font-weight: 900;
}

.help-text {
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

footer {
  position: fixed;
  bottom: 20px;
  color: #8f98ad;
  font-size: 11px;
  letter-spacing: .01em;
}

@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(34px,18px,0) scale(1.08); }
}

@media (max-width: 560px) {
  .login-shell { padding: 86px 16px 58px; }
  .login-card { padding: 30px 22px 26px; border-radius: 22px; }
  .brand-corner { left: 18px; top: 20px; }
  .brand-corner span { display: none; }
  .brand-mark img { width: 215px; }
  .form-options { align-items: flex-start; }
  footer { position: absolute; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
