.auth-modal-lock {
  overflow: hidden;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 31, 58, 0.42);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.auth-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  width: min(760px, 100%);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(221, 230, 240, 0.94);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(7, 59, 122, 0.22);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.auth-modal-overlay.open .auth-modal {
  transform: translateY(0) scale(1);
}

.auth-modal-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 30px;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, var(--home-banner-blue, var(--primary)), var(--primary-deeper));
  background-size: 38px 38px, 38px 38px, auto;
}

.auth-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-modal-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 24px;
  font-weight: 800;
}

.auth-modal-brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}

.auth-modal-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  letter-spacing: 0;
}

.auth-modal-side h2 {
  margin-top: 58px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.auth-modal-side p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.8;
}

.auth-modal-points {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.auth-modal-points span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.auth-modal-points span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.13);
}

.auth-modal-content {
  padding: 34px 36px 32px;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  background: #F4F8FD;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: color 0.16s ease, background 0.16s ease;
}

.auth-modal-close:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.auth-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #F7FBFF;
}

.auth-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 36px;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(120deg, var(--home-banner-blue, var(--primary)), var(--home-banner-blue-dark, var(--primary-dark)));
  box-shadow: 0 8px 18px rgba(18, 104, 196, 0.18);
}

.auth-panel-title {
  margin-top: 28px;
  color: var(--text-primary);
  font-size: 26px;
  line-height: 1.2;
}

.auth-panel-desc {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-form {
  display: none;
  margin-top: 24px;
}

.auth-form.active {
  display: block;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.auth-field label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-primary);
  background: #fff;
  outline: 0;
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.auth-field input:focus {
  border-color: rgba(18, 104, 196, 0.48);
  box-shadow: 0 0 0 4px rgba(18, 104, 196, 0.08);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.auth-code-btn {
  height: 44px;
  border: 1px solid rgba(18, 104, 196, 0.25);
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-bg-light);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-check input {
  accent-color: var(--primary);
}

.auth-link {
  color: var(--primary);
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(120deg, var(--home-banner-blue, var(--primary)), var(--home-banner-blue-dark, var(--primary-dark)));
  box-shadow: 0 12px 24px rgba(18, 104, 196, 0.22);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.auth-form-foot {
  margin-top: 15px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.auth-form-foot button {
  border: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.auth-message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--primary);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 720px) {
  .auth-modal {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-modal-side {
    padding: 24px;
  }

  .auth-modal-side h2,
  .auth-modal-side p,
  .auth-modal-points {
    display: none;
  }

  .auth-modal-content {
    padding: 26px 22px 24px;
  }

  .auth-panel-title {
    font-size: 23px;
  }
}

@media (max-width: 420px) {
  .auth-modal-overlay {
    padding: 14px;
  }

  .auth-code-row {
    grid-template-columns: 1fr;
  }
}
