.auth-nav-button {
  appearance: none;
  border: 1px solid rgba(19, 32, 28, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.88);
  color: #13201c;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 40px;
  padding: 0 1rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}

.auth-nav-button:hover {
  background: #fffdf7;
  border-color: rgba(11, 107, 91, 0.28);
  box-shadow: 0 10px 24px rgba(19, 32, 28, 0.1);
  transform: translateY(-1px);
}

.auth-nav-button.logged-in {
  background: rgba(11, 107, 91, 0.08);
  border-color: rgba(11, 107, 91, 0.18);
  color: #0b6b5b;
}

.auth-modal-root {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
}

.auth-modal-root.open {
  display: block;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 32, 28, 0.34);
  backdrop-filter: blur(10px);
}

.auth-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 430px);
  transform: translate(-50%, -48%) scale(0.98);
  border: 1px solid rgba(216, 196, 160, 0.48);
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 12%, rgba(217, 154, 43, 0.16), transparent 28%),
    linear-gradient(180deg, #fffdf7 0%, #fff8ec 100%);
  box-shadow: 0 28px 70px rgba(19, 32, 28, 0.24);
  opacity: 0;
  overflow: hidden;
  transition: opacity 200ms ease, transform 200ms ease;
}

.auth-modal-root.open .auth-dialog {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.auth-dialog::before {
  content: '';
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid rgba(216, 196, 160, 0.24);
  border-radius: 22px;
}

.auth-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(19, 32, 28, 0.06);
  color: #13201c;
  cursor: pointer;
  font-size: 1.15rem;
}

.auth-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.95rem;
  padding: 0.44rem 0.78rem;
  border: 1px solid rgba(217, 154, 43, 0.28);
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.78);
  color: #c9822a;
  font-size: 0.78rem;
  font-weight: 900;
}

.auth-title {
  margin: 0;
  color: #13201c;
  font-size: 1.76rem;
  line-height: 1.18;
}

.auth-subtitle {
  margin: 0.72rem 0 1.25rem;
  color: #5d6b66;
  font-size: 0.98rem;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 0.82rem;
}

.auth-field {
  display: grid;
  gap: 0.38rem;
}

.auth-field label {
  color: #31443e;
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.58rem;
}

.auth-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(19, 32, 28, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #13201c;
  font-size: 1rem;
  outline: none;
  padding: 0 0.95rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-input:focus {
  background: #fff;
  border-color: rgba(11, 107, 91, 0.45);
  box-shadow: 0 0 0 4px rgba(11, 107, 91, 0.08);
}

.auth-code-btn,
.auth-submit,
.auth-pay-confirm,
.auth-ghost-btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.auth-code-btn {
  min-width: 104px;
  padding: 0 0.84rem;
  background: rgba(11, 107, 91, 0.08);
  color: #0b6b5b;
}

.auth-submit,
.auth-pay-confirm {
  min-height: 50px;
  margin-top: 0.35rem;
  background: linear-gradient(135deg, #10211d, #0b6b5b);
  box-shadow: 0 16px 30px rgba(19, 32, 28, 0.18);
  color: #fffdf7;
}

.auth-ghost-btn {
  min-height: 48px;
  border: 1px solid rgba(19, 32, 28, 0.12);
  background: rgba(255, 255, 255, 0.62);
  color: #31443e;
}

.auth-hint {
  color: #7b8782;
  font-size: 0.78rem;
  line-height: 1.55;
}

.auth-switch-line {
  align-items: center;
  color: #6a756f;
  display: flex;
  font-size: 0.86rem;
  gap: 0.36rem;
  justify-content: center;
  margin-top: 0.15rem;
}

.auth-text-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: #0b6b5b;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0.15rem 0.05rem;
}

.auth-text-button:hover {
  text-decoration: underline;
}

.auth-error {
  min-height: 18px;
  color: #b9472d;
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-register-panel,
.auth-payment-panel {
  display: none;
}

.auth-modal-root.register .auth-register-panel,
.auth-modal-root.payment .auth-payment-panel {
  display: grid;
  gap: 0.85rem;
}

.auth-modal-root.register .auth-login-panel,
.auth-modal-root.register .auth-payment-panel,
.auth-modal-root.register .auth-account-panel,
.auth-modal-root.payment .auth-login-panel {
  display: none;
}

.auth-plan-card {
  border: 1px solid rgba(217, 154, 43, 0.24);
  border-radius: 20px;
  background: rgba(255, 247, 230, 0.72);
  padding: 1rem;
}

.auth-plan-card span {
  color: #c9822a;
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 0.28rem;
  text-transform: uppercase;
}

.auth-plan-card strong {
  color: #13201c;
  display: block;
  font-size: 1.18rem;
  margin-bottom: 0.28rem;
}

.auth-plan-card p {
  color: #5d6b66;
  line-height: 1.6;
  margin: 0;
}

.auth-account-panel {
  display: none;
}

.auth-modal-root.account .auth-login-panel,
.auth-modal-root.account .auth-register-panel,
.auth-modal-root.account .auth-payment-panel {
  display: none;
}

.auth-modal-root.account .auth-account-panel {
  display: grid;
  gap: 0.85rem;
}

.auth-account-card {
  border-radius: 20px;
  background: rgba(11, 107, 91, 0.08);
  padding: 1rem;
}

.auth-account-card span {
  color: #6a756f;
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.auth-account-card strong {
  color: #13201c;
  font-size: 1.1rem;
}

@media (max-width: 720px) {
  .auth-nav-button {
    min-height: 38px;
    padding: 0 0.82rem;
    font-size: 0.88rem;
  }

  .auth-dialog {
    top: 12px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    transform: translate(-50%, 12px) scale(0.98);
  }

  .auth-modal-root.open .auth-dialog {
    transform: translate(-50%, 0) scale(1);
  }

  .auth-content {
    padding: 1.35rem;
  }

  .auth-title {
    font-size: 1.36rem;
  }

  .auth-subtitle {
    font-size: 0.9rem;
    line-height: 1.58;
  }

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