/**
 * Axos Peptides — wp-login.php redesign
 * Loaded ONLY on the login screen via login_enqueue_scripts (see login/axos-login.php).
 * Pure presentation: never touches form fields, nonces, or auth logic.
 * Scoped to body.login.axos-login so nothing leaks into /wp-admin or the front-end.
 *
 * Layout: TRUE 50/50 — form LEFT, brand image RIGHT, divided by a hairline.
 * Form column: three-zone rhythm (wordmark top / form centered / legal bottom).
 * Brand column: content fills the width, vertically balanced (brand top /
 * message centered / disclaimer bottom), even padding all around.
 * Below 1024px the brand panel is hidden entirely — form only.
 */

/* ============================================================== *
 * 0. TOKENS & EASING
 * ============================================================== */
body.login.axos-login {
  --bg:            #09090A;
  --bg-secondary:  #0D0D0D;
  --surface:       #111111;
  --elevated:      #1A1A1A;
  --border:        rgba(255, 255, 255, 0.08);
  --border-hover:  rgba(255, 255, 255, 0.15);
  --divider:       rgba(255, 255, 255, 0.14);
  --text:          #FFFFFF;
  --text-2:        rgba(255, 255, 255, 0.55);
  --text-3:        rgba(255, 255, 255, 0.30);
  --lime:          #CBFF0F;
  --lime-hover:    #D4FF3A;
  --danger:        #FF5C5C;

  --font-display:  'Sora', system-ui, sans-serif;
  --font-label:    'Instrument Sans', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, monospace;

  --ease-out:      cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out:   cubic-bezier(0.77, 0, 0.175, 1);
}

/* ============================================================== *
 * 1. RESET / PAGE SHELL / 50-50 SPLIT  (form left, image right)
 * ============================================================== */
html { background: #09090A; }

body.login.axos-login {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "form panel";
}

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

/* Stray wp-login children kept out of the grid flow */
body.login.axos-login > .clear { display: none; }
body.login.axos-login > #language-switcher {
  position: fixed;
  inset: auto 16px 16px auto;
  z-index: 5;
  opacity: 0.5;
}

/* ============================================================== *
 * 2. FORM COLUMN (left) — three-zone vertical rhythm, centered
 * ============================================================== */
body.login.axos-login #login {
  grid-area: form;
  align-self: stretch;
  justify-self: center;
  width: 100%;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0;
  padding: clamp(40px, 5vh, 72px) clamp(28px, 3vw, 56px);

  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center the whole form stack */
}

/* --- wordmark (WP h1 a) rebuilt as text --- */
body.login.axos-login h1 { margin: 0 0 34px; }
body.login.axos-login h1 a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto; height: auto;
  background: none;
  text-indent: 0;
  overflow: visible;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s ease;
}
body.login.axos-login h1 a::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
}
body.login.axos-login h1 a:hover { color: var(--text); }

/* --- intro above the form --- */
.axos-login-intro { margin-bottom: 28px; }
.axos-login-intro .axos-login-kicker {
  display: inline-block;
  margin: 0 0 16px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
}
.axos-login-intro h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text);
}
.axos-login-intro p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}

/* --- messages / errors --- */
body.login.axos-login .message,
body.login.axos-login .notice,
body.login.axos-login #login_error {
  margin: 0 0 20px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--lime);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.8);
}
body.login.axos-login #login_error {
  border-left-color: var(--danger);
  color: #ffd7d7;
}
body.login.axos-login #login_error a,
body.login.axos-login .message a { color: var(--lime); }

/* --- the form (reset applies to login, lostpassword, register, resetpass) --- */
body.login.axos-login form {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
body.login.axos-login #loginform {
  display: flex;
  flex-direction: column;
}
/* register confirmation note */
body.login.axos-login .reg_passmail {
  margin: 0 0 18px;
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}
/* logical order regardless of DOM order */
body.login.axos-login #loginform > p:first-child { order: 1; }   /* username */
body.login.axos-login #loginform .user-pass-wrap { order: 2; }    /* password */
body.login.axos-login #loginform .forgetmenot   { order: 3; }
body.login.axos-login #loginform .submit        { order: 4; }
body.login.axos-login #loginform .axos-login-aux { order: 5; }

body.login.axos-login #loginform > p,
body.login.axos-login #loginform .user-pass-wrap,
body.login.axos-login #lostpasswordform > p,
body.login.axos-login #registerform > p,
body.login.axos-login #resetpassform > p { margin: 0 0 18px; }

body.login.axos-login #loginform label {
  display: block;
  margin: 0 0 8px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  line-height: 1.4;
}

body.login.axos-login input[type="text"],
body.login.axos-login input[type="password"],
body.login.axos-login input[type="email"] {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 16px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 52px;
  box-shadow: none;
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background-color 0.18s ease;
}
body.login.axos-login input::placeholder { color: var(--text-3); }
body.login.axos-login input[type="text"]:hover,
body.login.axos-login input[type="password"]:hover,
body.login.axos-login input[type="email"]:hover { border-color: var(--border-hover); }
body.login.axos-login input[type="text"]:focus,
body.login.axos-login input[type="password"]:focus,
body.login.axos-login input[type="email"]:focus {
  outline: none;
  border-color: var(--lime);
  background: #1d1d1d;
  box-shadow: 0 0 0 3px rgba(203,255,15,0.22);
}

/* password show/hide */
body.login.axos-login .wp-pwd { position: relative; }
body.login.axos-login .wp-pwd input { padding-right: 50px; }
body.login.axos-login .wp-pwd .button.wp-hide-pw {
  position: absolute;
  top: 0; right: 0;
  height: 52px; width: 48px;
  margin: 0; padding: 0;
  background: transparent;
  border: 0; box-shadow: none;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.18s ease;
}
body.login.axos-login .wp-pwd .button.wp-hide-pw:hover { color: var(--lime); }
body.login.axos-login .wp-pwd .button.wp-hide-pw:focus { outline: none; box-shadow: none; }
body.login.axos-login .wp-pwd .dashicons { width: 20px; height: 20px; font-size: 20px; }

/* remember me */
body.login.axos-login .forgetmenot {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-label);
}
body.login.axos-login .forgetmenot input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  margin: 0;
  border: 1px solid var(--border-hover);
  border-radius: 5px;
  background: var(--elevated);
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
body.login.axos-login .forgetmenot input[type="checkbox"]:checked {
  background: var(--lime);
  border-color: var(--lime);
}
body.login.axos-login .forgetmenot input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1.5px;
  width: 5px; height: 9px;
  border: solid #09090A;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
body.login.axos-login .forgetmenot input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(203,255,15,0.22);
}
body.login.axos-login .forgetmenot label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-2);
  cursor: pointer;
}

/* primary CTA — white pill with nested arrow */
body.login.axos-login .submit { margin: 6px 0 0; }
body.login.axos-login #wp-submit {
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background-color: #FFFFFF;
  color: #09090A;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='20' fill='%2309090A'/%3E%3Cpath d='M16 20h9M21 16l4 4-4 4' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 40px 40px;
  padding-right: 58px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
  transition: transform 0.16s var(--ease-out), box-shadow 0.22s ease, background-position 0.22s var(--ease-out);
}
body.login.axos-login #wp-submit:active { transform: scale(0.985); }

/* nav (lost password / register) — bottom zone */
body.login.axos-login #nav,
body.login.axos-login #backtoblog {
  margin: 0;
  padding: 0;
  text-align: left;
  font-family: var(--font-label);
  font-size: 12.5px;
}
body.login.axos-login #nav {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
body.login.axos-login #nav a,
body.login.axos-login #backtoblog a {
  color: var(--text-2);
  transition: color 0.18s ease;
}
body.login.axos-login #nav a:hover,
body.login.axos-login #backtoblog a:hover { color: var(--text); }
body.login.axos-login #backtoblog { margin-top: 12px; }
body.login.axos-login #backtoblog a { color: var(--text-3); font-size: 12px; }

/* injected aux block: security note + create-account */
.axos-login-aux { margin: 20px 0 0; }
.axos-login-secure {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--text-3);
}
.axos-login-secure svg { width: 13px; height: 13px; stroke: var(--text-3); fill: none; stroke-width: 1.5; }
.axos-login-create {
  margin: 0;
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--text-2);
}
.axos-login-create a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--lime);
  padding-bottom: 1px;
  transition: color 0.18s ease;
}
.axos-login-create a:hover { color: var(--lime); }

/* privacy-policy link WP may print */
body.login.axos-login .privacy-policy-page-link { margin-top: 16px; }
body.login.axos-login .privacy-policy-page-link a { color: var(--text-3); font-size: 12px; }

/* ============================================================== *
 * 3. BRAND PANEL (right) — image, content fills width + balanced
 * ============================================================== */
.axos-login-panel {
  grid-area: panel;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(48px, 5vw, 88px);
  isolation: isolate;
  background: var(--bg);
  border-left: 1px solid var(--divider);
}

/* Image layer + legibility scrim. --axos-login-img is set inline by functions.php. */
.axos-login-panel__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: #060607;
  background-image:
    linear-gradient(180deg, rgba(9,9,10,0.55) 0%, rgba(9,9,10,0.32) 38%, rgba(9,9,10,0.85) 100%),
    var(--axos-login-img, none);
  background-size: cover;
  background-position: center;
  filter: saturate(1.05) contrast(1.02);
}

/* Film grain — contained to the panel, never on a scroller */
.axos-login-panel__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Lime depth glow */
.axos-login-panel__orb {
  position: absolute;
  z-index: -1;
  width: 52%;
  aspect-ratio: 1;
  right: -12%;
  bottom: -14%;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(203,255,15,0.18), rgba(203,255,15,0) 68%);
  filter: blur(46px);
  will-change: transform;
}

/* content fills the panel, distributes brand top / message centered / legal bottom */
.axos-login-panel__content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* --- brand lockup (top) --- */
.axos-login-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.axos-login-brand__sub {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-2);
  transform: translateY(-1px);
}
.axos-login-brand__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  align-self: center;
  box-shadow: 0 0 16px rgba(203,255,15,0.7);
}

/* --- mid: headline + trust — vertically centered, fills width --- */
.axos-login-panel__mid {
  margin: auto 0;
  width: 100%;
}

.axos-login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(6px);
}
.axos-login-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
}

.axos-login-headline {
  margin: 0 0 22px;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 3.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
}

.axos-login-subline {
  margin: 0 0 40px;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

.axos-login-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.axos-login-trust li {
  display: flex;
  align-items: center;
  gap: 13px;
  font-family: var(--font-label);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.80);
}
.axos-login-trust svg {
  width: 19px; height: 19px;
  flex: none;
  stroke: var(--lime);
  stroke-width: 1.5;
  fill: none;
}

/* --- disclaimer (bottom) --- */
.axos-login-disclaimer {
  margin: 0;
  max-width: 56ch;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--text-3);
}

/* ============================================================== *
 * 4. MOTION
 * ============================================================== */
@keyframes axosFadeUp {
  from { opacity: 0; transform: translateY(12px); filter: blur(5px); }
  to   { opacity: 1; transform: none;             filter: none; }
}
@keyframes axosOrbFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-4%, -5%, 0); }
}

/* entrance — form column */
body.login.axos-login h1,
body.login.axos-login .axos-login-intro,
body.login.axos-login #loginform > p:first-child,
body.login.axos-login #loginform .user-pass-wrap,
body.login.axos-login #loginform .forgetmenot,
body.login.axos-login #loginform .submit,
body.login.axos-login #loginform .axos-login-aux,
body.login.axos-login #nav,
body.login.axos-login #backtoblog {
  animation: axosFadeUp 0.6s var(--ease-out) both;
}
body.login.axos-login h1                              { animation-delay: 0.02s; }
body.login.axos-login .axos-login-intro              { animation-delay: 0.07s; }
body.login.axos-login #loginform > p:first-child     { animation-delay: 0.13s; }
body.login.axos-login #loginform .user-pass-wrap     { animation-delay: 0.18s; }
body.login.axos-login #loginform .forgetmenot        { animation-delay: 0.23s; }
body.login.axos-login #loginform .submit             { animation-delay: 0.28s; }
body.login.axos-login #loginform .axos-login-aux     { animation-delay: 0.33s; }
body.login.axos-login #nav                           { animation-delay: 0.38s; }
body.login.axos-login #backtoblog                    { animation-delay: 0.42s; }

/* entrance — brand panel */
.axos-login-brand,
.axos-login-panel__mid > *,
.axos-login-disclaimer {
  animation: axosFadeUp 0.7s var(--ease-out) both;
}
.axos-login-brand                 { animation-delay: 0.05s; }
.axos-login-eyebrow               { animation-delay: 0.12s; }
.axos-login-headline              { animation-delay: 0.18s; }
.axos-login-subline               { animation-delay: 0.24s; }
.axos-login-trust                 { animation-delay: 0.30s; }
.axos-login-disclaimer            { animation-delay: 0.36s; }

.axos-login-panel__orb { animation: axosOrbFloat 16s var(--ease-in-out) infinite; }

/* hover physics — pointer devices only */
@media (hover: hover) and (pointer: fine) {
  body.login.axos-login #wp-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px -14px rgba(255,255,255,0.32);
    background-position: right 4px center;
  }
  body.login.axos-login .axos-login-trust li { transition: color 0.2s ease; }
  body.login.axos-login .axos-login-trust li:hover { color: #fff; }
}

/* ============================================================== *
 * 5. RESPONSIVE  — below 1024px: form only, no brand panel
 * ============================================================== */
@media (max-width: 1023px) {
  body.login.axos-login {
    grid-template-columns: 1fr;
    grid-template-areas: "form";
  }
  .axos-login-panel { display: none; }
  body.login.axos-login #login {
    max-width: 460px;
    justify-self: center;
  }
}

@media (max-width: 600px) {
  body.login.axos-login #login { padding: 36px 22px; }
  .axos-login-intro h2 { font-size: 30px; }
}

/* ============================================================== *
 * 6. REDUCED MOTION + FORCED COLORS
 * ============================================================== */
@media (prefers-reduced-motion: reduce) {
  body.login.axos-login *,
  .axos-login-panel * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.08s !important;
  }
  .axos-login-panel__orb { animation: none; }
  @keyframes axosFadeUp { from { opacity: 0; } to { opacity: 1; } }
}

@media (forced-colors: active) {
  body.login.axos-login #wp-submit { border: 1px solid; }
  body.login.axos-login input { border: 1px solid; }
}
