:root {
  --fgd-auth-primary: #92278f;
  --fgd-auth-primary-hover: #7a1b77;
  --fgd-auth-gradient-end: #b346b0;
  --fgd-auth-input-bg: #f0f4ff;
  --fgd-auth-page-bg: #f5f5f5;
  --fgd-auth-soft-bg: #f5e9f5;
  --fgd-auth-danger: #dd012f;
  --fgd-auth-text: #2d2930;
  --fgd-auth-muted: #6d6670;
  --fgd-auth-radius-shell: 36px;
  --fgd-auth-radius-card: 10px;
  --fgd-auth-radius-control: 24px;
  --fgd-auth-control-height: 48px;
  --fgd-auth-shadow: 0 10px 25px rgba(42, 21, 43, 0.1);
}

body:has(.auth-shell) {
  background: var(--fgd-auth-page-bg);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 40px;
  background:
    radial-gradient(circle at 12% 14%, rgba(146, 39, 143, 0.08), transparent 30%),
    radial-gradient(circle at 88% 84%, rgba(179, 70, 176, 0.08), transparent 28%),
    var(--fgd-auth-page-bg);
  color: var(--fgd-auth-text);
}

.auth-shell * {
  box-sizing: border-box;
}

.auth-login-card {
  position: relative;
  width: min(75vw, 1120px);
  min-width: 720px;
  height: 600px;
  min-height: 600px;
  filter: drop-shadow(var(--fgd-auth-shadow));
}

.auth-login-card__brand,
.auth-login-card__form {
  position: absolute;
  top: 0;
  height: 100%;
}

.auth-login-card__brand {
  left: 0;
  z-index: 1;
  display: flex;
  width: 45%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--fgd-auth-radius-shell) 0 0 var(--fgd-auth-radius-shell);
  background: var(--fgd-auth-primary);
  color: #fff;
}

.auth-login-card__brand::after {
  position: absolute;
  right: -76px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  content: "";
}

.auth-login-card__brand img {
  position: relative;
  z-index: 2;
  width: 220px;
  max-width: 80%;
  transform: translateX(-24px);
}

.auth-login-card__glow {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.auth-login-card__glow--one {
  top: -85px;
  left: -70px;
  width: 250px;
  height: 250px;
}

.auth-login-card__glow--two {
  top: 115px;
  right: 40px;
  width: 80px;
  height: 80px;
}

.auth-login-card__form {
  left: 35%;
  z-index: 2;
  display: flex;
  width: 65%;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(146, 39, 143, 0.08);
  border-radius: var(--fgd-auth-radius-shell);
  background: #fff;
  padding: 56px;
}

.auth-form-wrap {
  width: 100%;
  max-width: 380px;
}

.auth-form-wrap h1,
.auth-flow-card h1 {
  margin: 0;
  color: var(--fgd-auth-primary);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.auth-form-wrap h1 {
  margin-bottom: 28px;
}

.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: var(--fgd-auth-primary);
  font-size: 14px;
  font-weight: 600;
}

.auth-control {
  width: 100%;
  height: var(--fgd-auth-control-height);
  border: 0;
  border-radius: var(--fgd-auth-radius-control);
  outline: 0;
  background: var(--fgd-auth-input-bg);
  color: var(--fgd-auth-text);
  font: inherit;
  font-size: 14px;
  padding: 0 20px;
  transition: box-shadow 160ms ease, background 160ms ease;
}

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

.auth-control::placeholder {
  color: #9290a0;
}

.auth-control:focus-visible,
.auth-password__toggle:focus-visible,
.auth-button:focus-visible,
.auth-text-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(146, 39, 143, 0.24);
}

.auth-password {
  position: relative;
}

.auth-password__toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fgd-auth-primary);
  cursor: pointer;
  font-size: 15px;
}

.auth-button {
  display: flex;
  width: 100%;
  min-height: var(--fgd-auth-control-height);
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--fgd-auth-radius-control);
  background: var(--fgd-auth-primary);
  box-shadow: 0 8px 18px rgba(146, 39, 143, 0.16);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  padding: 12px 22px;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-button:hover {
  transform: translateY(-3px);
  background: var(--fgd-auth-primary-hover);
  box-shadow: 0 12px 24px rgba(146, 39, 143, 0.25);
}

.auth-button:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.auth-button.is-loading i {
  animation: auth-spin 800ms linear infinite;
}

.auth-text-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: 22px auto 0;
  border-radius: 6px;
  color: var(--fgd-auth-primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.auth-text-link::after {
  width: 0;
  height: 1px;
  margin-top: 21px;
  margin-left: -100%;
  background: currentColor;
  content: "";
  transition: width 180ms ease;
}

.auth-text-link:hover::after {
  width: 100%;
}

.auth-text-link--button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.auth-inline-form {
  text-align: center;
}

.auth-flow-card {
  width: min(100%, 420px);
  overflow: hidden;
  border: 1px solid rgba(146, 39, 143, 0.08);
  border-radius: var(--fgd-auth-radius-card);
  background: #fff;
  box-shadow: 0 5px 20px rgba(42, 21, 43, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.auth-flow-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 11px 28px rgba(42, 21, 43, 0.15);
}

.auth-flow-card--wide {
  width: min(100%, 650px);
}

.auth-flow-card__header {
  background: linear-gradient(135deg, var(--fgd-auth-primary), var(--fgd-auth-gradient-end));
  color: #fff;
  padding: 28px 32px 30px;
  text-align: center;
}

.auth-flow-card__header--danger {
  background: linear-gradient(135deg, var(--fgd-auth-danger), #b5012a);
}

.auth-flow-card__header h1 {
  color: #fff;
  font-size: 27px;
}

.auth-flow-card__header p {
  margin: 9px auto 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.6;
}

.auth-flow-card__eyebrow {
  display: block;
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.auth-flow-card__icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  font-size: 19px;
}

.auth-flow-card__success {
  display: inline-grid;
  width: 80px;
  height: 80px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #fff;
  color: var(--fgd-auth-primary);
  font-size: 30px;
  animation: auth-pop 380ms ease-out both;
}

.auth-flow-card__body {
  padding: 30px;
}

.auth-flow-card__body > p {
  margin: 0 0 22px;
  color: var(--fgd-auth-muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.auth-info,
.auth-warning,
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  padding: 15px 16px;
}

.auth-info {
  border-left: 4px solid var(--fgd-auth-primary);
  background: var(--fgd-auth-soft-bg);
  color: #574355;
}

.auth-info > i {
  margin-top: 2px;
  color: var(--fgd-auth-primary);
}

.auth-info strong,
.auth-info span {
  display: block;
}

.auth-info span {
  margin-top: 3px;
}

.auth-warning,
.auth-alert--error {
  border: 1px solid #ffb1c2;
  background: linear-gradient(135deg, #ffe5ec, #ffd4df);
  color: #7d1028;
}

.auth-warning i,
.auth-alert--error i {
  margin-top: 3px;
  color: var(--fgd-auth-danger);
}

.auth-alert p,
.auth-field__errors p {
  margin: 0;
}

.auth-field__errors {
  margin-top: 7px;
  color: var(--fgd-auth-danger);
  font-size: 12px;
  line-height: 1.45;
}

.auth-help {
  margin: 7px 3px 0;
  color: var(--fgd-auth-muted);
  font-size: 11px;
  line-height: 1.5;
}

.auth-help ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.auth-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.password-strength {
  margin: 2px 0 24px;
  border-radius: 12px;
  background: #faf8fb;
  padding: 16px;
}

.password-strength__topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--fgd-auth-muted);
  font-size: 12px;
}

.password-strength__topline strong {
  color: var(--fgd-auth-text);
}

.password-strength__track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e3ea;
}

.password-strength__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--fgd-auth-danger);
  transition: width 180ms ease, background 180ms ease;
}

.password-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 14px 0 0;
  padding: 0;
  color: #7d7680;
  font-size: 11px;
  list-style: none;
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.password-rules li.is-valid {
  color: #26734d;
}

.password-rules i {
  color: #c7bdc8;
  font-size: 8px;
}

.password-rules li.is-valid i {
  color: #26734d;
  font-size: 11px;
}

.password-match {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  color: #26734d;
  font-size: 11px;
}

.password-match.is-invalid {
  color: var(--fgd-auth-danger);
}

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

@keyframes auth-pop {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

@media (min-width: 1600px) {
  .auth-login-card {
    width: min(65vw, 1200px);
    height: 650px;
  }

  .auth-login-card__brand img {
    width: 240px;
  }
}

@media (max-width: 1199.98px) {
  .auth-login-card {
    width: 85vw;
  }

  .auth-login-card__brand img {
    width: 200px;
  }

  .auth-login-card__form {
    left: 30%;
    width: 70%;
  }
}

@media (max-width: 991.98px) {
  .auth-shell {
    padding: 28px;
  }

  .auth-login-card {
    width: 90vw;
    min-width: 0;
    height: 550px;
    min-height: 550px;
  }

  .auth-login-card__brand {
    width: 40%;
  }

  .auth-login-card__brand img {
    width: 180px;
  }

  .auth-login-card__form {
    left: 30%;
    width: 70%;
    padding: 42px;
  }
}

@media (max-width: 767.98px) {
  .auth-shell {
    align-items: center;
    overflow: visible;
    padding: 24px 18px;
  }

  .auth-login-card {
    width: min(90vw, 520px);
    height: auto;
    min-height: 0;
    filter: none;
  }

  .auth-login-card__brand,
  .auth-login-card__form {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
  }

  .auth-login-card__brand {
    height: 180px;
    border-radius: 30px 30px 0 0;
    box-shadow: var(--fgd-auth-shadow);
  }

  .auth-login-card__brand img {
    width: 170px;
    transform: none;
  }

  .auth-login-card__form {
    z-index: 3;
    height: auto;
    min-height: 470px;
    margin-top: -25px;
    border-radius: 30px;
    box-shadow: var(--fgd-auth-shadow);
    padding: 42px 28px 32px;
  }

  .auth-form-wrap h1 {
    font-size: 28px;
  }

  .auth-button {
    min-height: 52px;
  }

  .auth-flow-card__body,
  .auth-flow-card__header {
    padding-right: 22px;
    padding-left: 22px;
  }

  .auth-password-grid,
  .password-rules {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 600px) and (min-width: 768px) {
  .auth-login-card {
    height: 500px;
    min-height: 500px;
  }

  .auth-login-card__brand img {
    width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-flow-card,
  .auth-button,
  .auth-text-link::after,
  .auth-control,
  .auth-flow-card__success,
  .auth-button.is-loading i,
  .password-strength__track span {
    animation: none;
    transition: none;
  }
}
