.login-page {
  min-height: 100vh;
  color: var(--app-text);
  background:
    radial-gradient(circle at 16% 0%, rgba(56,189,248,.11), transparent 30%),
    radial-gradient(circle at 84% 0%, rgba(212,160,23,.14), transparent 28%),
    linear-gradient(180deg, #070b12 0%, #09111e 44%, #05070b 100%);
  overflow-x: hidden;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .34;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.78), transparent 80%);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1140px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 4vh, 48px) 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.login-card {
  overflow: hidden;
  border: 1px solid rgba(212,160,23,.36);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(8,13,23,.99));
  box-shadow:
    0 30px 80px rgba(0,0,0,.48),
    0 0 0 1px rgba(255,255,255,.025) inset,
    0 0 70px rgba(56,189,248,.04);
}

.login-visual {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1395 / 427;
  overflow: hidden;
  border-bottom: 1px solid rgba(212,160,23,.58);
  background: #05070b;
}

.login-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 55% 50%;
}

.login-visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,7,11,.02) 0%, rgba(5,7,11,.08) 36%, rgba(5,7,11,.80) 100%),
    linear-gradient(90deg, rgba(5,7,11,.72) 0%, rgba(5,7,11,.42) 30%, rgba(5,7,11,.12) 60%, rgba(5,7,11,.08) 100%);
}

.login-brand {
  position: absolute;
  left: 34px;
  bottom: 26px;
  right: 34px;
  max-width: min(60%, 560px);
  text-shadow: 0 3px 14px rgba(0,0,0,.90), 0 1px 3px rgba(0,0,0,.78);
}

.login-brand h1 {
  margin: 0;
  color: rgba(247,250,255,.97);
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-size: clamp(36px, 4.8vw, 56px);
  line-height: 1.02;
  font-weight: 300;
  letter-spacing: .015em;
}

.login-brand p {
  margin: 10px 0 0;
  color: rgba(237,243,249,.92);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.3;
}

.login-content {
  padding: 30px 34px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-heading,
#error,
#success,
.auth-form,
.recovery-codes,
.login-status {
  width: 100%;
  max-width: 740px;
}

.login-heading {
  margin-bottom: 24px;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 7px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(212,160,23,.33);
  border-radius: 999px;
  background: rgba(212,160,23,.08);
  color: #f3d678;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.security-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.login-heading h2 {
  margin: 0;
  color: #eef3f9;
  font-size: clamp(34px, 3.2vw, 48px);
  line-height: 1.08;
  font-weight: 800;
}

.login-intro {
  margin: 10px 0 0;
  color: var(--app-muted);
  font-size: 16px;
  line-height: 1.5;
}

.auth-form,
.recovery-codes {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field > span {
  color: #aebbd0;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid rgba(212,160,23,.26);
  border-radius: 13px;
  outline: none;
  background: rgba(5,9,16,.74);
  color: #fff;
  font: inherit;
  font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.auth-field input:hover,
.auth-field select:hover {
  border-color: rgba(212,160,23,.43);
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: #f1c84b;
  background: rgba(7,12,21,.93);
  box-shadow: 0 0 0 3px rgba(212,160,23,.12);
}

.auth-field select {
  appearance: auto;
  cursor: pointer;
}

.auth-field-hint {
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.35;
}

.auth-btn {
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: .035em;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, filter .15s ease;
}

.auth-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.auth-btn:hover {
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn:focus-visible,
.auth-link:focus-visible {
  outline: 2px solid #f1c84b;
  outline-offset: 3px;
}

.auth-btn-primary {
  margin-top: 4px;
  border: 1px solid rgba(212,160,23,.76);
  background: linear-gradient(180deg, #edc76b, #dcae46);
  color: #172132;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    0 0 0 3px rgba(212,160,23,.08),
    0 10px 28px rgba(0,0,0,.20);
}

.auth-btn-primary:hover {
  border-color: #f1c84b;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.33),
    0 0 0 3px rgba(212,160,23,.12),
    0 10px 28px rgba(0,0,0,.25);
}

.auth-btn-secondary {
  border: 1px solid rgba(56,189,248,.25);
  background: linear-gradient(180deg, rgba(18,34,54,.92), rgba(9,19,33,.96));
  color: #dceeff;
}

.auth-btn-secondary:hover {
  border-color: rgba(56,189,248,.55);
  box-shadow: 0 0 0 3px rgba(56,189,248,.07);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  color: #65738a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(145,160,184,.15);
}

.auth-link {
  justify-self: center;
  margin-top: -2px;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: #b9c7da;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.auth-link:hover {
  color: #f1c84b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-message {
  display: none;
  margin: 0 0 16px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.auth-error {
  border: 1px solid rgba(239,68,68,.40);
  background: rgba(127,29,29,.22);
  color: #fecaca;
}

.auth-success {
  border: 1px solid rgba(34,197,94,.32);
  background: rgba(20,83,45,.20);
  color: #bbf7d0;
}

.auth-context {
  padding: 12px 14px;
  border-left: 3px solid rgba(212,160,23,.78);
  border-radius: 8px;
  background: rgba(212,160,23,.065);
}

.auth-context strong {
  display: block;
  margin: 0 0 5px;
  color: #f3d678;
  font-size: 13px;
}

.auth-context p {
  margin: 0;
  color: #9aa9bd;
  font-size: 12px;
  line-height: 1.5;
}

.auth-context code {
  color: #dce6f4;
}

.codes {
  min-height: 120px;
  white-space: pre-wrap;
  user-select: all;
  padding: 14px;
  border: 1px solid rgba(212,160,23,.28);
  border-radius: 10px;
  background: rgba(5,9,16,.78);
  color: #e5edf7;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.login-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(145,160,184,.10);
  color: #77869b;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .025em;
}

.login-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4a017;
  box-shadow: 0 0 12px rgba(212,160,23,.55);
}

.login-footer {
  margin: 0;
  text-align: center;
  color: #58677c;
  font-size: 10px;
  letter-spacing: .04em;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .login-shell {
    width: min(100%, 760px);
    padding: 18px 12px 18px;
    justify-content: flex-start;
  }

  .login-card {
    border-radius: 22px;
  }

  .login-visual {
    aspect-ratio: 1395 / 540;
  }

  .login-brand {
    left: 22px;
    right: 22px;
    bottom: 18px;
    max-width: 74%;
  }

  .login-brand h1 {
    font-size: clamp(28px, 7.8vw, 40px);
  }

  .login-brand p {
    margin-top: 8px;
    font-size: 14px;
  }

  .login-content {
    padding: 24px 20px 20px;
  }

  .login-heading,
  #error,
  #success,
  .auth-form,
  .recovery-codes,
  .login-status {
    max-width: 100%;
  }

  .login-heading h2 {
    font-size: 24px;
  }

  .login-intro {
    font-size: 14px;
  }

  .auth-field input,
  .auth-field select,
  .auth-btn {
    min-height: 50px;
  }

  .auth-field input,
  .auth-field select {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .login-shell {
    padding: 14px 10px 16px;
  }

  .login-card {
    border-radius: 20px;
  }

  .login-visual {
    aspect-ratio: 390 / 270;
  }

  .login-visual img {
    object-position: 58% 48%;
  }

  .login-visual-shade {
    background:
      linear-gradient(180deg, rgba(5,7,11,.05) 0%, rgba(5,7,11,.12) 48%, rgba(5,7,11,.86) 100%),
      linear-gradient(90deg, rgba(5,7,11,.74) 0%, rgba(5,7,11,.36) 34%, rgba(5,7,11,.10) 65%, rgba(5,7,11,.08) 100%);
  }

  .login-brand {
    left: 18px;
    right: 18px;
    bottom: 14px;
    max-width: 82%;
  }

  .login-brand h1 {
    font-size: clamp(24px, 8.9vw, 34px);
    line-height: 1.02;
  }

  .login-brand p {
    margin-top: 6px;
    font-size: 12px;
  }

  .security-badge {
    min-height: 26px;
    padding: 6px 12px;
    font-size: 10px;
  }

  .login-content {
    padding: 20px 16px 18px;
  }

  .login-heading {
    margin-bottom: 18px;
  }

  .login-heading h2 {
    font-size: 22px;
  }

  .login-intro {
    margin-top: 8px;
    font-size: 13px;
  }

  .auth-field > span {
    font-size: 10px;
  }

  .auth-field input,
  .auth-field select {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 12px;
  }

  .auth-field-hint {
    font-size: 11px;
  }

  .auth-btn {
    min-height: 50px;
    font-size: 12px;
    border-radius: 12px;
  }

  .auth-link {
    font-size: 12px;
  }
}

@media (max-height: 720px) and (min-width: 901px) {
  .login-shell {
    justify-content: flex-start;
    padding-top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn,
  .auth-field input,
  .auth-field select {
    transition: none;
  }
}

/* FIX34 — iPhone portrait: show the entire aircraft without the mobile cover crop. */
@media (max-width: 520px) and (orientation: portrait) {
  .device-iphone .login-visual { aspect-ratio: 390 / 220; }
  .device-iphone .login-visual img {
    object-fit: contain;
    object-position: center top;
  }
  .device-iphone .login-visual-shade {
    background: linear-gradient(180deg, transparent 20%, rgba(5,7,11,.16) 50%, #05070b 78%);
  }
  .device-iphone .login-brand { max-width: none; }
}
