.auth-modal[hidden] {
  display: none;
}
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 42, 61, 0.58);
  backdrop-filter: blur(3px);
}
.auth-dialog {
  position: relative;
  box-sizing: border-box;
  width: min(440px, 100%);
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  padding: 32px 36px 30px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: #fff url("/public/images/auth/modal-bg.png") center top/100% auto
    no-repeat;
  box-shadow: 0 26px 78px rgba(19, 48, 81, 0.3);
  color: #17263d;
  scrollbar-width: thin;
  font-family: Arial, "Segoe UI", sans-serif;
}
.auth-dialog * {
  font-family: inherit;
}
.auth-close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition:
    background 0.18s,
    transform 0.18s;
}
.auth-close:hover {
  background: #f1f6fc;
  transform: rotate(90deg);
}
.auth-close img {
  display: block;
  width: 30px;
  height: 30px;
}
.auth-logo {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 12px;
}
.auth-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 29px 0 22px;
}
.auth-heading-row h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.35px;
}
.auth-heading-row a,
.auth-link {
  color: #248cf0;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.auth-step-heading {
  margin: -4px 0 18px;
  color: #17263d;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
}
.auth-heading-row a {
  font-size: 15px;
  font-weight: 600;
}
.auth-form {
  display: grid;
  gap: 12px;
}
.auth-field {
  position: relative;
  display: block;
}
.auth-field.has-error {
  margin-bottom: 2px;
}
.auth-field input {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  padding: 0 15px 0 48px;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #29384e;
  font-size: 16px;
  outline: 0;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.auth-field input::placeholder {
  color: #98a4b3;
}
.auth-field input:focus {
  border-color: #2995f5;
  box-shadow: 0 0 0 3px rgba(41, 149, 245, 0.14);
}
.auth-field input.auth-error {
  border: 2px solid #ff3d46;
}
.auth-field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: #8391a3;
  font-size: 17px;
}
.auth-field-icon img {
  max-width: 20px;
  max-height: 20px;
  object-fit: contain;
}
.auth-primary,
.auth-secondary {
  min-height: 48px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  transition:
    filter 0.18s,
    transform 0.18s;
}
.auth-primary {
  border: 0;
  background: linear-gradient(100deg, #2d9df7, #2485ed);
  color: #fff;
  box-shadow: 0 6px 14px rgba(41, 145, 240, 0.2);
}
.auth-primary:hover:not(:disabled) {
  filter: brightness(0.97);
  transform: translateY(-1px);
}
.auth-primary:disabled {
  background: #c8d0dc;
  box-shadow: none;
  cursor: not-allowed;
}
.auth-secondary {
  border: 1px solid #2995f5;
  background: #fff;
  color: #2995f5;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: #98a4b2;
  font-size: 14px;
}
.auth-divider:before,
.auth-divider:after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e3e9ef;
}
.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  box-sizing: border-box;
  width: 100%;
  color: #344256;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
}
.auth-google-native {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: 48px;
  opacity: 0;
}
.auth-google-native iframe {
  width: 100% !important;
  height: 48px !important;
}
.auth-google-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  font-weight: 700;
}
.auth-google-label img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.auth-legal {
  margin: 6px 0 0;
  color: #7f8c9d;
  font-size: 13px;
  line-height: 1.55;
}
.auth-legal a {
  color: #2995f5;
  text-decoration: none;
}
.auth-legal a:hover {
  text-decoration: underline;
}
.auth-helper {
  margin: 0;
  color: #7c8999;
  font-size: 14px;
  line-height: 1.5;
}
.auth-helper strong {
  color: #29384e;
  font-weight: 550;
}
.auth-otp-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 9px 0 4px;
}
.auth-otp-row input {
  box-sizing: border-box;
  width: 100%;
  height: 54px;
  text-align: center;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  background: #fff;
  color: #25354b;
  font-size: 23px;
  outline: 0;
}
.auth-otp-row input:focus {
  border-color: #2999f5;
  box-shadow: 0 0 0 3px rgba(41, 153, 245, 0.13);
}
.auth-resend {
  margin: 0;
  color: #8994a2;
  font-size: 14px;
}
.auth-resend button {
  padding: 0;
  border: 0;
  background: none;
  color: #2995f5;
  font-size: 14px;
  cursor: pointer;
}
.auth-resend button:disabled {
  color: #98a4b3;
  cursor: default;
}
.auth-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.auth-error-copy {
  display: block;
  margin: 5px 0 0;
  color: #8c97a5;
  font-size: 14px;
  line-height: 1.35;
}
.auth-error-copy a {
  color: #2995f5;
  text-decoration: none;
}
.auth-error-copy a:hover { text-decoration: underline; }
.auth-spacer {
  height: 28px;
}
.auth-status {
  min-height: 20px;
  margin: 0;
  color: #ee4950;
  font-size: 13px;
}
.auth-status.success {
  color: #199463;
}
.auth-switch-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #2995f5;
  font-size: 14px;
}
.auth-switch-row a {
  text-decoration: none;
}
.auth-modal-open {
  overflow: hidden;
}
.auth-dialog-account {
  width: min(430px, 100%);
  padding: 29px;
}
.auth-dialog-account .auth-close {
  top: 29px;
  right: 29px;
  width: 34px;
  height: 34px;
}
.auth-dialog-account .auth-heading-row {
  margin: 28px 0 26px;
}
.auth-dialog-account .auth-heading-row h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0;
}
.auth-dialog-account .auth-form {
  gap: 10px;
}
.auth-dialog-account .auth-field input {
  height: 44px;
  padding-left: 43px;
  border-color: #c6ccda;
}
.auth-dialog-account .auth-field-icon {
  left: 12px;
}
.auth-dialog-account .auth-primary,
.auth-dialog-account .auth-secondary {
  min-height: 44px;
  font-weight: 500;
  box-shadow: none;
}
.auth-dialog-account .auth-primary:not(:disabled) {
  background: linear-gradient(180deg, #2f92ff 0%, #20a3ff 100%);
}
.auth-dialog-account .auth-change-password .auth-spacer {
  height: 21px;
}
.auth-dialog-account .auth-status:empty {
  display: none;
}
.auth-dialog-account .auth-link {
  line-height: 24px;
}
@media (max-width: 480px) {
  .auth-modal {
    align-items: center;
    padding: 14px;
  }
  .auth-dialog {
    width: min(420px, 100%);
    max-height: calc(100dvh - 28px);
    padding: 26px 22px 23px;
    border-radius: 17px;
  }
  .auth-logo {
    width: 54px;
    height: 54px;
  }
  .auth-close {
    top: 20px;
    right: 19px;
    width: 34px;
    height: 34px;
  }
  .auth-heading-row {
    margin: 24px 0 19px;
  }
  .auth-heading-row h2 {
    font-size: 24px;
  }
  .auth-otp-row {
    gap: 8px;
  }
  .auth-otp-row input {
    height: 49px;
  }
}
@media (max-height: 620px) {
  .auth-dialog {
    align-self: flex-start;
    margin: auto 0;
    max-height: calc(100dvh - 24px);
    padding-top: 22px;
    padding-bottom: 20px;
  }
  .auth-logo {
    width: 48px;
    height: 48px;
  }
  .auth-heading-row {
    margin: 18px 0 14px;
  }
  .auth-spacer {
    height: 8px;
  }
}
