* {
  box-sizing: border-box;
}

:root {
  --bg: #04070c;
  --bg-2: #081019;
  --panel: rgba(7, 13, 20, 0.84);
  --panel-border: rgba(105, 255, 187, 0.16);
  --field: rgba(5, 11, 18, 0.96);
  --field-border: rgba(112, 255, 193, 0.14);
  --text: #ecfff5;
  --muted: rgba(213, 255, 232, 0.65);
  --accent: #64ffb5;
  --accent-2: #19d3a2;
  --danger: #ff7d99;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(25, 211, 162, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(100, 255, 181, 0.06), transparent 26%),
    linear-gradient(180deg, #03060b 0%, #07111a 100%);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.grid,
.vignette,
.scanlines,
.glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid {
  background-image:
    linear-gradient(rgba(100, 255, 181, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 255, 181, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.95));
  opacity: 0.55;
}

.vignette {
  background:
    radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.42) 100%);
}

.scanlines {
  opacity: 0.12;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.01) 50%,
    rgba(0,0,0,0.02) 51%,
    rgba(0,0,0,0.05)
  );
  background-size: 100% 4px;
}

.glow {
  filter: blur(48px);
  will-change: transform, opacity;
}

.glow-1 {
  inset: auto auto -140px -120px;
  width: 320px;
  height: 320px;
  background: rgba(25, 211, 162, 0.18);
  animation: floatGlow 10s ease-in-out infinite;
}

.glow-2 {
  inset: 80px -100px auto auto;
  width: 260px;
  height: 260px;
  background: rgba(100, 255, 181, 0.13);
  animation: floatGlow 12s ease-in-out infinite reverse;
}

.boot-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(10, 25, 19, 0.28), rgba(0, 0, 0, 0.92)),
    #020507;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.boot-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-panel {
  width: min(92vw, 760px);
  border-radius: 18px;
  border: 1px solid rgba(100, 255, 181, 0.18);
  background: rgba(4, 10, 12, 0.92);
  box-shadow: 0 0 0 1px rgba(100, 255, 181, 0.04), 0 20px 55px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.boot-top {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(100, 255, 181, 0.1);
}

.boot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(100, 255, 181, 0.38);
}

.boot-title {
  padding: 16px 18px 0;
  color: rgba(218, 255, 237, 0.72);
  font-size: 12px;
  letter-spacing: 0.22em;
}

.boot-lines {
  padding: 18px;
  min-height: 260px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  line-height: 1.8;
  color: #8dffcb;
}

.boot-line {
  opacity: 0;
  transform: translateY(8px);
  animation: bootLine 340ms ease forwards;
}

.login-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 40px 22px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 42px;
  opacity: 0;
  transform: scale(0.985) translateY(12px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.login-wrap.is-ready {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.hero-side {
  padding-right: 16px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(176, 255, 217, 0.68);
  font-size: 12px;
}

.hero-side h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  text-shadow: 0 0 18px rgba(100, 255, 181, 0.12);
}

.hero-copy {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.login-card {
  position: relative;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(10, 16, 24, 0.95), rgba(6, 11, 18, 0.94));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-topline {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.85;
}

.card-header {
  padding: 28px 28px 8px;
}

.card-kicker {
  margin: 0 0 8px;
  color: rgba(177, 255, 217, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
}

.card-header h2 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.05em;
}

.card-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  padding: 18px 28px 28px;
}

.field + .field {
  margin-top: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: rgba(226, 255, 237, 0.92);
}

.field-shell {
  display: flex;
  align-items: center;
  min-height: 60px;
  border-radius: var(--radius-md);
  background: var(--field);
  border: 1px solid var(--field-border);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field-shell:focus-within {
  border-color: rgba(100, 255, 181, 0.42);
  box-shadow: 0 0 0 4px rgba(100, 255, 181, 0.07);
}

.field-shell.is-error {
  border-color: rgba(255, 125, 153, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 125, 153, 0.06);
}

.field-icon {
  width: 54px;
  display: grid;
  place-items: center;
  color: rgba(179, 255, 219, 0.68);
}

.field-icon svg {
  width: 20px;
  height: 20px;
}

.field-shell input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 15px;
  padding: 18px 16px 18px 0;
}

.field-shell input::placeholder {
  color: rgba(205, 255, 229, 0.3);
}

.toggle-password {
  margin-right: 12px;
  border: 0;
  background: transparent;
  color: rgba(179, 255, 219, 0.72);
  font-size: 13px;
  cursor: pointer;
}

.error-text {
  min-height: 18px;
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.login-button {
  position: relative;
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  color: #031109;
  background: linear-gradient(180deg, #79ffbf 0%, #37dca1 100%);
  box-shadow: 0 14px 28px rgba(54, 220, 161, 0.16);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.login-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 18px 32px rgba(54, 220, 161, 0.22);
}

.login-button:active {
  transform: translateY(0);
}

.login-button.is-loading {
  opacity: 0.82;
  cursor: wait;
}

.status-text {
  min-height: 22px;
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  color: rgba(216, 255, 234, 0.72);
}

.status-text.is-error {
  color: var(--danger);
}

.status-text.is-success {
  color: #86ffc6;
}

@media (max-width: 980px) {
  body {
    overflow-y: auto;
  }

  .login-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 16px 28px;
  }

  .hero-side {
    padding-right: 0;
  }

  .hero-side h1 {
    font-size: clamp(42px, 13vw, 72px);
  }

  .hero-copy {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes floatGlow {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.85; }
  50% { transform: translate3d(0, -14px, 0); opacity: 1; }
}

@keyframes bootLine {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.login-link-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 14px;
}

.forgot-password-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 4px 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.forgot-password-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at top, rgba(100, 255, 181, 0.08), transparent 34%),
    rgba(0, 3, 7, 0.84);
  backdrop-filter: blur(18px);
}

.auth-modal-overlay[hidden] {
  display: none;
}

.auth-modal-card {
  position: relative;
  width: min(520px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(100, 255, 181, 0.18);
  background:
    radial-gradient(circle at top right, rgba(100, 255, 181, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(10, 16, 24, 0.98), rgba(4, 8, 13, 0.99));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62);
  padding: 30px;
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(100, 255, 181, 0.18);
  background: rgba(100, 255, 181, 0.06);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.auth-modal-card h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.06em;
}

.auth-modal-copy {
  color: var(--muted);
  line-height: 1.65;
  margin: 14px 0 22px;
}

.auth-modal-field {
  display: block;
  color: rgba(226, 255, 237, 0.92);
  font-size: 14px;
  margin: 14px 0 8px;
}

.auth-modal-card input {
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-md);
  border: 1px solid var(--field-border);
  background: var(--field);
  color: var(--text);
  outline: 0;
  padding: 0 14px;
}

.auth-modal-card input:focus {
  border-color: rgba(100, 255, 181, 0.42);
  box-shadow: 0 0 0 4px rgba(100, 255, 181, 0.07);
}

.auth-modal-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: rgba(216, 255, 234, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

.auth-modal-status.is-error {
  color: var(--danger);
}

.auth-modal-status.is-success {
  color: #86ffc6;
}

.auth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.auth-primary-button,
.auth-secondary-button {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

.auth-primary-button {
  border: 0;
  color: #031109;
  background: linear-gradient(180deg, #79ffbf 0%, #37dca1 100%);
}

.auth-secondary-button {
  border: 1px solid rgba(100, 255, 181, 0.18);
  background: rgba(100, 255, 181, 0.06);
  color: var(--text);
}

.auth-primary-button:disabled,
.auth-secondary-button:disabled {
  opacity: 0.64;
  cursor: wait;
}

body.is-auth-modal-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .auth-modal-card {
    padding: 24px;
  }

  .auth-modal-actions {
    flex-direction: column-reverse;
  }

  .auth-primary-button,
  .auth-secondary-button {
    width: 100%;
  }
}
