/* AEOS Hub V2 — auth pages (approved "Login Design Direction", 2026-09): /v2/login and /v2/register.
 *
 * Both pages share every component below; /v2/login is the visual source of truth and /v2/register reuses
 * the same classes (brand block, sheet, fields, toggle, CTA, footer). Everything is namespaced
 * `.aeos-login*` (html.aeos-login-root / body.aeos-login), so nothing here can affect the shell or any
 * other page. Register-only additions sit under "Register additions" near the end of the file.
 * Loaded together with public/css/simple-loader.css (the canonical AEOS loader).
 *
 * Mobile is authoritative (375px). Palette: deep midnight, AEOS blue -> violet -> gold spectrum.
 */

html.aeos-login-root,
body.aeos-login {
  margin: 0;
  min-height: 100%;
  background: #01030c;
  color: #f7f9ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body.aeos-login *,
body.aeos-login *::before,
body.aeos-login *::after {
  box-sizing: border-box;
}

body.aeos-login {
  overflow-x: hidden;
}

/* ---------- Loader ----------
   Visuals are the canonical AEOS loader (public/css/simple-loader.css, markup in
   views/v2/partials/app-loader.ejs). Only the page-reveal behaviour lives here. */

/* The page stays hidden while the loader runs, then fades in when v2-login.js clears .loader-active. */
.aeos-login__page {
  transition: opacity 420ms ease;
}

body.loader-active .aeos-login__page {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Environment ---------- */

.aeos-login__page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 8%, rgba(47, 108, 255, .24), transparent 27%),
    radial-gradient(circle at 88% 22%, rgba(114, 82, 255, .14), transparent 25%),
    radial-gradient(circle at 18% 78%, rgba(25, 150, 210, .10), transparent 27%),
    linear-gradient(180deg, #010514 0%, #020817 50%, #01040d 100%);
}

/* Circuit lines */
.aeos-login__page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: .30;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, transparent 0 18%, rgba(58, 138, 255, .10) 18% 18.4%, transparent 18.4%),
    linear-gradient(0deg, transparent 0 77%, rgba(58, 138, 255, .08) 77% 77.3%, transparent 77.3%);
  background-size: 150px 175px, 210px 190px;
  -webkit-mask-image: linear-gradient(#000 0 65%, transparent);
  mask-image: linear-gradient(#000 0 65%, transparent);
}

/* Diagonal traces + node dots */
.aeos-login__page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .22;
  background:
    linear-gradient(135deg, transparent 0 30%, rgba(48, 130, 255, .11) 30% 30.5%, transparent 30.5% 100%) 0 20px / 210px 210px,
    radial-gradient(circle, rgba(56, 189, 248, .85) 0 1px, transparent 1.4px) 0 0 / 92px 108px;
}

.aeos-login__shell {
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px 16px 20px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- Brand ---------- */

.aeos-login__brand {
  text-align: center;
  margin: 0 0 24px;
}

/* Systemmark: public/images/favicon_io/android-chrome-512x512.png (ring + "A", transparent), drawn
   straight onto the page with a soft spectrum glow behind it — no tile. */
.aeos-login__mark {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto 10px;
}

.aeos-login__mark::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  filter: blur(22px);
  opacity: .75;
  background: conic-gradient(from 200deg, transparent, rgba(47, 108, 255, .34), rgba(114, 82, 255, .30), rgba(240, 183, 66, .22), transparent);
}

.aeos-login__mark img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.aeos-login__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: .24em;
  text-indent: .24em; /* balances the trailing letter-space so the label centers optically */
  font-weight: 600;
  color: #dfe7f6;
}

.aeos-login__journey {
  margin-top: 6px;
  color: #8496b3;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- Form sheet ---------- */

.aeos-login__card {
  position: relative;
  padding: 20px 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(132, 166, 222, .10);
  background: rgba(7, 15, 31, .74);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .34);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.aeos-login__heading {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 650;
  text-align: center;
  color: #f7f9ff;
}

/* ---------- Notices (server-rendered errors / password-changed) ---------- */

.aeos-login__alert {
  list-style: none;
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid rgba(248, 113, 113, .34);
  border-radius: 12px;
  background: rgba(239, 68, 68, .09);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.45;
}

.aeos-login__alert li + li {
  margin-top: 4px;
}

.aeos-login__alert--success {
  border-color: rgba(111, 191, 138, .35);
  background: rgba(111, 191, 138, .10);
  color: #b7e6c6;
}

.aeos-login__resend {
  margin: -6px 0 16px;
}

.aeos-login__resend button {
  padding: 0;
  border: 0;
  background: none;
  color: #9db8ff;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Form ---------- */

.aeos-login__field {
  margin-bottom: 14px;
}

.aeos-login__label {
  display: block;
  margin-bottom: 7px;
  color: #c6d1e3;
  font-size: 12px;
  font-weight: 650;
}

.aeos-login__input-wrap {
  position: relative;
}

/* 16px text: anything smaller makes iOS Safari zoom the page when the field is focused. */
.aeos-login__input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(139, 166, 211, .17);
  border-radius: 12px;
  outline: 0;
  background: rgba(1, 7, 18, .64);
  color: #f7f9ff;
  font: inherit;
  font-size: 16px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.aeos-login__input::placeholder {
  color: #6f7e97;
}

.aeos-login__input:focus {
  border-color: rgba(91, 120, 255, .75);
  box-shadow: 0 0 0 3px rgba(58, 97, 255, .16), 0 0 22px rgba(87, 75, 255, .08);
}

.aeos-login__input-wrap .aeos-login__input {
  padding-right: 52px;
}

.aeos-login__toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 35px;
  height: 35px;
  padding: 0;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8192ab;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.aeos-login__toggle:hover {
  color: #c6d1e3;
}

.aeos-login__toggle svg {
  width: 18px;
  height: 18px;
}

.aeos-login__toggle:focus-visible,
.aeos-login__submit:focus-visible,
.aeos-login__cta a:focus-visible,
.aeos-login__resend button:focus-visible {
  outline: 2px solid #9db8ff;
  outline-offset: 2px;
}

.aeos-login__submit {
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  background: linear-gradient(110deg, #2f6cff 0%, #654cf5 58%, #8b4ed9 100%);
  box-shadow: 0 8px 20px rgba(61, 74, 230, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
  -webkit-appearance: none;
  appearance: none;
}

.aeos-login__submit:hover {
  filter: brightness(1.06);
}

.aeos-login__submit:active {
  transform: translateY(1px);
}

.aeos-login__cta {
  margin-top: 16px;
  text-align: center;
  color: #91a2bd;
  font-size: 13px;
}

.aeos-login__cta a {
  color: #c9d8ff;
  text-decoration: none;
  font-weight: 650;
}

.aeos-login__cta a:hover {
  text-decoration: underline;
}

/* ---------- Footer ---------- */

.aeos-login__footer {
  margin-top: 18px;
  text-align: center;
  color: #7a89a1;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .06em;
}

/* ---------- Register additions ---------- */

.aeos-login__hint {
  margin-top: 6px;
  color: #8496b3;
  font-size: 12px;
  line-height: 1.4;
}

/* Native validity states only after the user has interacted (no red on a fresh form). */
.aeos-login__input:user-invalid {
  border-color: rgba(248, 113, 113, .55);
}

.aeos-login__input:user-invalid:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .14);
}

.aeos-login__terms {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 18px;
}

.aeos-login__terms input[type="checkbox"] {
  flex: 0 0 auto;
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 1px solid rgba(139, 166, 211, .34);
  border-radius: 7px;
  background: rgba(1, 7, 18, .64) center / 14px 14px no-repeat;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.aeos-login__terms input[type="checkbox"]:checked {
  border-color: transparent;
  background-color: #4f5cf3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.aeos-login__terms input[type="checkbox"]:focus-visible {
  outline: 2px solid #9db8ff;
  outline-offset: 2px;
}

.aeos-login__terms label {
  color: #c6d1e3;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

/* ---------- Small phones ---------- */

@media (max-width: 370px) {
  .aeos-login__shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .aeos-login__journey {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aeos-login__page,
  .aeos-login__input,
  .aeos-login__submit,
  .aeos-login__terms input[type="checkbox"] {
    transition: none !important;
  }
}
