.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.auth-modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.auth-modal[hidden],
.auth-modal .hidden {
  display: none !important;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 64, 0.62);
  backdrop-filter: blur(3px);
}

.auth-modal__panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(92vh, 820px);
  overflow-y: auto;
  padding: 1.5rem 1.4rem 1.35rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

.auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid #d8e0e8;
  border-radius: 50%;
  background: #fff;
  color: #5c6c84;
  font-size: 1.25rem;
  cursor: pointer;
}

.auth-modal__brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.auth-modal__brand img {
  width: auto;
  height: 28px;
}

.auth-modal__brand span {
  color: #ff8a00;
  font-size: 0.95rem;
  font-weight: 700;
}

.auth-modal h2 {
  margin: 0 2rem 0.35rem 0;
  color: #0a2540;
  font-size: 1.55rem;
  line-height: 1.2;
}

.auth-modal__lead {
  margin: 0 0 1rem;
  color: #5c6c84;
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-error,
.auth-ok {
  min-height: 0;
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
}

.auth-error {
  color: #b42318;
}

.auth-ok {
  color: #067647;
}

.auth-error:empty,
.auth-ok:empty {
  display: none;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  color: #0a2540;
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  padding: 0.75rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
}

.auth-form input:focus {
  border-color: #1668e3;
  outline: 2px solid rgba(22, 104, 227, 0.18);
}

.auth-name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -0.15rem 0 0.9rem;
}

.auth-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  margin: 0 0 0.85rem !important;
  color: #334155;
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  cursor: pointer;
}

.auth-check input {
  width: 1rem;
  height: 1rem;
  accent-color: #0b7a5a;
}

.auth-link {
  border: 0;
  background: none;
  padding: 0;
  color: #1668e3;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.btn-auth-primary,
.btn-auth-secondary {
  width: 100%;
  min-height: 46px;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-auth-primary {
  border: 0;
  background: #ffc400;
  color: #0a2540;
}

.btn-auth-primary:hover {
  background: #e6b000;
}

.btn-auth-secondary {
  border: 1px solid #0a2540;
  background: #fff;
  color: #0a2540;
}

.btn-auth-secondary:hover {
  background: #f8fafc;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: #7a899d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: #e2e8f0;
  content: "";
}

.auth-social {
  display: grid;
  gap: 0.65rem;
}

.auth-social__button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #172b4d;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-social__button:hover {
  border-color: #8ca0b7;
  background: #f8fafc;
}

.auth-social__button--apple {
  border-color: #111;
  background: #111;
  color: #fff;
}

.auth-social__button--apple:hover {
  background: #282828;
}

.auth-social__button--facebook {
  border-color: #1877f2;
  background: #1877f2;
  color: #fff;
}

.auth-social__button--facebook:hover {
  background: #1266d4;
}

.auth-social__icon {
  width: 1.4rem;
  height: 1.4rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1.1rem;
  font-weight: 800;
}

.auth-social__icon--google {
  color: #4285f4;
}

.auth-social__icon--apple {
  color: #fff;
  font-size: 0.82rem;
}

.auth-social__icon--facebook {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 1.35rem;
}

.auth-switch {
  margin: 0.85rem 0 0.55rem;
  text-align: center;
  color: #5c6c84;
  font-size: 0.9rem;
}

.auth-terms {
  margin: 1rem 0 0;
  color: #6b7b91;
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.auth-terms a {
  color: #1668e3;
  text-decoration: underline;
}

@media (max-width: 520px) {
  .auth-modal {
    align-items: flex-end;
    padding: 0;
  }

  .auth-modal__panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 1.35rem 1rem 1.5rem;
  }

  .auth-name-grid {
    grid-template-columns: 1fr;
  }

  .auth-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
