:root {
  --login-gold: #ffc928;
  --login-ice: #7dd8e3;
  --login-text: #f5faf9;
  --login-muted: #b6cac9;
  --login-line: rgba(225, 243, 240, .22);
}

* { box-sizing: border-box; }

.login-v2 {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--login-text);
  background:
    linear-gradient(90deg, rgba(0, 7, 9, .16) 0%, rgba(0, 8, 10, .04) 46%, rgba(0, 8, 10, .58) 100%),
    url('/static/img/hero.png') center center / cover fixed no-repeat;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-v2::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 35%, transparent 0, transparent 29%, rgba(0, 5, 6, .22) 75%),
    linear-gradient(to bottom, rgba(0, 4, 5, .18), transparent 30%, transparent 68%, rgba(0, 5, 6, .82));
}

.login-v2::after {
  position: fixed;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18vh;
  content: "";
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0, 5, 6, .94));
}

.login-ambient { position: fixed; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.login-ambient span { position: absolute; display: block; }
.login-ambient span:nth-child(1) { top: 0; right: 0; width: 42vw; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 201, 40, .9)); box-shadow: 0 0 28px rgba(255, 201, 40, .35); }
.login-ambient span:nth-child(2) { right: 8vw; bottom: 9vh; width: 190px; height: 190px; border: 1px solid rgba(255, 201, 40, .13); border-radius: 50%; }
.login-ambient span:nth-child(3) { right: calc(8vw + 70px); bottom: calc(9vh + 70px); width: 50px; height: 50px; border: 1px solid rgba(125, 216, 227, .18); border-radius: 50%; }

.login-shell {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: min(1440px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px clamp(6px, 4vw, 58px);
}

.login-panel {
  position: relative;
  width: min(455px, 100%);
  padding: 34px 36px 27px;
  overflow: hidden;
  border: 1px solid rgba(230, 247, 244, .28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .11), transparent 32%),
    linear-gradient(155deg, rgba(5, 25, 29, .66), rgba(2, 12, 15, .77));
  box-shadow:
    0 38px 100px rgba(0, 0, 0, .58),
    inset 0 1px rgba(255, 255, 255, .16),
    inset 0 -1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(22px) saturate(138%);
}

.login-panel::before {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .82), transparent);
}

.login-panel::after {
  position: absolute;
  right: -80px;
  top: -95px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  background: rgba(125, 216, 227, .10);
  filter: blur(2px);
}

.login-brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(222, 243, 240, .14);
}

.login-brand-lockup > span:last-child { display: grid; gap: 3px; }
.login-brand-lockup strong { color: #fff; font-size: 15px; letter-spacing: .16em; }
.login-brand-lockup small { color: #9db8b8; font-size: 9px; font-weight: 700; letter-spacing: .24em; }
.login-brand-emblem { position: relative; display: flex; align-items: flex-end; gap: 3px; width: 37px; height: 31px; }
.login-brand-emblem i { display: block; width: 9px; border-radius: 2px 2px 0 0; background: #edf8f6; transform: skewX(-8deg); }
.login-brand-emblem i:nth-child(1) { height: 17px; }
.login-brand-emblem i:nth-child(2) { height: 31px; background: var(--login-gold); box-shadow: 0 0 20px rgba(255, 201, 40, .30); }
.login-brand-emblem i:nth-child(3) { height: 23px; background: var(--login-ice); }

.login-heading { position: relative; z-index: 1; margin: 26px 0 20px; }
.login-eyebrow { margin: 0 0 8px; color: var(--login-gold); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.login-panel h1, .login-modal-card h2 { margin: 0; color: #fff; font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.login-copy, .login-modal-copy { margin: 8px 0 0; color: var(--login-muted); font-size: 13px; line-height: 1.55; }

.login-v2 label { position: relative; z-index: 1; display: block; margin-top: 14px; color: #dce8e7; font-size: 12px; font-weight: 700; letter-spacing: .015em; }
.login-v2 input, .login-v2 select, .login-v2 textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 11px 14px;
  border: 1px solid rgba(221, 240, 238, .20);
  border-radius: 12px;
  outline: 0;
  color: #f5fbfa;
  background: rgba(1, 11, 13, .62);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, .24), 0 1px rgba(255, 255, 255, .04);
  color-scheme: dark;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.login-v2 input:hover, .login-v2 select:hover { border-color: rgba(221, 240, 238, .32); background: rgba(2, 15, 17, .72); }
.login-v2 input:focus, .login-v2 select:focus, .login-v2 textarea:focus { border-color: var(--login-gold); background: rgba(2, 15, 17, .82); box-shadow: 0 0 0 3px rgba(255, 201, 40, .12), inset 0 1px 8px rgba(0, 0, 0, .22); }

.login-primary, .login-secondary-actions button, .login-modal-actions button { min-height: 44px; padding: 10px 15px; border: 1px solid rgba(221, 240, 238, .20); border-radius: 11px; color: #f4fbfa; background: rgba(28, 58, 61, .76); font-weight: 750; cursor: pointer; }
.login-primary { position: relative; z-index: 1; width: 100%; min-height: 49px; margin-top: 8px; border-color: #ffd45b; color: #111; background: linear-gradient(105deg, #f3b91c, #ffd75f 52%, #f4bc20); box-shadow: 0 12px 30px rgba(245, 190, 31, .20), inset 0 1px rgba(255, 255, 255, .48); }
.login-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.login-primary:disabled { opacity: .6; cursor: wait; transform: none; }
.login-status { min-height: 20px; margin: 10px 0 4px; color: #c0d3d1; font-size: 13px; }
.login-status.error { color: #ff9daf; }
.login-status.success { color: #78e4bb; }
.login-secondary-actions { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; }
.login-secondary-actions button { min-height: auto; padding: 7px 1px; border: 0; color: #b5cdcb; background: transparent; font-size: 12px; }
.login-secondary-actions button:hover { color: var(--login-gold); }
.login-security-note { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 17px 0 0; color: #819c9a; font-size: 10px; letter-spacing: .045em; }
.login-security-note span { width: 6px; height: 6px; border-radius: 50%; background: #70deb0; box-shadow: 0 0 11px rgba(112, 222, 176, .64); }

.login-modal { position: fixed; inset: 0; z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(0, 7, 8, .84); backdrop-filter: blur(10px); }
.login-modal.hidden { display: none; }
.login-modal-card { position: relative; width: min(820px, 100%); max-height: 92vh; overflow: auto; padding: 30px; border: 1px solid var(--login-line); border-radius: 22px; background: linear-gradient(155deg, #0b3031, #06191d); box-shadow: 0 30px 90px rgba(0, 0, 0, .68); }
.login-modal-card.compact { width: min(520px, 100%); }
.login-modal-card .login-eyebrow, .login-modal-card h2, .login-modal-card .login-modal-copy { text-align: center; }
.login-modal-close { position: absolute; right: 17px; top: 12px; border: 0; color: #c4dcda; background: transparent; font-size: 28px; cursor: pointer; }
.create-user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.create-user-grid fieldset { padding: 16px; border: 1px solid var(--login-line); border-radius: 12px; }
.create-user-grid legend { padding: 0 7px; color: var(--login-gold); font-weight: 700; }
.create-user-grid .full { grid-column: 1 / -1; }
.login-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.login-modal-actions .login-primary { width: auto; margin: 0; }
.login-recovery-form { display: grid; gap: 13px; }
.login-recovery-form label { margin: 0; }
.login-recovery-form .login-modal-actions { margin-top: 5px; }
.login-recovery-form input[autocomplete="one-time-code"] { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .035em; }

@media (max-width: 760px) {
  .login-v2 { background-position: 57% center; }
  .login-shell { justify-content: center; width: calc(100% - 20px); padding: 22px 0; }
  .login-panel { width: min(455px, 100%); padding: 28px 22px 23px; border-radius: 21px; }
  .login-brand-lockup { padding-bottom: 18px; }
  .login-heading { margin: 22px 0 17px; }
  .login-panel h1 { font-size: 27px; }
  .login-secondary-actions { flex-direction: column; align-items: center; gap: 1px; }
  .create-user-grid { grid-template-columns: 1fr; }
  .create-user-grid .full { grid-column: auto; }
  .login-recovery-form .login-modal-actions { display: grid; grid-template-columns: 1fr; }
  .login-recovery-form .login-modal-actions .login-primary { width: 100%; }
}
