/* ============================================================================
   CHEMISTRY · AUTH MODAL
   ----------------------------------------------------------------------------
   Phone-number → OTP flow. Mirrors ChemistryLandingPage/AuthDialog +
   OtpDialog but as vanilla HTML/CSS injected into every static page.
   ============================================================================ */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20, 4, 10, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.auth-modal.is-open { display: flex; }

.auth-modal__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--oxblood-deep, #270408);
  border: 1px solid rgba(201, 168, 76, 0.5);
  border-radius: 6px;
  padding: 2rem clamp(1.25rem, 3vw, 2.25rem);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.65);
  color: var(--cream, #FAF6EE);
  font-family: var(--sans, "Jost", sans-serif);
}

.auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  background: transparent;
  border: 0;
  color: var(--champagne, #E2C97E);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  opacity: 0.7;
  transition: opacity 0.18s ease;
}
.auth-modal__close:hover { opacity: 1; }

.auth-modal__title {
  font-family: var(--sans, "Jost", sans-serif);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cream, #FAF6EE);
  margin-bottom: 0.5rem;
}
.auth-modal__desc {
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(250, 246, 238, 0.65);
  margin-bottom: 1.5rem;
}

.auth-modal__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(250, 246, 238, 0.6);
  margin-bottom: 0.6rem;
}

.auth-modal__phone-row {
  display: flex;
  gap: 0.5rem;
}
.auth-modal__cc {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border: 1px solid rgba(201, 168, 76, 0.5);
  background: rgba(20, 4, 10, 0.55);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--cream, #FAF6EE);
}
.auth-modal__input {
  flex: 1;
  font-family: var(--sans, "Jost", sans-serif);
  font-size: 1.4rem;
  font-weight: 500;
  height: 3.5rem;
  padding: 0 1rem;
  background: rgba(20, 4, 10, 0.4);
  color: var(--cream, #FAF6EE);
  border: 1px solid rgba(201, 168, 76, 0.5);
  border-radius: 0;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-modal__input:focus {
  border-color: var(--gold, #C9A84C);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25);
}
.auth-modal__input:disabled { opacity: 0.6; }

.auth-modal__hint {
  font-size: 0.65rem;
  color: rgba(250, 246, 238, 0.5);
  margin-top: 0.5rem;
}
.auth-modal__hint--center { text-align: center; margin-top: 0.85rem; }
.auth-modal__hint button {
  background: transparent;
  border: 0;
  color: var(--champagne, #E2C97E);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  font: inherit;
}
.auth-modal__hint button:disabled { opacity: 0.5; cursor: default; }

.auth-modal__otp-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}
.auth-modal__otp-input {
  width: 3.25rem;
  height: 3.5rem;
  text-align: center;
  font-family: var(--sans, "Jost", sans-serif);
  font-size: 1.5rem;
  background: rgba(20, 4, 10, 0.4);
  color: var(--cream, #FAF6EE);
  border: 1px solid rgba(201, 168, 76, 0.5);
  border-radius: 0;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-modal__otp-input:focus {
  border-color: var(--gold, #C9A84C);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25);
}

.auth-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--gold, #C9A84C);
  color: var(--oxblood-deep, #270408);
  font-family: var(--sans, "Jost", sans-serif);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
}
.auth-modal__submit:hover:not(:disabled) { background: var(--champagne, #E2C97E); }
.auth-modal__submit:disabled { opacity: 0.5; cursor: default; }

.auth-modal__error {
  margin-top: 0.85rem;
  font-size: 0.72rem;
  color: #E89B9B;
  text-align: center;
  min-height: 1.1rem;
}

.auth-modal__spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

[data-auth-screen] { display: none; }
[data-auth-screen].is-active { display: block; }

@media (max-width: 480px) {
  .auth-modal__card { padding: 1.5rem 1.25rem; }
  .auth-modal__cc { font-size: 1.05rem; padding: 0 0.75rem; }
  .auth-modal__input { font-size: 1.2rem; height: 3.1rem; }
  .auth-modal__otp-input { width: 2.75rem; height: 3.1rem; font-size: 1.25rem; }
}
