/*
 * AeroBook sign-in / registration pages (0.6.60) — the dark navy "glass"
 * design from Dara's mockup (gemini-code-….html), rebuilt as plain CSS:
 * the mockup pulled Tailwind and two fonts from public CDNs, which are
 * unreliable to reach from Iran and would be a runtime dependency on
 * someone else's server for the page every user hits first. Mobile-first and
 * fully responsive (her report: the old login/registration pages were "not
 * responsive at all"): one column on phones with the form first, brand +
 * form side by side from 992px. RTL: the brand sits at the right, the form
 * at the left, on wide screens.
 *
 * The ONE stylesheet for every sign-in surface (0.6.65): the panel's sign-in and
 * registration pages (templates/components/auth-layout.php, loaded on those
 * two routes by includes/enqueue.php) and WordPress's own wp-login.php screens
 * that stay native - lost / reset password (includes/setup/login-routing.php
 * loads it there too). The font and the accent colour come from the design
 * tokens (aerobook-tokens.css, loaded first) like the rest of the panel; only
 * the dark glass palette below is this design's own.
 */

body.aero-auth-body {
  margin: 0;
  background: #050b14;
}

.aero-auth,
body.login {
  --auth-bg: #050b14;
  --auth-accent: var(--aero-sidebar-accent, #38bdf8);
  --auth-glass: rgba(15, 23, 42, .68);
  --auth-border: rgba(255, 255, 255, .09);
  --auth-text: #f8fafc;
  --auth-muted: #94a3b8;
  --auth-field: rgba(255, 255, 255, .05);
}

.aero-auth {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--auth-bg);
  color: var(--auth-text);
  font-family: var(--aero-font, system-ui), sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.aero-auth *,
.aero-auth *::before,
.aero-auth *::after {
  box-sizing: border-box;
}

/* The [hidden] attribute must win over the display each component sets
   (the one-time-code field is hidden once its six boxes replace it). */
.aero-auth [hidden] { display: none !important; }

.aero-auth__canvas,
.aero-auth__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.aero-auth__grid {
  opacity: .1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
  background-size: 100px 100px;
}

/* --- Page frame --------------------------------------------------------- */

.aero-auth__main {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: center;
  align-content: center;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3.75rem;
}

/* Phones: the form first, the brand text below it. */
.aero-auth__panel { order: -1; }

@media (min-width: 992px) {
  .aero-auth__main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
    gap: 4rem;
    padding: 2rem 2rem 4rem;
  }
  .aero-auth__panel { order: 0; }
}

.aero-auth__footer {
  position: relative;
  z-index: 1;
  padding: 0 1rem 1rem;
  color: rgba(148, 163, 184, .75);
  font-size: .72rem;
  text-align: center;
}

.aero-auth__footer strong {
  color: var(--auth-muted);
  font-weight: 600;
}

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

.aero-auth__brand {
  text-align: center;
}

.aero-auth__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(59, 130, 246, .25);
  border-radius: 1rem;
  background: rgba(59, 130, 246, .1);
  color: #60a5fa;
  box-shadow: 0 0 30px rgba(56, 189, 248, .1);
}

.aero-auth__mark--logo {
  width: auto;
  height: auto;
  padding: .55rem .9rem;
  border-color: transparent;
  background: #fff;
}

/* The paper-plane icon is always in the markup; with a logo it stays hidden,
   and comes back when the logo file fails to load (aerobook-auth.js). */
.aero-auth__mark--logo svg { display: none; }

.aero-auth__mark img {
  display: block;
  max-width: min(14rem, 100%);
  max-height: 3.25rem;
  width: auto;
  height: auto;
}

.aero-auth__title {
  margin: 0 0 .25rem;
  color: #fff;
  font-size: clamp(1.6rem, 6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.aero-auth__subtitle {
  margin: 0 0 1rem;
  color: rgba(147, 197, 253, .8);
  font-size: clamp(1rem, 3.2vw, 1.4rem);
  font-weight: 300;
}

.aero-auth__lead {
  max-width: 28rem;
  margin: 0 auto;
  color: var(--auth-muted);
  font-size: .88rem;
}

@media (min-width: 992px) {
  .aero-auth__brand { text-align: start; }
  .aero-auth__lead { margin: 0; }
}

/* On a phone the form is the point; keep the brand compact under it. */
@media (max-width: 575.98px) {
  .aero-auth__mark { width: 3.25rem; height: 3.25rem; margin-bottom: .9rem; }
  .aero-auth__lead { font-size: .8rem; }
}

/* --- Glass panel --------------------------------------------------------- */

.aero-auth__panel {
  position: relative;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--auth-border);
  border-radius: 1.75rem;
  background: var(--auth-glass);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

@media (min-width: 576px) {
  .aero-auth__panel { padding: 2rem 2rem 2.25rem; border-radius: 2rem; }
}

.aero-auth__panel--wide {
  max-width: 34rem;
}

@media (min-width: 992px) {
  .aero-auth__panel--wide { max-width: 32rem; }
}

.aero-auth__heading {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
}

/* --- Tabs ---------------------------------------------------------------- */

.aero-auth__tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  padding: .3rem;
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .03);
}

.aero-auth__tab {
  flex: 1;
  padding: .7rem .25rem;
  border: 0;
  border-radius: .75rem;
  background: transparent;
  color: var(--auth-muted);
  font: inherit;
  font-size: .85rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}

.aero-auth__tab:hover { color: #e2e8f0; }

.aero-auth__tab.is-active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.aero-auth__pane[hidden] { display: none; }

.aero-auth__pane {
  animation: aero-auth-fade .4s ease both;
}

@keyframes aero-auth-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* --- Fields --------------------------------------------------------------- */

.aero-auth__field { margin-bottom: 1.15rem; position: relative; }

.aero-auth__label {
  display: block;
  margin: 0 .25rem .45rem;
  color: #cbd5e1;
  font-size: .8rem;
}

.aero-auth__input {
  display: block;
  width: 100%;
  min-height: 3.1rem;
  padding: .8rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1rem;
  background: var(--auth-field);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.aero-auth__input::placeholder { color: rgba(255, 255, 255, .28); }

.aero-auth__input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, .55);
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .12);
}

/* Latin-script values (phone, e-mail, user name, password) read left to
   right even though the page is RTL. */
.aero-auth__input--ltr {
  direction: ltr;
  text-align: left;
  letter-spacing: .04em;
}

.aero-auth__input--ltr::placeholder { text-align: left; }

.aero-auth__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 .9rem;
}

@media (min-width: 480px) {
  .aero-auth__row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.aero-auth__pw {
  position: relative;
}

.aero-auth__pw .aero-auth__input {
  padding-inline-end: 3.1rem;
}

.aero-auth__pw-toggle {
  position: absolute;
  inset-inline-end: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: .75rem;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}

.aero-auth__pw-toggle:hover { color: #fff; }

/* Segmented radios (gender, student / instructor) */
.aero-auth__segments {
  display: flex;
  gap: .4rem;
  padding: .3rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 1rem;
  background: var(--auth-field);
}

.aero-auth__segment {
  position: relative;
  flex: 1;
}

.aero-auth__segment input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.aero-auth__segment span {
  display: block;
  padding: .6rem .4rem;
  border-radius: .75rem;
  color: var(--auth-muted);
  font-size: .9rem;
  text-align: center;
  transition: background-color .2s ease, color .2s ease;
}

.aero-auth__segment input:checked + span {
  background: rgba(56, 189, 248, .18);
  color: #fff;
  font-weight: 600;
}

.aero-auth__segment input:focus-visible + span {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

.aero-auth__check {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--auth-muted);
  font-size: .82rem;
  cursor: pointer;
}

.aero-auth__check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #38bdf8;
}

/* Honeypot: hidden from a person, present for a bot's form parser. */
.aero-auth__hp {
  position: absolute !important;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Buttons & links ------------------------------------------------------ */

.aero-auth__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 3.2rem;
  margin-top: 1.4rem;
  padding: 1rem 1.25rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, .4);
  transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease;
}

.aero-auth__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(37, 99, 235, .5);
}

.aero-auth__btn:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}

.aero-auth__btn svg { flex: none; transform: scaleX(-1); }

.aero-auth__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--auth-muted);
  font: inherit;
  font-size: .78rem;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease;
}

.aero-auth__link:hover { color: #fff; }

.aero-auth__meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.aero-auth__meta small { display: block; color: var(--auth-muted); font-size: .72rem; }
.aero-auth__meta strong { color: #93c5fd; font-weight: 600; direction: ltr; unicode-bidi: plaintext; letter-spacing: .08em; }

.aero-auth__hint {
  margin: .9rem 0 0;
  color: var(--auth-muted);
  font-size: .76rem;
  text-align: center;
}

.aero-auth__hint--start {
  margin-top: .6rem;
  text-align: start;
}

.aero-auth__hint a { text-decoration: underline; text-underline-offset: 3px; }

.aero-auth__forgot {
  display: block;
  margin-top: .55rem;
  text-align: end;
}

/* "Send the code again" under the code form — dimmed and counting down until it is allowed. */
.aero-auth__resend {
  margin-top: 1rem;
  text-align: center;
}

.aero-auth__resend .aero-auth__link { font-size: .82rem; }

.aero-auth__resend .aero-auth__link:disabled {
  color: rgba(148, 163, 184, .6);
  cursor: default;
}

/* --- Alerts ---------------------------------------------------------------- */

.aero-auth__alert {
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: .9rem;
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
  font-size: .85rem;
}

.aero-auth__alert--ok {
  border-color: rgba(74, 222, 128, .35);
  background: rgba(34, 197, 94, .12);
  color: #bbf7d0;
}

/* --- One-time code: six boxes (built by aerobook-auth.js from a single input) --- */

.aero-auth__otp {
  display: flex;
  gap: .5rem;
  justify-content: space-between;
  direction: ltr;
  margin-bottom: 1.25rem;
}

.aero-auth__otp-box {
  flex: 1 1 0;
  min-width: 0;
  max-width: 3.75rem;
  height: 3.9rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1rem;
  background: var(--auth-field);
  color: #fff;
  font: inherit;
  font-size: 1.6rem;
  text-align: center;
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.aero-auth__otp-box:focus {
  outline: none;
  border-color: var(--auth-accent);
  background: rgba(56, 189, 248, .06);
  box-shadow: 0 0 15px rgba(56, 189, 248, .2);
  transform: translateY(-2px);
}

.aero-auth__otp-box.is-wrong { border-color: #f87171; }

/* Without JavaScript the single input stays visible as a plain code field. */
.aero-auth__code-input {
  text-align: center;
  direction: ltr;
  font-size: 1.5rem;
  letter-spacing: .5em;
}

@media (max-width: 359.98px) {
  .aero-auth__otp { gap: .3rem; }
  .aero-auth__otp-box { height: 3.3rem; font-size: 1.3rem; border-radius: .8rem; }
}

/* --- Motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .aero-auth__canvas { display: none; }
  .aero-auth__pane { animation: none; }
  .aero-auth__btn,
  .aero-auth__otp-box { transition: none; }
}

/* --- WordPress's own screens (wp-login.php) -------------------------------
   Lost / reset password and the other flows that stay native are drawn in the
   same glass card as the panel's page, from the same variables. */

body.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 2rem 1rem;
  background: var(--auth-bg);
  color: var(--auth-text);
  font-family: var(--aero-font, system-ui), sans-serif;
  line-height: 1.7;
}

body.login #login {
  width: 100%;
  max-width: 26rem;
  margin: 0;
  padding: 0;
}

body.login h1 {
  margin: 0 0 1.25rem;
  text-align: center;
}

body.login h1 a {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  background: none;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  text-indent: 0;
}

body.login h1 a:focus { outline: 2px solid var(--auth-accent); box-shadow: none; }

body.login form {
  margin: 0;
  padding: 1.75rem 1.5rem 1.9rem;
  overflow: visible;
  border: 1px solid var(--auth-border);
  border-radius: 1.75rem;
  background: var(--auth-glass);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

body.login label {
  color: #cbd5e1;
  font-size: .8rem;
}

body.login input[type="text"],
body.login input[type="password"],
body.login input[type="email"],
body.login input.input {
  min-height: 3.1rem;
  margin: .35rem 0 1rem;
  padding: .8rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1rem;
  background: var(--auth-field);
  color: #fff;
  font-size: 1rem;
  box-shadow: none;
}

body.login input[type="text"]:focus,
body.login input[type="password"]:focus,
body.login input[type="email"]:focus {
  border-color: rgba(56, 189, 248, .55);
  outline: 0;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .12);
}

body.login p.submit { margin: 0; }

body.login .button-primary,
body.login .button.button-primary {
  float: none;
  width: 100%;
  height: auto;
  min-height: 3.2rem;
  margin-top: .5rem;
  padding: 1rem 1.25rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: none;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, .4);
  cursor: pointer;
}

body.login .button-primary:hover,
body.login .button-primary:focus {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  filter: brightness(1.08);
}

body.login .button-secondary {
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: .75rem;
  background: transparent;
  color: #cbd5e1;
  box-shadow: none;
}

body.login .button-secondary:hover,
body.login .button-secondary:focus {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

body.login .message,
body.login .notice,
body.login #login_error {
  margin: 0 0 1.25rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(56, 189, 248, .35);
  border-radius: .9rem;
  background: rgba(56, 189, 248, .1);
  color: #bae6fd;
  font-size: .85rem;
  box-shadow: none;
}

body.login #login_error,
body.login .notice-error {
  border-color: rgba(248, 113, 113, .35);
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
}

body.login .notice-success {
  border-color: rgba(74, 222, 128, .35);
  background: rgba(34, 197, 94, .12);
  color: #bbf7d0;
}

body.login #nav,
body.login #backtoblog {
  margin: 1.1rem 0 0;
  padding: 0;
  text-align: center;
  font-size: .8rem;
}

body.login #nav a,
body.login #backtoblog a,
body.login .privacy-policy-page-link a {
  color: var(--auth-muted);
  text-decoration: none;
}

body.login #nav a:hover,
body.login #backtoblog a:hover,
body.login .privacy-policy-page-link a:hover { color: #fff; }

/* The reset screen's new-password field and its strength meter. */
body.login .wp-pwd { position: relative; }

body.login .wp-pwd .button.wp-hide-pw {
  color: var(--auth-muted);
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.login #pass-strength-result {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

body.login .aero-login-credit {
  margin: 2rem 0 0;
  color: rgba(148, 163, 184, .75);
  font-size: .72rem;
  text-align: center;
}

body.login .aero-login-credit strong { color: var(--auth-muted); font-weight: 600; }

/* Busy button (0.6.73) — the shared submit guard (assets/js/aerobook-submit-guard.js)
   disables a pressed button and puts the spinner first until the next page loads. */
.aero-spinner {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  margin-inline-end: .5em;
  vertical-align: -.15em;
  border: .16em solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: aero-spin .7s linear infinite;
}

@keyframes aero-spin { to { transform: rotate(360deg); } }

.aero-auth__btn.is-busy:disabled { opacity: .85; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .aero-spinner { animation-duration: 1.8s; }
}
