:root {
  --ink: #071018;
  --ink-soft: #0d1a24;
  --panel: #f7fafc;
  --panel-elevated: #ffffff;
  --line: rgba(15, 35, 48, 0.12);
  --text: #102033;
  --muted: #5b6b7c;
  --accent: #0f9d8a;
  --accent-strong: #0b7f70;
  --accent-soft: rgba(15, 157, 138, 0.14);
  --danger: #c23b3b;
  --danger-bg: #fff1f1;
  --radius-lg: 28px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(3, 12, 20, 0.45);
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.login-body {
  height: 100%;
  margin: 0;
}

body.login-body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

/* Atmosphere */
.login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(15, 157, 138, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 75%, rgba(56, 140, 190, 0.18), transparent 50%),
    linear-gradient(160deg, #050b12 0%, #0a1620 45%, #07141c 100%);
}

.login-bg__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(800px) rotateX(58deg) translateY(-12%);
  transform-origin: center top;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 85%);
  animation: grid-drift 28s linear infinite;
}

.login-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: orb-float 12s ease-in-out infinite;
}

.login-bg__orb--a {
  width: 280px;
  height: 280px;
  top: 8%;
  left: 6%;
  background: rgba(15, 157, 138, 0.35);
}

.login-bg__orb--b {
  width: 340px;
  height: 340px;
  right: 4%;
  bottom: 10%;
  background: rgba(47, 128, 176, 0.28);
  animation-delay: -4s;
}

.login-bg__orb--c {
  width: 180px;
  height: 180px;
  top: 48%;
  left: 42%;
  background: rgba(180, 210, 220, 0.12);
  animation-delay: -7s;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  min-height: min(620px, 90dvh);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: color-mix(in srgb, var(--panel) 92%, white);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: shell-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Left brand plane */
.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 44px;
  color: #e8f4f2;
  background: linear-gradient(155deg, #07161c 0%, #0a242a 55%, #081c24 100%);
  isolation: isolate;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(5, 14, 20, 0.55) 100%),
    radial-gradient(circle at 20% 0%, rgba(15, 157, 138, 0.28), transparent 45%);
  z-index: -1;
}

.login-hero__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-hero__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.login-hero__eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(180, 230, 220, 0.75);
  font-weight: 600;
}

.login-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.login-hero__tagline {
  margin: 0;
  max-width: 28ch;
  font-size: 1.08rem;
  line-height: 1.55;
  color: rgba(220, 236, 240, 0.86);
}

.login-hero__points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.login-hero__points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(220, 236, 240, 0.9);
}

.login-hero__point-icon {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-hero__footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  color: rgba(200, 220, 228, 0.7);
}

.login-hero__footer strong {
  color: #f2fbf9;
  font-weight: 600;
}

/* Form panel */
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
  background: var(--panel-elevated);
  animation: panel-enter 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.login-panel__header {
  margin-bottom: 28px;
}

.login-panel__header h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.login-panel__header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.login-form {
  display: grid;
  gap: 4px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334556;
}

.field__control {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfd;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field__control::placeholder {
  color: #94a3b0;
}

.field__control:hover {
  border-color: rgba(15, 157, 138, 0.35);
}

.field__control:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

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

.login-actions {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, #12b39d 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 157, 138, 0.28);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #14c3ab 0%, var(--accent-strong) 100%);
}

.btn--ghost {
  background: #edf2f5;
  color: #314354;
}

.btn--ghost:hover {
  background: #e2e9ee;
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn--outline:hover {
  border-color: rgba(15, 157, 138, 0.45);
  background: var(--accent-soft);
}

.login-external {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.login-external__label {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--muted);
}

.login-external__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-alert,
.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(194, 59, 59, 0.22);
  background: var(--danger-bg);
  color: #7a1f1f;
  font-size: 0.92rem;
}

.alert strong,
.login-alert strong {
  display: block;
  margin-bottom: 4px;
}

.alert ul {
  margin: 0;
  padding-left: 18px;
}

@keyframes shell-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 56px 56px, 56px 56px;
  }
}

@keyframes orb-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(12px, -18px, 0);
  }
}

@media (max-width: 900px) {
  body.login-body {
    overflow: auto;
  }

  .login-page {
    padding: 16px;
    align-items: stretch;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-hero {
    padding: 28px 24px 24px;
    gap: 18px;
  }

  .login-hero__tagline,
  .login-hero__points,
  .login-hero__footer {
    display: none;
  }

  .login-panel {
    padding: 28px 24px 32px;
  }

  .login-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .login-panel,
  .login-bg__grid,
  .login-bg__orb,
  .btn {
    animation: none !important;
    transition: none !important;
  }
}
