/* ============================================================
   JOIN PAGE (join.html). Loaded after home.css; uses the same
   gold / deep blue / charcoal palette as the home page.
   ============================================================ */
/* the hidden attribute must win over display rules below */
[hidden] { display: none !important; }

:root {
  --gold: #F4C542;
  --gold-dark: #d9aa22;
  --blue: #0A3A6B;
  --charcoal: #050608;
  --ink: #111111;
  --muted: #5f6368;
  --line: #e2e2e2;
  --bg: #f4f4f4;
  --danger: #c0392b;
  --success: #1e7e34;
  --radius: 10px;
}

body.join-page {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* header: brand + one link (home.css hides .button-gold on mobile, so use our own class) */
.join-header-link {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 4px;
}
.join-header-link:hover { color: var(--blue); }

.join-wrap {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 56px;
  box-sizing: border-box;
}

/* ---------- stepper ---------- */
.stepper {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0 0 24px;
  counter-reset: none;
}
.stepper li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--line);
}
.stepper li.complete:not(:last-child)::after { background: var(--blue); }
.stepper .dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
  border: 2px solid var(--line);
  font-weight: 700;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.stepper li.current { color: var(--ink); font-weight: 700; }
.stepper li.current .dot { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.stepper li.complete .dot { border-color: var(--blue); background: var(--blue); color: #fff; font-size: 0; }
.stepper li.complete .dot::before { content: "✓"; font-size: 15px; }

/* ---------- cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 28px;
}
.card.narrow { max-width: 460px; margin: 0 auto; }
.card h1 { font-size: 24px; margin: 0 0 6px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card a { color: var(--blue); font-weight: 600; }

/* ---------- form controls ---------- */
#accountForm label,
.resend-box label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 14px;
  text-align: left;
}
#accountForm input,
.resend-box input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 11px 12px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fff;
}
#accountForm input:focus,
.resend-box input:focus,
.pf input:focus,
.pf select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.3);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pw-rules {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
}
.pw-rules li::before { content: "○ "; }
.pw-rules li.met { color: var(--success); }
.pw-rules li.met::before { content: "✓ "; }

.form-msg { margin-top: 14px; font-size: 14px; font-weight: 600; min-height: 0; }
.form-msg:empty { margin-top: 0; }
.form-msg.error { color: var(--danger); }
.form-msg.success { color: var(--success); }
.form-msg.info { color: var(--blue); }

.required-mark { color: var(--danger); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: inherit;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover:not(:disabled) { background: var(--gold-dark); }
.card a.btn-gold { color: var(--ink); }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover:not(:disabled) { background: #eef3f9; }
.btn-block { width: 100%; margin-top: 18px; }
.actions { display: flex; justify-content: flex-end; margin-top: 20px; }

/* ---------- verify / done ---------- */
.icon-circle {
  width: 60px; height: 60px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  background: #fdf3d3;
  color: var(--ink);
}
.icon-circle.success { background: var(--blue); color: #fff; }
.resend-box { margin-top: 18px; }
.resend-box .btn { margin-top: 12px; }

.spinner {
  width: 34px; height: 34px;
  margin: 8px auto 12px;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- new profile form (rendered by new-profile-form.js) ---------- */
/* home.css hides .section, so re-show it inside the form */
.pf .section {
  display: block;
  padding: 18px;
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
}
.pf .section h3 {
  margin: 0 0 14px;
  font-size: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
}
.pf .section h3 ~ h3 {
  margin-top: 22px;
  font-size: 14px;
  border-bottom-color: var(--line);
}
.pf .field {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.pf .field label { font-size: 14px; color: #444; }
.pf .field input,
.pf .field select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.pf .field-error { border: 2px solid var(--danger) !important; }

/* ---------- plans ---------- */
/* the plan step gets a wider page so three cards fit side by side */
.join-wrap:has(#panel-plan:not([hidden])) { max-width: 1000px; }

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.plan-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.plan-card.featured { border: 2px solid var(--gold); }
.plan-badge {
  position: absolute;
  top: -12px; left: 22px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
}
.plan-card h2 { margin: 0; font-size: 20px; }
.plan-price { margin: 6px 0 12px; color: var(--muted); }
.plan-price span { font-size: 30px; font-weight: 800; color: var(--ink); }
.plan-card ul { margin: 0; padding-left: 20px; flex: 1; }
.plan-card li { margin: 4px 0; }

/* beta (promo code) card */
.plan-card-beta { background: #fbfaf5; }
.plan-badge-dark { background: var(--charcoal); color: var(--gold); }
.promo-form { margin-top: 16px; }
.promo-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.promo-form input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fff;
}
.promo-form input::placeholder { text-transform: none; letter-spacing: normal; }
.promo-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.3); }
.promo-form input.field-error { border: 2px solid var(--danger); }
.promo-form .btn-block { margin-top: 12px; }

#checkoutWrap { margin-top: 16px; }
#checkout { margin-top: 8px; }

/* ============================================================
   MONTHLY / YEARLY TOGGLE (plan step). Paste at the END of css/join.css.
   Uses the join.css palette: --blue, --gold, --ink, --muted, --line, --success.
   ============================================================ */
.billing-toggle {
    display: flex;
    width: max-content;
    max-width: 100%;
    margin: 18px auto 6px;
    padding: 4px;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-sizing: border-box;
}

    .billing-toggle .bt-opt {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 9px 22px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--muted);
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
    }

        .billing-toggle .bt-opt:hover {
            color: var(--ink);
        }

        .billing-toggle .bt-opt.active {
            background: var(--blue);
            color: #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,0.15);
        }

        .billing-toggle .bt-opt:focus-visible {
            outline: 2px solid var(--gold);
            outline-offset: 2px;
        }

    .billing-toggle .bt-save {
        padding: 2px 8px;
        border-radius: 20px;
        background: var(--gold);
        color: var(--ink);
        font-size: 10px;
        letter-spacing: 0.06em;
        white-space: nowrap;
    }

/* "/mo" and "/yr": join.css makes every .plan-price span big, so undo that for .per */
.plan-price span.per {
    font-size: 16px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 2px;
}

.plan-price {
    margin-bottom: 2px;
}

/* the "Billed monthly" / "save ..." line under the price */
.plan-billing {
    margin: 0 0 12px;
    min-height: 1.5em; /* cards don't jump when the text changes */
    font-size: 13px;
    color: var(--muted);
}

    .plan-billing.is-saving {
        color: var(--success);
        font-weight: 700;
    }

.checkout-choice {
    color: var(--muted);
    font-weight: 600;
}

@media (max-width: 420px) {
    .billing-toggle .bt-opt {
        padding: 8px 14px;
        font-size: 12px;
    }

    .billing-toggle .bt-save {
        font-size: 9px;
        padding: 2px 6px;
    }
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .join-wrap { padding: 18px 12px 40px; }
  .card { padding: 20px 16px; }
  .card h1 { font-size: 21px; }
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  .pw-rules { grid-template-columns: 1fr; }
  .stepper .label { font-size: 11px; }
  .stepper li:not(:last-child)::after { left: calc(50% + 18px); right: calc(-50% + 18px); }
  .pf .section { padding: 14px 12px; }
  .pf .field { grid-template-columns: 1fr; gap: 4px; }
  .plans { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
  footer { flex-direction: column; gap: 8px; text-align: center; padding: 20px 16px; }
}

/* home.css switches the header to a mobile menu; keep ours simple */
@media (max-width: 768px) {
  .join-page .site-header { padding: 12px 16px; }
}
