.auth-page {
  display: grid;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(172, 122, 32, 0.16), transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(120, 83, 22, 0.09), transparent 28%),
    #08090a;
}

.auth-page::before {
  background:
    linear-gradient(rgba(217, 166, 69, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 166, 69, 0.025) 1px, transparent 1px);
  background-size: 74px 74px;
  filter: none;
  animation: none;
}

.auth-page::after {
  opacity: 0.2;
}

.auth-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-ambient::before,
.auth-ambient::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(207, 157, 60, 0.09);
  border-radius: 50%;
  transform: rotateX(68deg) rotateZ(-12deg);
}

.auth-ambient::before {
  bottom: -270px;
  left: -180px;
  width: 720px;
  height: 720px;
  box-shadow: 0 0 80px rgba(170, 113, 25, 0.035);
}

.auth-ambient::after {
  top: -240px;
  right: -140px;
  width: 580px;
  height: 580px;
}

.auth-ambient i {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #d9a743;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(230, 177, 68, 0.72);
  animation: auth-particle-float 7s ease-in-out infinite alternate;
}

.auth-ambient i:nth-child(1) { top: 24%; left: 15%; }
.auth-ambient i:nth-child(2) { top: 70%; right: 17%; animation-delay: -2.5s; }
.auth-ambient i:nth-child(3) { top: 42%; right: 9%; animation-delay: -4.2s; }
.auth-ambient i:nth-child(4) { top: 12%; right: 28%; width: 3px; height: 3px; animation-delay: -1.1s; }
.auth-ambient i:nth-child(5) { top: 83%; left: 27%; width: 5px; height: 5px; animation-delay: -5.3s; }
.auth-ambient i:nth-child(6) { top: 56%; left: 8%; width: 3px; height: 3px; animation-delay: -3.6s; }
.auth-ambient i:nth-child(7) { top: 18%; right: 7%; animation-delay: -6.1s; }
.auth-ambient i:nth-child(8) { top: 88%; right: 35%; width: 3px; height: 3px; animation-delay: -2s; }
.auth-ambient i:nth-child(9) { top: 38%; left: 6%; width: 5px; height: 5px; animation-delay: -4.8s; }
.auth-ambient i:nth-child(10) { top: 67%; left: 20%; width: 3px; height: 3px; animation-delay: -6.7s; }

.auth-ambient i:nth-child(3n + 1) { animation-duration: 8.6s; }
.auth-ambient i:nth-child(3n + 2) { animation-duration: 6.8s; }

@keyframes auth-particle-float {
  to { opacity: 0.28; transform: translate3d(18px, -22px, 0) scale(0.72); }
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(calc(100% - 40px), 620px);
  min-height: 100svh;
  margin-inline: auto;
  padding: 42px 0 28px;
}

.auth-brand {
  position: relative;
  width: 156px;
  margin-bottom: 20px;
  padding: 4px 2px 10px;
  transition: filter 260ms ease, transform 260ms ease;
}

.auth-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-brand:hover,
.auth-brand:focus-visible {
  filter:
    drop-shadow(0 0 6px rgba(255, 232, 181, 0.2))
    drop-shadow(0 0 14px rgba(238, 173, 35, 0.28));
  transform: translateY(-2px);
}

.account-card {
  position: relative;
  width: 100%;
  padding: clamp(26px, 5vw, 42px);
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(222, 169, 68, 0.055), transparent 28%),
    linear-gradient(145deg, rgba(17, 18, 20, 0.97), rgba(10, 11, 13, 0.98));
  border: 1px solid rgba(210, 163, 72, 0.3);
  border-radius: 24px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 232, 183, 0.012) inset,
    0 18px 55px rgba(171, 114, 23, 0.035);
  isolation: isolate;
}

.account-card::before {
  position: absolute;
  top: 0;
  right: 9%;
  left: 9%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 160, 0.72), transparent);
  box-shadow: 0 0 13px rgba(227, 174, 67, 0.35);
  content: "";
}

.account-card__shine {
  position: absolute;
  top: -90px;
  left: -130px;
  z-index: -1;
  width: 320px;
  height: 210px;
  background: radial-gradient(ellipse, rgba(224, 169, 62, 0.08), transparent 70%);
  transform: rotate(-18deg);
}

.account-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.account-card__eyebrow {
  margin: 0 0 6px;
  color: #c99a42;
  font-size: 0.78rem;
}

.account-card h1 {
  margin: 0 0 7px;
  color: #f4f1eb;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  line-height: 1.5;
}

.account-card__header p:last-child {
  margin: 0;
  color: #9f9c95;
  font-size: 0.82rem;
  line-height: 1.9;
}

.security-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  color: #ddd8cf;
  font-size: 0.8rem;
  background: rgba(14, 15, 17, 0.66);
  border: 1px solid rgba(163, 158, 149, 0.2);
  border-radius: 999px;
}

.security-badge i {
  width: 9px;
  height: 9px;
  background: #d6a13e;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(221, 164, 53, 0.65);
}

.account-form {
  display: grid;
  gap: 19px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  color: #c9c5bd;
  font-size: 0.81rem;
  font-weight: 520;
}

.form-control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  overflow: hidden;
  background: rgba(11, 12, 14, 0.78);
  border: 1px solid rgba(143, 148, 156, 0.22);
  border-radius: 13px;
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.form-control:focus-within {
  background: rgba(13, 14, 16, 0.96);
  border-color: rgba(222, 174, 77, 0.62);
  box-shadow:
    0 0 0 3px rgba(199, 145, 42, 0.07),
    0 9px 24px rgba(0, 0, 0, 0.16);
}

.form-control input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 15px;
  color: #f1eee8;
  font: inherit;
  font-size: 0.9rem;
  background: transparent;
  border: 0;
  outline: 0;
}

.form-control input::placeholder {
  color: #6f7074;
}

.form-control--password input {
  padding-left: 56px;
}

.password-toggle {
  position: absolute;
  top: 7px;
  right: auto;
  left: 7px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #bdbab3;
  background: rgba(40, 42, 46, 0.48);
  border: 1px solid rgba(144, 148, 156, 0.18);
  border-radius: 10px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.password-toggle span {
  position: relative;
  display: block;
  width: 17px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 50% / 60%;
}

.password-toggle span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle[aria-pressed="true"] {
  color: #f0cb79;
  background: rgba(183, 129, 33, 0.1);
  border-color: rgba(216, 164, 65, 0.4);
}

.password-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  height: 2px;
}

.password-meter i {
  background: rgba(134, 134, 134, 0.18);
  border-radius: 999px;
  transition: background 220ms ease, box-shadow 220ms ease;
}

.password-meter[data-strength="1"] i:nth-child(-n + 1),
.password-meter[data-strength="2"] i:nth-child(-n + 2),
.password-meter[data-strength="3"] i:nth-child(-n + 3),
.password-meter[data-strength="4"] i:nth-child(-n + 4) {
  background: #d8a445;
  box-shadow: 0 0 7px rgba(216, 164, 69, 0.34);
}

.form-field small {
  min-height: 18px;
  color: #777772;
  font-size: 0.7rem;
  line-height: 1.7;
}

.password-match.is-error { color: #d78678; }
.password-match.is-valid { color: #b9c98e; }

.auth-layout--login {
  width: min(calc(100% - 40px), 580px);
}

.account-card--login {
  padding-block: clamp(30px, 5vw, 44px);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: -5px;
}

.login-options > a {
  color: #d5a64d;
  font-size: 0.76rem;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.login-options > a:hover,
.login-options > a:focus-visible {
  color: #f2ce7d;
  text-shadow: 0 0 10px rgba(218, 165, 65, 0.26);
}

.remember-check {
  flex: 0 0 auto;
  align-items: center;
}

.remember-check > span {
  margin-top: 0;
}

.remember-check b {
  color: #a09d96;
  white-space: nowrap;
}

.account-form__help {
  margin-top: -7px;
}

.account-form__help a {
  color: #d5a64d;
  font-size: 0.76rem;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.account-form__help a:hover,
.account-form__help a:focus-visible {
  color: #f2ce7d;
  text-shadow: 0 0 10px rgba(218, 165, 65, 0.26);
}

.terms-check {
  display: grid;
  grid-template-columns: 19px 1fr;
  align-items: start;
  gap: 10px;
  color: #8f8c86;
  cursor: pointer;
}

.terms-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.terms-check > span {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  background: rgba(12, 13, 15, 0.8);
  border: 1px solid rgba(175, 174, 169, 0.3);
  border-radius: 5px;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.terms-check input:checked + span {
  background: linear-gradient(145deg, #e0b45a, #a8731e);
  border-color: #ddb05a;
  box-shadow: 0 0 10px rgba(215, 160, 54, 0.24);
}

.terms-check input:checked + span::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #21170a;
  border-bottom: 2px solid #21170a;
  content: "";
  transform: rotate(45deg);
}

.terms-check input:focus-visible + span {
  outline: 2px solid rgba(234, 190, 100, 0.5);
  outline-offset: 3px;
}

.terms-check b {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.9;
}

.terms-check a,
.account-card__footer a {
  color: #d5a64d;
  transition: color 180ms ease;
}

.terms-check a:hover,
.terms-check a:focus-visible,
.account-card__footer a:hover,
.account-card__footer a:focus-visible {
  color: #f2ce7d;
}

.account-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  margin-top: 2px;
  overflow: hidden;
  color: #342818;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  background: linear-gradient(105deg, #9f7225 0%, #f0d18a 54%, #d5ae60 100%);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 6px 24px rgba(192, 145, 52, 0.12);
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.account-submit::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 24%, rgba(255, 255, 242, 0.68) 48%, transparent 68%);
  content: "";
  pointer-events: none;
  transform: translateX(135%);
  transition: transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.account-submit > * {
  position: relative;
  z-index: 1;
}

.account-submit:hover,
.account-submit:focus-visible {
  box-shadow: 0 9px 28px rgba(220, 170, 71, 0.24);
  transform: translateY(-2px);
}

.account-submit:hover::before,
.account-submit:focus-visible::before {
  transform: translateX(-135%);
}

.account-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(189, 145, 58, 0.12);
}

.account-card__footer p {
  margin: 0;
  color: #8d8a84;
  font-size: 0.78rem;
}

.back-home {
  font-size: 0.74rem;
}

.auth-copyright {
  margin: 20px 0 0;
  color: #5e5c58;
  font-size: 0.68rem;
}

@media (max-width: 560px) {
  .auth-layout {
    width: min(calc(100% - 24px), 620px);
    justify-content: flex-start;
    padding-top: 25px;
  }

  .auth-brand {
    width: 132px;
    margin-bottom: 12px;
  }

  .account-card {
    padding: 24px 18px;
    border-radius: 19px;
  }

  .account-card__header {
    gap: 12px;
    margin-bottom: 24px;
  }

  .security-badge {
    min-height: 35px;
    padding-inline: 10px;
  }

  .account-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-ambient i,
  .account-submit:hover::before,
  .account-submit:focus-visible::before {
    animation: none;
  }
}
