:root {
  --night: #061827;
  --blue: #0d4b79;
  --blue-bright: #176aa0;
  --snow: #f7fbff;
  --mist: #c7d6e1;
  --gold: #ffbc20;
  --panel: rgba(4, 24, 39, 0.79);
  --line: rgba(255, 255, 255, 0.17);
  --hero-opacity: 1;
  --panel-opacity: 0;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--snow);
  background: var(--night);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
}

.login-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-items: center;
  padding: clamp(24px, 5vw, 76px);
  background: #071d2e;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("./assets/mountain-sunrise-hero.png") 67% center / cover no-repeat;
  opacity: var(--hero-opacity);
  transition: opacity 120ms linear;
}

.atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 78% 28%, rgba(255,188,32,.12), transparent 21%),
    linear-gradient(180deg, rgba(4,21,34,.02), rgba(4,21,34,.32));
}

.access-panel {
  width: min(100%, 454px);
  padding: clamp(28px, 4vw, 50px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 9, 18, .38), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(22px) saturate(125%);
  opacity: var(--panel-opacity);
  transform: translateY(calc((1 - var(--panel-opacity)) * 18px));
  transition: opacity 120ms linear, transform 120ms linear;
}

.access-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: #d7e4ed;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255,188,32,.5);
}

.readiness { min-height: 66px; }

.readiness-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  color: #e5eef4;
  font-size: .9rem;
  font-weight: 600;
}

.readiness-copy strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.readiness-track {
  height: 2px;
  margin-top: 17px;
  overflow: hidden;
  background: rgba(255,255,255,.16);
}

.readiness-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255,188,32,.5);
}

.login-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transform: translateY(10px);
  transition: grid-template-rows 650ms ease, opacity 650ms ease, transform 650ms ease;
}

body.is-ready .readiness {
  display: none;
}

body.is-ready .login-content {
  display: block;
  opacity: 1;
  overflow: visible;
  transform: translateY(0);
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 3.65rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.intro {
  max-width: 32ch;
  margin: 17px 0 34px;
  color: var(--mist);
  font-size: 1rem;
  line-height: 1.55;
}

.login-form, .request-form { display: grid; gap: 11px; }

.request-form[hidden], .login-form[hidden] { display: none; }
.access-wait[hidden] { display: none; }
.access-wait { display: grid; justify-items: center; gap: 12px; padding: 28px 18px; text-align: center; border: 1px solid rgba(198,222,239,.28); border-radius: 16px; background: rgba(2,24,44,.36); }
.access-wait strong { color: #fff; font: 1.3rem Georgia,serif; }
.access-wait p { margin: 0; color: #d0e1ed; line-height: 1.6; }
.wait-ring { width: 31px; height: 31px; border: 3px solid rgba(255,255,255,.2); border-top-color: #ffd061; border-radius: 50%; animation: wait-spin 1s linear infinite; }
@keyframes wait-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wait-ring { animation: none; border-color: #ffd061; } }

label {
  color: #e9f2f8;
  font-size: .88rem;
  font-weight: 600;
}

.password-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

a {
  color: #f5c85d;
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
}

a:hover, a:focus-visible { text-decoration: underline; }

input {
  width: 100%;
  min-height: 51px;
  border: 1px solid rgba(255,255,255,.21);
  border-radius: 12px;
  outline: none;
  background: rgba(255,255,255,.075);
  color: white;
  font: inherit;
  padding: 0 16px;
  transition: border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

input::placeholder { color: rgba(224,235,242,.5); }

input:focus {
  border-color: rgba(255,188,32,.83);
  background: rgba(255,255,255,.105);
  box-shadow: 0 0 0 4px rgba(255,188,32,.12);
}

button {
  min-height: 53px;
  margin-top: 13px;
  border: 1px solid #ffd061;
  border-radius: 12px;
  cursor: pointer;
  color: #092238;
  background: linear-gradient(180deg, #ffd05d, var(--gold));
  box-shadow: 0 12px 30px rgba(255,172,0,.18), inset 0 1px 0 rgba(255,255,255,.55);
  font-family: "Aptos Display", "Segoe UI", Arial, sans-serif;
  font-size: .96rem;
  font-weight: 700;
  transition: transform 160ms ease, filter 160ms ease;
}

button:hover { filter: brightness(1.04); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 3px solid rgba(255,255,255,.8); outline-offset: 3px; }

button:disabled, input:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.form-feedback {
  min-height: 1.35rem;
  margin: 15px 0 0;
  color: #e9f2f8;
  font-size: .83rem;
  line-height: 1.5;
}

.form-feedback[data-state="error"] { color: #ffd2c8; }
.form-feedback[data-state="success"] { color: #ffe19a; }

.request-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--mist);
  font-size: .9rem;
}

.local-preview {
  display: block;
  margin: 14px auto 0;
  width: fit-content;
  color: #fff0c6;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.local-preview[hidden] { display: none; }

.security-note {
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: rgba(215,228,237,.68);
  font-size: .78rem;
  line-height: 1.55;
}

footer {
  position: absolute;
  right: clamp(24px, 4vw, 64px);
  bottom: 25px;
  color: rgba(244,249,252,.68);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .login-shell {
    align-items: end;
    padding: 20px 18px 54px;
    background-position: 70% center;
  }

  .access-panel {
    margin-inline: auto;
    border-radius: 20px;
  }

  footer { display: none; }
}

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

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