/* ===========================================================================
 * tap-form.css — Shared "v2" form styling for sign up + course purchase flows
 * ---------------------------------------------------------------------------
 * Extracted from account/signup/ so the same look can be reused across the
 * signup wizard and the Shop checkout pages (SignIn, CustomerInformation, …).
 *
 * Everything is scoped under the `.tap-form` root class so it never bleeds into
 * the navbar/footer or Bootstrap components elsewhere on the page. To adopt the
 * styling on a page: wrap the card in `<div class="tap-form">` and build fields
 * with `.s2-card`, `.s2-row`, `.s2-field`, `<label>`, `<input>/<select>`.
 * ======================================================================== */

.tap-form *, .tap-form *::before, .tap-form *::after { box-sizing: border-box; }

.tap-form {
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}

/* Card --------------------------------------------------------------------- */
.tap-form .s2-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  width: 100%;
  max-width: 620px;
  padding: 48px 52px 44px;
}
/* Wider variant for the two-column checkout (account + billing) forms */
.tap-form .s2-card.s2-card-wide { max-width: 880px; }

.tap-form .logo { text-align: center; margin-bottom: 32px; }
.tap-form .logo h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.3px;
  background: linear-gradient(135deg, #27B2BC 0%, #0480D4 50%, #366494 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #0480D4;
}
.tap-form .logo p  { font-size: 15px; color: #718096; margin-top: 6px; }

/* Checkout header treatment (Payment Type / Quote) — wide card only ---------
 * Brand gradient title, accent underline, and a small-caps subtitle so the
 * page header reads as a step heading rather than plain body text. */
.tap-form .s2-card-wide .logo {
  position: relative; padding-bottom: 20px; margin-bottom: 28px;
}
.tap-form .s2-card-wide .logo h1 {
  font-size: 30px; font-weight: 800; letter-spacing: -0.6px;
  background: linear-gradient(135deg, #27B2BC 0%, #0480D4 50%, #366494 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #0480D4;
}
.tap-form .s2-card-wide .logo p {
  margin-top: 8px; font-size: 12px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.tap-form .s2-card-wide .logo::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 64px; height: 3px; border-radius: 2px;
  background: linear-gradient(135deg, #27B2BC 0%, #0480D4 50%, #366494 100%);
}

/* Step indicator ----------------------------------------------------------- */
.tap-form .steps { display: flex; align-items: center; margin-bottom: 32px; }
.tap-form .step-item { display: flex; align-items: center; flex: 1; }
.tap-form .step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e2e8f0; color: #a0aec0;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.3s, color 0.3s;
}
.tap-form .step-circle.active { background: #0480D4; color: #fff; }
.tap-form .step-circle.done   { background: #10b981; color: #fff; }
.tap-form .step-circle.done::after { content: "\2713"; }
.tap-form .step-label { font-size: 12px; color: #a0aec0; margin-left: 8px; font-weight: 500; white-space: nowrap; }
.tap-form .step-label.active { color: #0480D4; }
.tap-form .step-label.done   { color: #10b981; }
.tap-form .step-line { flex: 1; height: 2px; background: #e2e8f0; margin: 0 10px; transition: background 0.3s; }
.tap-form .step-line.done { background: #10b981; }

/* Sections + fields -------------------------------------------------------- */
.tap-form .form-section { display: none; }
.tap-form .form-section.active { display: block; }
.tap-form .section-title { font-size: 18px; font-weight: 600; color: #2d3748; margin-bottom: 22px; }
.tap-form .section-title.center { text-align: center; }
.tap-form .s2-row { display: flex; gap: 16px; }
.tap-form .s2-field { display: flex; flex-direction: column; margin-bottom: 18px; flex: 1; }
.tap-form label { font-size: 14px; font-weight: 500; color: #4a5568; margin-bottom: 7px; }
.tap-form label .req { color: #e53e3e; margin-left: 2px; }
.tap-form label .opt { color: #a0aec0; font-weight: 400; margin-left: 4px; font-size: 13px; }
.tap-form input, .tap-form select {
  height: 46px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 0 14px; font-size: 15px; color: #2d3748;
  background: #fff; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
/* Neutralize Bootstrap's .input-group flex when used purely as a field wrapper
 * (the address character-counter JS inserts its counter after .input-group).
 * The width override beats Bootstrap's `.input-group > .form-control{width:1%}`
 * which would otherwise collapse the inputs to a sliver. */
.tap-form .input-group { display: block; }
.tap-form .input-group input,
.tap-form .input-group select { width: 100%; flex: none; }
.tap-form input:focus, .tap-form select:focus { border-color: #0480D4; box-shadow: 0 0 0 3px rgba(4,128,212,0.18); }
.tap-form input.error, .tap-form select.error { border-color: #e53e3e; }
.tap-form .error-msg { font-size: 11.5px; color: #e53e3e; margin-top: 4px; display: none; }
.tap-form .error-msg.visible { display: block; }

/* Country toggle / segmented buttons (reused for payment type on checkout) - */
.tap-form .country-toggle { display: flex; gap: 10px; margin-bottom: 20px; }
.tap-form .toggle-btn {
  flex: 1; height: 48px; border: 2px solid #e2e8f0; border-radius: 8px;
  background: #f7fafc; color: #718096; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.tap-form .toggle-btn.selected { border-color: #0480D4; background: #e6f3fb; color: #0480D4; }
/* Anchor variant — the Shop sign-in "New Customer" tab navigates to signup */
.tap-form a.toggle-btn {
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}

/* Highlighted info box (US cert address, etc.) ----------------------------- */
.tap-form .us-alt-box { margin-top: 24px; border: 2px dashed #a9d6ef; border-radius: 10px; background: #eef7fc; padding: 18px 18px 6px; }
.tap-form .us-alt-box .us-alt-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tap-form .us-alt-box .us-alt-header .badge { background: #0480D4; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; }
.tap-form .us-alt-box .us-alt-header span { font-size: 13px; font-weight: 600; color: #1E2B41; }
.tap-form .us-alt-reason { font-size: 12.5px; color: #0369a8; background: #dbeefa; border-radius: 6px; padding: 9px 12px; margin-bottom: 16px; line-height: 1.55; }

/* Pre-fill notice ---------------------------------------------------------- */
.tap-form .prefill-notice { display: flex; align-items: center; gap: 8px; background: #ecfdf5; border: 1.5px solid #6ee7b7; border-radius: 8px; padding: 9px 14px; font-size: 13px; color: #065f46; font-weight: 500; margin-bottom: 20px; }
.tap-form .prefill-notice .prefill-icon { font-size: 15px; color: #10b981; font-weight: 700; }
.tap-form .prefill-link { text-align: center; margin: 4px 0 18px; font-size: 13px; }
.tap-form .prefill-link a { color: #0480D4; font-weight: 600; text-decoration: none; }

/* Boxed checkbox row (billing same-as-account, international purchase) ----- */
.tap-form .check-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: #f7f9fc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 14px 16px; margin: 14px 0 4px;
}
.tap-form .check-row input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0;
  cursor: pointer; accent-color: #0480D4;
}
.tap-form .check-row label {
  margin: 0; cursor: pointer; font-size: 14px; font-weight: 700;
  color: #1E2B41; line-height: 1.4;
}
.tap-form .check-row .check-hint {
  display: block; font-size: 12.5px; font-weight: 400; color: #718096; margin-top: 2px;
}
/* `.tap-form .check-row` (0,2,0) would otherwise outrank global.css's
 * `.hide-on-startup{display:none}` (0,1,0); keep JS-toggled hiding working. */
.tap-form .check-row.hide-on-startup { display: none; }

/* Two-line payment-type cards (checkout) ----------------------------------- */
.tap-form .payment-toggle .toggle-btn { height: auto; padding: 12px 16px; text-align: left; }
.tap-form .payment-toggle .toggle-title { display: block; font-size: 15px; font-weight: 700; color: #1E2B41; }
.tap-form .payment-toggle .toggle-btn.selected .toggle-title { color: #0480D4; }
.tap-form .payment-toggle .toggle-sub { display: block; font-size: 12.5px; font-weight: 400; color: #718096; margin-top: 2px; }

/* "What do you need?" pay-later options (quote / invoice / wire) ------------ */
.tap-form .need-group { margin: 4px 0 10px; }
.tap-form .need-title { font-size: 16px; font-weight: 700; color: #1E2B41; margin-bottom: 10px; }
.tap-form .need-option {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid #e2e8f0; border-radius: 8px; background: #fff;
  padding: 14px 16px; margin: 0 0 10px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tap-form .need-option:hover { border-color: #b6c8dc; }
.tap-form .need-option.selected { border-color: #0480D4; background: #eef4ff; }
.tap-form .need-option input[type="radio"] {
  width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0;
  cursor: pointer; accent-color: #0480D4;
}
.tap-form .need-option .need-text { font-size: 14px; font-weight: 700; color: #1E2B41; line-height: 1.4; }
.tap-form .need-option .need-hint { display: block; font-size: 12.5px; font-weight: 400; color: #718096; margin-top: 2px; }

/* Checkbox row (promo opt-in, terms, international flag) -------------------- */
.tap-form .promo-row { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 4px; }
.tap-form .promo-row input { width: auto; height: auto; }
.tap-form .promo-row label { font-size: 12.5px; color: #4a5568; margin: 0; }
/* `.tap-form .promo-row` (0,2,0) would otherwise outrank global.css's
 * `.hide-on-startup{display:none}` (0,1,0); keep JS-toggled hiding working. */
.tap-form .promo-row.hide-on-startup { display: none; }

/* Buttons ------------------------------------------------------------------ */
.tap-form .btn-row { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 12px; }
.tap-form .s2-btn { height: 48px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; padding: 0 26px; transition: all 0.2s; }
.tap-form .s2-btn-primary {
  background: linear-gradient(135deg, #27B2BC 0%, #0480D4 50%, #366494 100%);
  color: #fff; flex: 1; box-shadow: 0 4px 12px rgba(4,128,212,0.25);
}
.tap-form .s2-btn-primary:hover { filter: brightness(0.94); box-shadow: 0 6px 16px rgba(4,128,212,0.32); }
.tap-form .s2-btn-secondary { background: #f0f4f8; color: #4a5568; }
.tap-form .s2-btn-secondary:hover { background: #e2e8f0; }
.tap-form .s2-btn-full { width: 100%; }

/* Links -------------------------------------------------------------------- */
.tap-form .signin-link { text-align: center; margin-top: 22px; font-size: 14px; color: #4a5568; }
.tap-form .signin-link a { color: #0480D4; font-weight: 600; text-decoration: none; }
.tap-form .field-hint { font-size: 11.5px; color: #718096; margin-top: 4px; }
.tap-form .field-hint a { color: #0480D4; text-decoration: none; }

/* Password reveal eye button ---------------------------------------------- */
.tap-form .pw-wrap { position: relative; }
.tap-form .pw-wrap input { padding-right: 46px; }
.tap-form .pw-eye {
  position: absolute; top: 0; right: 0; height: 46px; width: 46px;
  border: none; background: transparent; color: #4a5568; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tap-form .pw-eye:hover { color: #0480D4; }

/* Success panel ------------------------------------------------------------ */
.tap-form #success { display: none; text-align: center; padding: 16px 0 8px; }
.tap-form .success-icon { width: 64px; height: 64px; border-radius: 50%; background: #d1fae5; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 30px; color: #10b981; }
.tap-form #success h2 { font-size: 20px; font-weight: 700; color: #1a202c; margin-bottom: 8px; }
.tap-form #success p  { font-size: 14px; color: #718096; line-height: 1.6; }

/* Address character counter / error (course purchase address validation) --- */
.tap-form .addr-char-counter {
  font-size: 11.5px; margin-top: 4px; text-align: right;
  color: #718096; transition: color 0.25s, font-weight 0.25s; user-select: none;
}
.tap-form .addr-char-counter.addr-counter-ok   { color: #718096; }
.tap-form .addr-char-counter.addr-counter-warn { color: #dd6b20; font-weight: 600; }
.tap-form .addr-char-counter.addr-counter-over { color: #e53e3e; font-weight: 700; }
.tap-form .addr-error-msg {
  display: flex; align-items: center; gap: 6px; margin-top: 5px;
  padding: 7px 12px; background: #fff5f5; border: 1px solid #fbd5d5;
  border-left: 4px solid #e53e3e; border-radius: 6px; color: #842029;
  font-size: 12px; font-weight: 500; animation: addr-shake 0.35s ease;
}
.tap-form .addr-error-msg i { flex-shrink: 0; color: #e53e3e; }
@keyframes addr-shake {
  0% { transform: translateX(0); } 20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); } 60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); } 100% { transform: translateX(0); }
}
.tap-form .addr-input-warn { border-color: #dd6b20 !important; box-shadow: 0 0 0 3px rgba(221,107,32,0.2) !important; }
.tap-form .addr-input-over { border-color: #e53e3e !important; box-shadow: 0 0 0 3px rgba(229,62,62,0.25) !important; }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 520px) {
  .tap-form .s2-card { padding: 28px 20px 24px; }
  .tap-form .s2-row  { flex-direction: column; gap: 0; }
}
