/* ============================================================================
   56 South Financing — Credit Application
   Refined, professional fintech styling. Framework-free. Preserves all field
   names, reCAPTCHA, presigned-URL upload, and legalConsent capture.
   ============================================================================ */

.grecaptcha-badge { visibility: hidden !important; }

/* ---------------------------------------------------------------- Tokens -- */
:root {
  /* Brand — electric blue, used sparingly (primary action, progress, links, active state) */
  --brand: #0a66ff;
  --brand-strong: #0a4fd0;
  --brand-tint: #eaf2ff;
  --brand-ring: rgba(10, 102, 255, 0.18);

  /* Ink + cool-gray neutral ramp (the dominant palette) */
  --ink: #15181e;
  --ink-2: #2c313b;
  --ink-soft: #5a616e;
  --muted: #828b99;

  --gray-50:  #fafbfc;
  --gray-100: #f4f6f8;
  --gray-150: #eef1f4;
  --gray-200: #e4e8ed;
  --gray-300: #d6dbe2;
  --gray-400: #aab1bd;
  --gray-500: #828b99;
  --gray-600: #5a616e;
  --gray-700: #3a414c;

  --success: #15803d;
  --success-tint: #f0faf3;
  --error: #c0362c;
  --error-tint: #fcf3f2;
  --warning: #b45309;

  --page-bg: #f6f8fc;
  --card-bg: #ffffff;
  --field-bg: #ffffff;
  --line: #e4e8ed;
  --line-strong: #d6dbe2;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, monospace;

  --space-xs: 0.5rem;  --space-sm: 0.75rem; --space-md: 1rem;
  --space-lg: 1.5rem;  --space-xl: 2rem;    --space-2xl: 2.75rem;

  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-xl: 14px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.10);
}

/* One consistent electric-blue accent across all stores (56 South platform design).
   The store's own logo at the top provides the per-store identity. */

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5b9bff; --brand-strong: #7db0ff; --brand-tint: #11203a; --brand-ring: rgba(91,155,255,0.30);
    --ink: #e7ebf1; --ink-2: #cdd4de; --ink-soft: #99a2b0; --muted: #79828f;
    --page-bg: #0c0f15; --card-bg: #14181f; --field-bg: #0f141b;
    --gray-50: #14181f; --gray-100: #0f141b; --gray-150: #161b23; --gray-200: #232a34; --gray-300: #2c3440;
    --gray-400: #5a626f; --gray-500: #8a93a1; --gray-600: #aab2bf; --gray-700: #cdd4de;
    --line: #232a34; --line-strong: #2c3440; --error-tint: #25161a; --success-tint: #0f211a;
  }
}

/* ------------------------------------------------------------ Base/reset -- */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  min-height: 100vh;
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
  letter-spacing: -0.005em;
  padding: var(--space-xl) var(--space-md) 7rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-underline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; font-size: 14px;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- Header -- */
header { max-width: 600px; margin: 0 auto var(--space-md); text-align: center; }
.logo-container { padding: var(--space-xs) 0; }
.logo-container img { height: 38px; width: auto; max-width: 210px; object-fit: contain; }

header h1 {
  font-size: 1.375rem; font-weight: 600; color: var(--ink);
  letter-spacing: -0.025em; margin-top: var(--space-sm);
}
.header-sub {
  font-size: 0.8125rem; color: var(--muted); margin-top: 6px;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 450;
}
.header-sub svg { width: 14px; height: 14px; stroke-width: 1.75; }

/* Progress (sticky) */
.progress-shell {
  position: sticky; top: 0; z-index: 50;
  max-width: 600px; margin: var(--space-lg) auto 0;
  background: var(--page-bg); padding: var(--space-sm) 0;
}
.progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; font-weight: 500;
  letter-spacing: 0; text-transform: uppercase; letter-spacing: 0.04em;
}
.progress-meta .step-name { color: var(--ink-2); }
.progress-meta > span:last-child { font-variant-numeric: tabular-nums; }
.progress-container { background: var(--gray-200); border-radius: 999px; height: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); border-radius: 999px; width: 0%; transition: width 0.4s cubic-bezier(0.4,0,0.2,1); }

/* ------------------------------------------------------------------ Main -- */
main { max-width: 600px; margin: 0 auto; }

/* Trust band — quiet, monochrome */
.trust-band {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md) var(--space-lg);
  padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-md);
}
.trust-item { display: inline-flex; align-items: center; gap: 7px; font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.trust-item svg { width: 14px; height: 14px; color: var(--gray-400); stroke-width: 1.75; flex-shrink: 0; }

/* ------------------------------------------------------------------ Form -- */
form {
  background: var(--card-bg); padding: var(--space-xl) var(--space-xl) var(--space-2xl);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}

.form-section[hidden] { display: none !important; }
.form-section { animation: fade 0.25s ease; }

.form-section h2 {
  color: var(--ink); font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 9px;
  padding-bottom: var(--space-md); margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--line);
}
.form-section h2 svg { width: 17px; height: 17px; color: var(--brand); stroke-width: 1.75; flex-shrink: 0; }
.section-intro { color: var(--ink-soft); font-size: 0.8125rem; margin: calc(-1 * var(--space-md)) 0 var(--space-lg); line-height: 1.5; }

.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-md) var(--space-lg); margin-bottom: var(--space-lg);
}
.form-row:last-child { margin-bottom: 0; }
.form-group { display: flex; flex-direction: column; position: relative; }

.form-group label {
  font-weight: 500; color: var(--ink-2); margin-bottom: 7px;
  font-size: 0.8125rem; letter-spacing: -0.005em; line-height: 1.3;
}
.form-group label .req { color: var(--brand); font-weight: 500; margin-left: 2px; }
.optional-tag { color: var(--muted); font-weight: 400; font-size: 0.75rem; margin-left: 5px; }

/* Inputs */
input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="number"], select {
  width: 100%; min-height: 44px; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  font-size: 15px; font-family: inherit; background: var(--field-bg); color: var(--ink);
  letter-spacing: -0.005em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (max-width: 600px) {
  input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
  input[type="number"], select { font-size: 16px; } /* avoid iOS zoom */
}
select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23828b99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
input::placeholder { color: var(--muted); }

input:focus, select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}

input[name="ssn"], input[type="tel"] { font-feature-settings: 'tnum'; letter-spacing: 0.02em; }

/* Currency */
.input-currency-wrapper { position: relative; display: flex; align-items: center; }
.input-currency-wrapper .currency-prefix {
  position: absolute; left: 13px; color: var(--muted); font-weight: 500; pointer-events: none; z-index: 1; font-size: 15px;
}
.input-currency-wrapper input { padding-left: 26px; }
.input-currency-wrapper input::-webkit-outer-spin-button,
.input-currency-wrapper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-currency-wrapper input[type="number"] { -moz-appearance: textfield; }

/* Reassurance microcopy */
.field-note {
  font-size: 0.75rem; color: var(--muted); margin-top: 7px;
  display: flex; align-items: flex-start; gap: 6px; line-height: 1.45;
}
.field-note svg { width: 13px; height: 13px; color: var(--gray-400); stroke-width: 1.75; flex-shrink: 0; margin-top: 2px; }

/* Validation states */
.form-group.success input:not([type="file"]), .form-group.success select { border-color: var(--success); }
.form-group.success:not(.has-select):not(.has-currency):not(.has-file)::after {
  content: ''; position: absolute; right: 13px; top: 36px; width: 15px; height: 15px; pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
}
.form-group.error input, .form-group.error select { border-color: var(--error); background: var(--error-tint); }

.error-message { color: var(--error); font-size: 0.78rem; font-weight: 500; margin-top: 6px; display: none; }
.form-group.error .error-message { display: block; }

/* File upload */
.file-drop {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-md);
  background: var(--gray-50); padding: var(--space-md) var(--space-lg); text-align: center; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease; position: relative;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--brand); background: var(--brand-tint); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop .fd-icon { width: 22px; height: 22px; color: var(--gray-400); stroke-width: 1.75; margin: 0 auto 6px; display: block; }
.file-drop .fd-text { font-size: 0.8125rem; color: var(--ink-soft); }
.file-drop .fd-text b { color: var(--brand); font-weight: 600; }
.file-hint { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 5px; }
.form-group.success .file-drop { border-style: solid; border-color: var(--success); background: var(--success-tint); }
.form-group.error .file-drop { border-color: var(--error); background: var(--error-tint); }

.file-info {
  display: none; font-size: 0.8125rem; color: var(--ink-2); margin-top: 8px;
  padding: 8px 11px; background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius-sm);
  align-items: center; gap: 8px; text-align: left;
}
.file-info.visible { display: flex; }
.file-info::before {
  content: ''; width: 15px; height: 15px; flex-shrink: 0;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
}
.upload-progress { height: 3px; background: var(--gray-200); border-radius: 999px; margin-top: 8px; overflow: hidden; display: none; }
.upload-progress.visible { display: block; }
.upload-progress > span { display: block; height: 100%; width: 0%; background: var(--brand); transition: width 0.2s ease; }

/* Reference blocks — quiet */
.reference-block {
  background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-lg); margin-bottom: var(--space-md);
}
.reference-block:last-child { margin-bottom: 0; }
.reference-block h3 { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; margin-bottom: var(--space-md); letter-spacing: 0.02em; text-transform: uppercase; }

/* ----------------------------------------------------------- Step nav bar -- */
.wizard-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255,255,255,0.85); backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line); padding: var(--space-sm) var(--space-md);
}
@media (prefers-color-scheme: dark) { .wizard-nav { background: rgba(20,24,31,0.85); } }
.wizard-nav-inner { max-width: 600px; margin: 0 auto; display: flex; gap: var(--space-sm); align-items: center; }
.btn {
  min-height: 46px; padding: 0 var(--space-lg); border-radius: var(--radius-md);
  font-size: 0.9375rem; font-weight: 600; font-family: inherit; cursor: pointer; border: 1px solid transparent;
  letter-spacing: -0.01em;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-primary { background: var(--brand); color: #fff; flex: 1; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-primary:disabled { background: var(--gray-300); color: #fff; cursor: not-allowed; }
.btn-ghost { background: var(--card-bg); color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn svg { width: 16px; height: 16px; stroke-width: 2; }

button[type="submit"], #submitButton {
  min-height: 46px; padding: 0 var(--space-lg); background: var(--brand); color: #fff; border: none;
  border-radius: var(--radius-md); font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  letter-spacing: -0.01em; box-shadow: var(--shadow-xs);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button[type="submit"]:hover { background: var(--brand-strong); }
button[type="submit"]:disabled { background: var(--gray-300); cursor: not-allowed; }
button[type="submit"] svg { width: 16px; height: 16px; stroke-width: 2; }
button[type="submit"].submitting { color: transparent; position: relative; }
button[type="submit"].submitting::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* ------------------------------------------------------------ Review step -- */
.review-group { margin-bottom: var(--space-lg); }
.review-group:last-of-type { margin-bottom: 0; }
.review-group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-sm); }
.review-group-head h3 { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.review-edit { background: none; border: none; color: var(--brand); font-weight: 600; font-size: 0.8125rem; cursor: pointer; padding: 3px 6px; border-radius: var(--radius-sm); }
.review-edit:hover { background: var(--brand-tint); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-md) var(--space-lg);
  background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-md) var(--space-lg); }
.review-item { font-size: 0.875rem; min-width: 0; }
.review-item .rk { color: var(--muted); font-size: 0.72rem; display: block; margin-bottom: 1px; text-transform: uppercase; letter-spacing: 0.04em; }
.review-item .rv { color: var(--ink); font-weight: 500; word-break: break-word; }

.review-consent {
  display: flex; gap: 9px; align-items: flex-start; background: var(--gray-50);
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-md); margin-top: var(--space-lg);
  font-size: 0.8125rem; color: var(--ink-soft); line-height: 1.5;
}
.review-consent svg { width: 16px; height: 16px; color: var(--brand); stroke-width: 1.75; flex-shrink: 0; margin-top: 1px; }

/* -------------------------------------------------------- Error summary --- */
.error-summary {
  background: var(--error-tint); border: 1px solid var(--error); border-radius: var(--radius-md);
  padding: var(--space-md); display: flex; align-items: flex-start; gap: var(--space-sm); margin-bottom: var(--space-lg);
}
.error-summary-icon { color: var(--error); flex-shrink: 0; display: flex; }
.error-summary-icon svg { width: 18px; height: 18px; }
.error-summary-content { flex: 1; }
.error-summary-content strong { color: var(--error); font-size: 0.875rem; font-weight: 600; }
.error-summary-content ul { list-style: none; margin: 6px 0 0; padding: 0; }
.error-summary-content li { color: var(--ink-2); font-size: 0.8125rem; padding: 2px 0; cursor: pointer; }
.error-summary-content li:hover { color: var(--error); text-decoration: underline; }
.error-summary-content li::before { content: '—'; color: var(--error); margin-right: 7px; }
.error-summary-close { background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; flex-shrink: 0; }
.error-summary-close:hover { color: var(--error); }

/* Resume draft banner */
.resume-banner {
  max-width: 600px; margin: 0 auto var(--space-md); display: flex; align-items: center; gap: var(--space-sm);
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md); font-size: 0.8125rem; color: var(--ink-2); box-shadow: var(--shadow-xs);
}
.resume-banner svg { width: 16px; height: 16px; color: var(--brand); stroke-width: 1.75; flex-shrink: 0; }
.resume-banner .rb-actions { margin-left: auto; display: flex; gap: var(--space-xs); }
.resume-banner button { font-size: 0.8125rem; font-weight: 600; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.resume-banner .rb-yes { background: var(--brand); color: #fff; }
.resume-banner .rb-no { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }

/* ------------------------------------------------------- Legal modal ------ */
#disclosurePopup {
  position: fixed; inset: 0; background: rgba(15, 18, 24, 0.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: var(--space-md);
}
.popup-content {
  background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  max-width: 540px; width: 100%; max-height: 88vh; overflow: hidden; border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.popup-content h3 { color: var(--ink); font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; text-align: center; padding: var(--space-lg) var(--space-lg) var(--space-md); border-bottom: 1px solid var(--line); }
.welcome-lead { text-align: center; color: var(--ink-soft); font-size: 0.875rem; padding: var(--space-md) var(--space-lg) var(--space-sm); }
.welcome-meta { display: flex; justify-content: center; gap: var(--space-lg); padding: 0 var(--space-lg) var(--space-md); flex-wrap: wrap; }
.welcome-meta .wm { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--ink-2); font-weight: 500; }
.welcome-meta svg { width: 14px; height: 14px; color: var(--brand); }
.have-ready { background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius-md); margin: 0 var(--space-lg) var(--space-md); padding: var(--space-md); }
.have-ready h4 { font-size: 0.72rem; color: var(--muted); margin-bottom: var(--space-xs); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.have-ready ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.have-ready li { font-size: 0.8125rem; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.have-ready li svg { width: 14px; height: 14px; color: var(--success); flex-shrink: 0; }
.popup-body { overflow-y: auto; padding: 0 var(--space-lg) var(--space-md); }
.popup-body h4 { margin: var(--space-md) 0 var(--space-xs); font-size: 0.875rem; color: var(--ink); font-weight: 600; }
.popup-body h4:first-child { margin-top: var(--space-md); }
.popup-body p, .popup-body li { color: var(--ink-soft); line-height: 1.55; }
.popup-body ul { padding-left: var(--space-lg); margin-bottom: var(--space-sm); }
.popup-body details { border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: var(--space-md); }
.popup-body details summary { cursor: pointer; padding: var(--space-sm) var(--space-md); font-weight: 500; font-size: 0.875rem; color: var(--ink-2); }
.popup-body details[open] summary { border-bottom: 1px solid var(--line); }
.popup-foot, .popup-body > div:last-child { padding-top: var(--space-md); }
.popup-content label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.8125rem; color: var(--ink-2); line-height: 1.5; }
#agreeCheckbox { width: 18px; height: 18px; min-width: 18px; margin-top: 1px; accent-color: var(--brand); cursor: pointer; }
#agreeButton {
  width: 100%; min-height: 48px; background: var(--brand); color: #fff; border: none;
  border-radius: var(--radius-md); font-size: 0.9375rem; font-weight: 600; cursor: pointer; letter-spacing: -0.01em;
  transition: background 0.15s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
#agreeButton:hover:not(:disabled) { background: var(--brand-strong); }
#agreeButton:disabled { background: var(--gray-300); cursor: not-allowed; }
#agreeButton svg { width: 16px; height: 16px; }

/* ---------------------------------------------------- Loading / success --- */
.loading-overlay, .success-overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 24, 0.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 9999; padding: var(--space-md);
}
.loading-content, .success-content {
  background: var(--card-bg); padding: var(--space-2xl) var(--space-xl); border-radius: var(--radius-xl);
  text-align: center; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.loading-spinner { width: 38px; height: 38px; margin: 0 auto var(--space-lg); border: 3px solid var(--gray-200); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
.loading-content p { font-size: 1rem; font-weight: 600; margin-bottom: var(--space-xs); color: var(--ink); }
.loading-content .ld-sub { font-size: 0.8125rem; color: var(--ink-soft); font-weight: 400; }

.success-icon { width: 56px; height: 56px; background: var(--success-tint); color: var(--success); font-size: 28px; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-lg); animation: pop 0.45s ease; border: 1px solid rgba(21,128,61,0.2); }
.success-content h2 { color: var(--ink); margin-bottom: var(--space-xs); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.success-content > p { color: var(--ink-soft); font-size: 0.9375rem; }
.success-ref { display: inline-block; margin-top: var(--space-md); font-family: var(--font-mono); font-size: 0.8125rem; background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 5px 11px; color: var(--ink-2); }
.success-ref strong { font-weight: 700; color: var(--ink); }
.next-steps { list-style: none; text-align: left; margin: var(--space-lg) 0; display: grid; gap: var(--space-sm); padding: 0; }
.next-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8125rem; color: var(--ink-soft); line-height: 1.45; }
.next-steps .ns-num { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 700; font-size: 0.72rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.success-content .btn { width: 100%; margin-top: var(--space-sm); }

/* ---------------------------------------------------------------- Footer -- */
footer { max-width: 600px; margin: var(--space-2xl) auto 0; text-align: center; padding-top: var(--space-lg); border-top: 1px solid var(--line); }
.powered-by { display: inline-flex; align-items: baseline; gap: 7px; margin-bottom: var(--space-md); }
.powered-by .pb-label { color: var(--muted); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.powered-by .ps-wordmark { color: var(--ink); font-size: 0.9rem; font-weight: 700; letter-spacing: -0.01em; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-xs); }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: 0.78rem; }
.footer-links a:hover { color: var(--brand); }
.footer-copy { color: var(--muted); font-size: 0.72rem; }

/* ----------------------------------------------------------- Utilities ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  body { padding: var(--space-lg) var(--space-sm) 6.5rem; }
  form { padding: var(--space-lg) var(--space-md) var(--space-xl); }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .loading-spinner, button[type="submit"].submitting::after { animation: spin 0.7s linear infinite !important; }
}
