:root {
  --navy-top: #0d2142;
  --navy-bottom: #030610;
  --text: #f1f5fb;
  --muted: rgba(220, 230, 245, .62);
  --line: rgba(255, 255, 255, .12);
  --accent: #ffffff;
  --link: #8cc4ff;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: linear-gradient(180deg, var(--navy-top), var(--navy-bottom));
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
body.no-webgl #sky { display: none; }
body.no-webgl {
  background:
    radial-gradient(60vmax 60vmax at 72% 30%, rgba(190, 210, 240, .45), transparent 60%),
    linear-gradient(180deg, var(--navy-top), var(--navy-bottom));
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  align-items: center;
  padding: 24px clamp(20px, 8vw, 140px);
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 30px 24px;
  background: rgba(10, 24, 48, .5);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.head { text-align: center; margin-bottom: 26px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .03em;
}
.portal { margin: 6px 0 2px; font-size: 14px; color: var(--muted); }
.tagline { margin: 0; font-size: 12px; color: rgba(220, 230, 245, .4); }

form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.label-row { display: flex; align-items: baseline; justify-content: space-between; }
.forgot {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}
.forgot:hover { text-decoration: underline; }
small { font-size: 11.5px; color: rgba(220, 230, 245, .45); }

input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
input:focus { border-color: rgba(140, 196, 255, .7); background: rgba(255, 255, 255, .09); }
input[readonly] { color: var(--muted); background: rgba(255, 255, 255, .03); cursor: not-allowed; }

.pw { position: relative; }
.pw input { padding-right: 44px; }
.eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.eye:hover { color: var(--text); }

.submit {
  margin-top: 2px;
  padding: 13px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #0b66b3;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(11, 102, 179, .35);
  transition: background .15s ease, transform .12s ease;
}
.submit:hover { background: #0d78d1; }
.submit:active { transform: scale(.99); }

.foot { margin: 22px 0 0; text-align: center; font-size: 12px; color: rgba(220, 230, 245, .4); }

@media (max-width: 720px) {
  .stage { justify-content: center; align-items: flex-end; padding-bottom: 6vh; }
}

[x-cloak] { display: none !important; }
.error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 11px 14px;
  font-size: 13.5px;
  color: #ffd2d6;
  background: rgba(220, 53, 69, .18);
  border: 1px solid rgba(255, 120, 130, .35);
  border-radius: 10px;
}
.error svg { flex: none; margin-top: 2px; }
.error p, .error ul { margin: 0; padding: 0; list-style: none; }
.back { margin: 18px 0 0; text-align: center; font-size: 13px; }
.back a { color: var(--link); font-weight: 600; text-decoration: none; }
.back a:hover { text-decoration: underline; }
.submit { display: flex; align-items: center; justify-content: center; gap: 8px; }
.submit:disabled { opacity: .7; cursor: not-allowed; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ok {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  font-size: 13.5px;
  color: #cdeedb;
  background: rgba(40, 167, 100, .18);
  border: 1px solid rgba(90, 210, 150, .35);
  border-radius: 10px;
}
.ok svg { flex: none; margin-top: 2px; }
.ok p { margin: 0; }
.ok a { color: #fff; font-weight: 600; }
.lead { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.rules { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 12px; color: rgba(220, 230, 245, .45); }
.rules li { display: flex; align-items: center; gap: 6px; }
.rules li.met { color: #7be0a8; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.check input { width: auto; padding: 0; }
.field input.code { text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .5em; padding-left: calc(14px + .5em); }
