:root {
  --auth-navy: #071c36;
  --auth-blue: #123f73;
  --auth-accent: #2876d2;
  --auth-accent-dark: #175cae;
  --auth-border: #d9e4f1;
  --auth-text: #10233e;
  --auth-muted: #667892;
}

body {
  margin: 0;
  background: var(--auth-navy);
}

.fma-auth-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(50, 128, 214, .22), transparent 34%),
    radial-gradient(circle at 85% 78%, rgba(45, 113, 190, .2), transparent 34%),
    linear-gradient(145deg, #06182e 0%, #0b2b50 55%, #0b203a 100%);
  color: var(--auth-text);
}

.fma-auth-backdrop {
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: .32;
}

.fma-auth-backdrop canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fma-auth-glow {
  position: absolute;
  z-index: -2;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(6px);
  opacity: .16;
  background: #61aaf7;
}

.fma-auth-glow--one {
  top: -230px;
  right: -120px;
}

.fma-auth-glow--two {
  bottom: -270px;
  left: -100px;
}

.fma-auth-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.fma-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease, opacity .2s ease;
}

.fma-auth-brand:hover {
  color: #fff;
  opacity: .92;
  transform: translateY(-1px);
}

.fma-auth-brand img {
  width: 58px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .22));
}

.fma-auth-brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.fma-auth-brand strong {
  font-size: 1.12rem;
  letter-spacing: -.01em;
}

.fma-auth-brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, .66);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.fma-auth-card {
  width: 100%;
  padding: 36px 38px 32px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 24px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 26px 70px rgba(0, 10, 27, .34);
  backdrop-filter: blur(18px);
}

.fma-auth-card [hidden] {
  display: none !important;
}

.fma-auth-step {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf5ff;
  color: #246abb;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.fma-auth-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #e8f2ff, #f4f8ff);
  color: #1f6fc9;
  font-size: 1.55rem;
  box-shadow: inset 0 0 0 1px #dbeaff;
}

.fma-auth-card h1 {
  margin: 0;
  color: var(--auth-text);
  text-align: center;
  font-size: clamp(1.45rem, 4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -.035em;
}

.fma-auth-lead {
  max-width: 360px;
  margin: 10px auto 24px;
  color: var(--auth-muted);
  text-align: center;
  font-size: .92rem;
  line-height: 1.55;
}

.fma-auth-lead strong {
  color: #304968;
  overflow-wrap: anywhere;
}

.fma-auth-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -10px 0 20px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #f1f7ff;
  color: #426484;
  font-size: .8rem;
  line-height: 1.4;
}

.fma-auth-note i {
  margin-top: 1px;
  color: #2672c9;
  font-size: 1rem;
}

.fma-auth-form {
  display: grid;
  gap: 10px;
}

.fma-auth-form label {
  margin: 0;
  color: #273d5b;
  font-size: .82rem;
  font-weight: 750;
}

.fma-auth-input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid var(--auth-border);
  border-radius: 13px;
  outline: none;
  background: #fbfdff;
  color: #132945;
  font-size: .95rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.fma-auth-input:hover {
  border-color: #bfd1e5;
}

.fma-auth-input:focus {
  border-color: #4b8fd9;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(43, 118, 204, .12);
}

.fma-auth-field-icon,
.fma-auth-password {
  position: relative;
}

.fma-auth-field-icon > i {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: #7790ad;
  font-size: 1.05rem;
}

.fma-auth-field-icon .fma-auth-input {
  padding-left: 45px;
}

.fma-auth-password .fma-auth-input {
  padding-right: 52px;
}

.fma-auth-password .password-addon {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  border: 0;
  background: transparent;
  color: #7589a4;
  font-size: 1.05rem;
}

.fma-auth-code {
  height: 58px;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: .42em;
  padding-left: calc(15px + .42em);
}

.fma-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  margin-top: 10px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  color: #fff;
  font-size: .92rem;
  font-weight: 750;
  box-shadow: 0 10px 22px rgba(34, 106, 190, .22);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.fma-auth-submit:hover {
  color: #fff;
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 13px 26px rgba(34, 106, 190, .28);
}

.fma-auth-submit:active {
  transform: translateY(0);
}

.fma-auth-links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.fma-auth-links a,
.fma-auth-secondary,
.fma-auth-link-button {
  color: #5a718e;
  font-size: .8rem;
  font-weight: 650;
  text-decoration: none;
}

.fma-auth-links a:hover,
.fma-auth-secondary:hover,
.fma-auth-link-button:hover {
  color: #1769c1;
}

.fma-auth-link-button,
.fma-auth-secondary--button {
  display: block;
  margin: 19px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.fma-auth-secondary {
  display: block;
  width: fit-content;
  margin: 19px auto 0;
}

.fma-auth-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 3px 0 0;
  color: #6f8199;
  font-size: .8rem;
}

.fma-auth-timer strong {
  color: #31577f;
  font-variant-numeric: tabular-nums;
}

.fma-auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 18px;
  padding: 12px 13px;
  border-radius: 12px;
  font-size: .82rem;
  line-height: 1.4;
}

.fma-auth-alert i {
  margin-top: 1px;
  font-size: 1.05rem;
}

.fma-auth-alert--danger {
  border: 1px solid #f1c9cb;
  background: #fff2f2;
  color: #9d3238;
}

.fma-auth-alert--local {
  border: 1px solid #efd579;
  background: #fff7d9;
  color: #725207;
}

.fma-auth-alert--success {
  border: 1px solid #bfe4d1;
  background: #effbf5;
  color: #28704b;
}

.fma-auth-footer {
  color: rgba(255, 255, 255, .55);
  font-size: .74rem;
  text-align: center;
}

@media (max-width: 575.98px) {
  .fma-auth-page {
    align-items: start;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 24px 14px;
  }

  .fma-auth-shell {
    gap: 18px;
  }

  .fma-auth-brand img {
    width: 48px;
    height: 62px;
  }

  .fma-auth-brand strong {
    font-size: 1rem;
  }

  .fma-auth-brand small {
    font-size: .67rem;
  }

  .fma-auth-card {
    padding: 28px 22px 25px;
    border-radius: 20px;
  }

  .fma-auth-links {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-height: 720px) and (min-width: 576px) {
  .fma-auth-page {
    align-items: start;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .fma-auth-shell {
    gap: 16px;
  }

  .fma-auth-card {
    padding-top: 26px;
    padding-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fma-auth-brand,
  .fma-auth-input,
  .fma-auth-submit {
    transition: none;
  }
}
