/* Sign in page. Depends on base.css tokens. */

.auth {
  display: grid;
  align-content: center;
  min-height: calc(100vh - var(--nav-height) - 88px);
  padding: 48px 0 40px;
  text-align: center;
}

.auth__title {
  font-size: clamp(30px, 4.3vw, 41px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

/* Titles are set from JS as plain text, so the landing's gradient full stop is drawn here. */
.auth__title::after {
  content: "";
  display: inline-block;
  width: 0.21em;
  height: 0.21em;
  margin-left: 0.07em;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6d5bd0);
}

.auth__sub {
  max-width: 440px;
  margin: 14px auto 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.55;
}

.auth__card {
  width: 100%;
  max-width: 400px;
  margin: 44px auto 0;
  padding: 32px 44px 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 44px -28px rgba(15, 23, 42, 0.3);
  text-align: left;
}

.auth__card .btn,
.auth__card .input {
  height: 44px;
  font-size: 14.5px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth__card .input {
  margin-bottom: 12px;
  text-align: center;
}

.auth__terms {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
}

/* Agreeing to terms is only meaningful if the terms are one tap away. */
.auth__terms a,
.checkout__hint a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth__terms a:hover,
.checkout__hint a:hover {
  color: var(--text);
}

.checkout__hint--agree {
  margin-top: 12px;
  text-align: center;
}

/* The way back for someone who already has an account. */
.auth__foot {
  margin-top: 22px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.auth__foot a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth__note {
  max-width: 520px;
  margin: 18px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.auth__error {
  margin-top: 12px;
  color: #b3261e;
  font-size: 13.5px;
  text-align: center;
}

:root[data-theme="dark"] .auth__error {
  color: #ee918a;
}

/* Plans */

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 660px;
  margin: 52px auto 0;
  text-align: left;
}

.plan-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.plan-card--pro {
  border-color: var(--text);
}

.plan-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.plan-card__name {
  font-size: 16px;
}

.plan-card__price {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plan-card__price span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
}

.plan-card__list {
  display: grid;
  gap: 9px;
  color: var(--text-secondary);
  font-size: 14.5px;
}

.plan-card__list li {
  position: relative;
  padding-left: 20px;
}

.plan-card__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}

.plan-card--pro .plan-card__list li::before {
  background: var(--accent);
}

.plan-card__list li.plan-card__pitch {
  margin-bottom: 6px;
  padding-left: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}

.plan-card__list li.plan-card__pitch::before {
  display: none;
}

/* Checkout */

.checkout {
  width: 100%;
  max-width: 420px;
  margin: 36px auto 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  text-align: left;
}

.terms-pick {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.terms-pick__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.terms-pick__opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.terms-pick__opt input {
  accent-color: var(--accent);
}

.terms-pick__name {
  color: var(--text);
  font-weight: 600;
}

.terms-pick__price {
  margin-left: auto;
  color: var(--text);
  font-size: 14.5px;
}

.terms-pick__price small {
  margin-left: 6px;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
}

.checkout__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  color: var(--text-secondary);
  font-size: 14.5px;
}

.checkout__line--off {
  color: var(--accent);
}

.checkout__line--total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.checkout__amount {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.checkout__line--total .checkout__amount {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.checkout__terms {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.checkout__card {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.checkout__legend {
  padding: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.checkout__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.checkout__grid .input:first-child {
  grid-column: 1 / -1;
}

.checkout__grid .input:disabled {
  background: var(--surface);
  cursor: not-allowed;
}

.checkout__hint {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Good news, so it gets the accent rather than the small grey of a caveat. */
.checkout__free {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: left;
}

.checkout__free strong {
  color: var(--text);
  font-weight: 600;
}

.promo {
  margin: 20px 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.promo__label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.promo__row {
  display: flex;
  gap: 8px;
}

.promo__input {
  flex: 1;
  min-width: 0;
}

.promo__status {
  min-height: 1.3em;
  margin-top: 8px;
  font-size: 13px;
}

.promo__status.is-ok {
  color: var(--accent);
}

.promo__status.is-bad {
  color: var(--text-secondary);
}

.checkout__back {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.checkout__back a:hover {
  color: var(--text);
}

.plan-card__note {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

/* Chooser variant: each card ends in its own button. */

.plans--choose .plan-card {
  display: flex;
  flex-direction: column;
}

.plans--choose .plan-card__list {
  flex: 1;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .auth {
    min-height: auto;
    padding: 36px 0 48px;
  }

  .auth__sub {
    font-size: 16px;
  }

  .auth__card,
  .checkout {
    padding: 18px 16px;
  }

  .auth__card {
    margin-top: 26px;
  }

  .plans {
    grid-template-columns: 1fr;
    margin-top: 32px;
    gap: 14px;
  }

  .plan-card {
    padding: 18px 16px;
  }

  /* Card number needs the full width; expiry and CVC still pair up. */
  .checkout__grid .input {
    font-size: 16px;
  }

  .promo__row {
    flex-wrap: wrap;
  }

  .promo__row .btn {
    flex: 1 0 100%;
  }
}
