/* ============================================================
   EBRA Summer of E-Bike Fitness — Program Join Flow
   /programs/summer-e-bike-fitness/join/index.html
   Inherits CSS variables from ../../../index.css
   ============================================================ */

/* --- Page layout ------------------------------------------ */
.join-main {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 80px;
  background: var(--bg-card-alt);
}

.join-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 24px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* --- Campaign header (program-specific) ------------------- */
.join-campaign-header {
  padding: 16px 32px;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border);
}

.join-campaign-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

.join-campaign-line {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .join-campaign-header { padding: 14px 20px; }
}

/* --- Progress bar ----------------------------------------- */
.join-progress {
  height: 4px;
  background: var(--bg-card-alt);
}

.join-progress-bar {
  height: 100%;
  background: var(--blue);
  transition: width 0.4s ease;
}

/* --- Step container --------------------------------------- */
.join-step {
  padding: 36px 32px 40px;
}

@media (max-width: 480px) {
  .join-step { padding: 28px 20px 32px; }
}

.join-step-header {
  margin-bottom: 28px;
}

.join-step-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.join-step-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.join-step-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Form fields ------------------------------------------ */
.join-field {
  margin-bottom: 16px;
}

.join-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.join-field input,
.join-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.join-field input:focus,
.join-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,174,206,0.15);
}

.join-field input.input-error,
.join-field select.input-error {
  border-color: #ef4444;
}

/* --- Two-column field rows (first/last name, city/state/zip) -- */
.join-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.join-field-row .join-field {
  margin-bottom: 16px;
}

.join-field-row:has(.join-field-state) {
  grid-template-columns: 1fr 80px 110px;
}

.join-field-state select {
  padding-right: 8px;
}

@media (max-width: 420px) {
  .join-field-row,
  .join-field-row:has(.join-field-state) {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.join-password-wrap {
  position: relative;
}

.join-password-wrap input {
  padding-right: 42px;
}

.btn-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  line-height: 0;
}

.btn-password-toggle:hover { color: var(--text); }
.icon-eye-off { display: none; }

.join-field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Stripe card element ---------------------------------- */
#stripe-element-container {
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg);
  transition: border-color 0.15s;
}

#stripe-element-container.StripeElement--focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,174,206,0.15);
}

/* --- Buttons ---------------------------------------------- */
.btn-join-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  margin-top: 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-join-primary:hover { background: #009ab8; }
.btn-join-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.join-resend-link {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
}

.join-resend-link:hover { opacity: 0.7; }

/* --- Help notice (info callout) --------------------------- */
.join-help-notice {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 0.85rem;
  text-align: center;
}
.join-help-notice strong { font-weight: 700; }

/* --- Error message ---------------------------------------- */
.join-error {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* --- Inline link inside error message --------------------- */
.join-error-link {
  color: #dc2626;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.join-error-link:hover {
  color: #991b1b;
}

/* --- Secure note ------------------------------------------ */
.join-secure-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Success step ----------------------------------------- */
.join-step-success {
  text-align: center;
}

.join-success-icon {
  margin: 0 auto 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.join-success-cta {
  margin-top: 24px;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Prepaid code redemption block ------------------------- */
.join-redeem-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.join-redeem-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.join-redeem-toggle:hover {
  color: var(--text-body);
}

.join-redeem-panel {
  margin-top: 16px;
}

/* --- FTC disclosure block (Step 4 / payment) -------------- */
.join-disclosure {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card-alt);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-body, var(--text));
}

.join-disclosure p {
  margin: 0 0 6px;
}

.join-disclosure ul {
  margin: 0;
  padding-left: 18px;
}

.join-disclosure li {
  margin-bottom: 4px;
}

.join-disclosure li:last-child {
  margin-bottom: 0;
}

.join-disclosure a {
  color: var(--blue);
}

/* --- Success step extras (renewal / shipping confirmation) -- */
.join-success-detail {
  margin-top: 12px;
}

.join-success-detail-quiet {
  font-size: 0.82rem;
  color: var(--text-muted);
}
