/* ============================================================
   Podstrm - reusable auth modal
   ============================================================ */

body.auth-modal-open { overflow: hidden; }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background: rgba(0, 0, 0, 0.72);
}
.auth-overlay.is-open { display: flex; }

[data-theme="light"] .auth-overlay { background: rgba(0, 0, 0, 0.28); }

.auth-dialog {
  position: relative;
  width: min(100%, 584px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border: 1px solid #31405b;
  border-radius: 12px;
  background: #101827;
  color: #fff;
  padding: 96px 80px 62px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .auth-dialog {
  border-color: transparent;
  background: #fff;
  color: #050a16;
}

.auth-close {
  position: absolute;
  top: 54px;
  right: 82px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: currentColor;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

[data-theme="light"] .auth-close { background: #f3f3f3; font-size: 24px; }

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-copy {
  max-width: 350px;
  margin: 18px auto 58px;
  color: var(--text-muted);
  text-align: center;
  font-size: 16px;
  line-height: 1.35;
}
[data-theme="light"] .auth-copy { color: #050a16; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.auth-tab {
  min-height: 46px;
  border: 1px solid #33415a;
  border-radius: 9px;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.is-active {
  border-color: #274bff;
  background: #18265d;
}
[data-theme="light"] .auth-tab {
  border-color: #c3c6cc;
  background: #e1e2e6;
  color: #fff;
}
[data-theme="light"] .auth-tab.is-active {
  border-color: #111827;
  background: #111827;
}

.auth-form { display: grid; gap: 14px; }
.auth-form.is-hidden { display: none; }
.auth-field {
  width: 100%;
  min-height: 46px;
  border: 1px solid #33415a;
  border-radius: 9px;
  background: #060b16;
  color: currentColor;
  font: inherit;
  padding: 0 13px;
  outline: none;
}
[data-theme="light"] .auth-field {
  border-color: #c3c6cc;
  background: #f7f7f8;
  color: #050a16;
}
.auth-primary,
.auth-google {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
[data-theme="dark"] .auth-primary,
[data-theme="dark"] .auth-google { background: #2b32e8; }

.auth-primary:hover,
.auth-primary:focus-visible,
.auth-google:hover,
.auth-google:focus-visible {
  transform: translateY(-1px);
}

.auth-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 18px 0;
}
.auth-separator::before,
.auth-separator::after {
  content: "";
  height: 1px;
  background: currentColor;
  opacity: 0.72;
}
.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-terms {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: currentColor;
}
.auth-back {
  display: block;
  margin-top: 22px;
  color: currentColor;
  text-align: center;
  font-size: 16px;
}
.auth-name-field.is-hidden { display: none; }

.auth-forgot {
  justify-self: end;
  margin-top: -4px;
  color: var(--cyan);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.auth-forgot:hover { text-decoration: underline; }

/* ---------- OTP verification view ---------- */
.auth-view.is-hidden { display: none; }

.otp-icon {
  width: 92px;
  height: 92px;
  margin: 8px auto 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, #3fd0f4, #1f7bf0);
  box-shadow: 0 14px 34px rgba(31, 123, 240, 0.42);
}

.otp-copy {
  max-width: 340px;
  margin: 0 auto 40px;
  text-align: center;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-muted);
}
.otp-copy strong { font-weight: 700; color: #fff; }
[data-theme="light"] .otp-copy { color: #3a4150; }
[data-theme="light"] .otp-copy strong { color: #050a16; }

.otp-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 26px;
}
.otp-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.otp-box {
  flex: 1 1 0;
  min-width: 0;
  height: 68px;
  border: 1px solid #33415a;
  border-radius: 12px;
  background: #060b16;
  color: currentColor;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.otp-box:focus {
  border-color: #274bff;
  box-shadow: 0 0 0 3px rgba(39, 75, 255, 0.25);
}
[data-theme="light"] .otp-box {
  border-color: #d4d6db;
  background: #f2f3f5;
  color: #050a16;
}

.otp-resend {
  margin-bottom: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
[data-theme="light"] .otp-resend { color: #3a4150; }
.otp-resend-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: default;
}
.otp-resend-btn.is-ready {
  color: var(--cyan);
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 620px) {
  .auth-dialog { padding: 82px 28px 42px; }
  .auth-close { top: 28px; right: 28px; }
  .auth-brand { font-size: 28px; }
  .auth-copy { margin-bottom: 36px; }
  .otp-inputs { gap: 8px; }
  .otp-box { height: 58px; font-size: 22px; }
}
