/* ─────────────────────────────────────────────────────────────
   PK Capital Solutions — Free Appraisal Request
   Design tokens and type scale match the Payoff Request form so
   the two pages read as one system.
   ───────────────────────────────────────────────────────────── */

/* Gotham fallback stack — uses the licensed local font when the
   viewer has it, falls back to Barlow otherwise. */
@font-face {
  font-family: 'Gotham';
  src: local('Gotham'), local('Gotham-Book');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: local('Gotham Bold'), local('Gotham-Bold');
  font-weight: 700;
  font-display: swap;
}

:root {
  --pk-navy: #1D2E58;
  --pk-navy-deep: #253870;
  --pk-orange: #F16924;
  --pk-orange-light: #f47f3a;
  --pk-cream: #f8f8f9;
  --pk-white: #ffffff;
  --pk-gray: #6b7280;
  --pk-gray-light: #DADBDF;
  --pk-border: #c8c9cd;
  --pk-success: #2d6a4f;
  --pk-error: #c0392b;
  --radius: 4px;
  --shadow: 0 2px 16px rgba(29, 46, 88, 0.10);
  --font-body: 'Gotham', 'Barlow', 'Gill Sans', sans-serif;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--pk-cream);
  color: var(--pk-navy);
  min-height: 100vh;
  padding: 0 0 60px;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link — first thing a keyboard user reaches. */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--pk-orange);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ── HEADER ───────────────────────────────────────────────── */
.header {
  background: var(--pk-navy);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 3px solid var(--pk-orange);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: var(--radius);
}

.logo-icon {
  width: auto;
  height: 56px;
  object-fit: contain;
  display: block;
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--pk-navy) 0%, var(--pk-navy-deep) 100%);
  padding: 48px 40px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  border: 40px solid rgba(241, 105, 36, 0.12);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 280px; height: 280px;
  border: 50px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  color: var(--pk-white);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.hero h1 span { color: var(--pk-orange); }

.hero p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* Three short proof points — the one thing a lead-gen page owes a
   visitor before it asks for their phone number. */
.hero-points {
  position: relative;
  z-index: 1;
  margin: 26px auto 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  max-width: 620px;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.hero-points li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pk-orange);
  flex-shrink: 0;
}

/* ── FORM CARD ────────────────────────────────────────────── */
.form-wrap {
  max-width: 720px;
  margin: 32px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.form-card {
  background: var(--pk-white);
  border-radius: 8px;
  box-shadow: var(--shadow), 0 0 0 1px var(--pk-border);
  overflow: hidden;
  animation: slideUp 0.5s ease both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SECTION HEADER ───────────────────────────────────────── */
.section-label {
  background: var(--pk-gray-light);
  border-bottom: 1px solid var(--pk-border);
  padding: 14px 32px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pk-gray);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--pk-orange);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── FORM BODY ────────────────────────────────────────────── */
.form-body { padding: 32px 32px 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.field-row.single { grid-template-columns: 1fr; }

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-group > label,
.field-legend {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--pk-navy);
  text-transform: uppercase;
}

.req { color: var(--pk-orange); margin-left: 2px; }
.opt {
  color: var(--pk-gray);
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  border: 1.5px solid var(--pk-border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--pk-navy);
  background: var(--pk-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}

textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.55;
}

input:focus, textarea:focus {
  border-color: var(--pk-orange);
  box-shadow: 0 0 0 3px rgba(241, 105, 36, 0.1);
}

input::placeholder, textarea::placeholder {
  color: #b0aaa3;
  letter-spacing: 0.01em;
}

/* Money fields — the $ lives outside the input as a fixed prefix so it
   never scrolls out of view once the typed value is wider than the box. */
.money-field {
  position: relative;
}

.money-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--pk-navy);
  pointer-events: none;
}

.money-field input {
  padding-left: 30px;
}

.hint {
  font-size: 11px;
  color: var(--pk-gray);
  letter-spacing: 0.01em;
}

/* Conditional deal fields.
   grid-template-rows animates without a magic max-height that clips
   content once the field set grows. */
.conditional-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
}
.conditional-wrap > * { overflow: hidden; min-height: 0; }
.conditional-wrap.visible { grid-template-rows: 1fr; opacity: 1; }
/* Once fully open, let focus glow/box-shadow on inner fields render past
   their own box instead of being clipped by the collapse-animation hider. */
.conditional-wrap.visible > * { overflow: visible; }

/* ── RADIO GROUP ──────────────────────────────────────────── */
fieldset.field-group { border: 0; gap: 8px; }

.radio-group {
  display: flex;
  gap: 12px 16px;
  flex-wrap: wrap;
  /* Chromium doesn't apply flex `gap` between a <legend> and its
     siblings, so the legend-to-content spacing needs an explicit margin. */
  margin-top: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 22px;
  border: 1.5px solid var(--pk-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--pk-gray);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  user-select: none;
  position: relative;
}

/* The native input stays in the accessibility tree and the tab order —
   it is only visually hidden — so the group is keyboard operable. */
.radio-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.radio-option:hover { border-color: var(--pk-orange-light); color: var(--pk-navy); }

.radio-option.selected {
  border-color: var(--pk-orange);
  background: rgba(241, 105, 36, 0.06);
  color: var(--pk-navy);
}

.radio-option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(241, 105, 36, 0.25);
  border-color: var(--pk-orange);
}

.radio-dot {
  width: 14px; height: 14px;
  border: 2px solid var(--pk-border);
  border-radius: 50%;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  flex-shrink: 0;
}

.radio-option.selected .radio-dot {
  border-color: var(--pk-orange);
  background: var(--pk-orange);
  box-shadow: inset 0 0 0 3px #fff;
}

/* ── ERROR STATES ─────────────────────────────────────────── */
.field-error {
  font-size: 11px;
  color: var(--pk-error);
  margin-top: 2px;
  display: none;
}

.field-group.has-error input,
.field-group.has-error textarea,
.field-group.has-error .radio-option {
  border-color: var(--pk-error);
}

.field-group.has-error .field-error { display: block; }

.error-summary {
  display: none;
  margin: 0 32px 4px;
  padding: 14px 18px;
  border: 1.5px solid var(--pk-error);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: rgba(192, 57, 43, 0.05);
}

.error-summary.show { display: block; }

.error-summary h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pk-error);
  margin-bottom: 6px;
}

.error-summary ul { margin: 0; padding-left: 18px; }

.error-summary li { font-size: 13px; color: var(--pk-navy); line-height: 1.6; }

.error-summary a { color: var(--pk-error); }

/* ── FOOTER / SUBMIT ──────────────────────────────────────── */
.form-footer {
  padding: 24px 32px 32px;
  border-top: 1px solid var(--pk-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-note {
  font-size: 12px;
  color: var(--pk-gray);
  line-height: 1.5;
  max-width: 320px;
}

.btn-submit {
  background: var(--pk-orange);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(241, 105, 36, 0.3);
  white-space: nowrap;
}

.btn-submit:hover:not(:disabled) {
  background: var(--pk-orange-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(241, 105, 36, 0.35);
}

.btn-submit:active:not(:disabled) { transform: translateY(0); }

.btn-submit:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* One consistent focus ring across every interactive element. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--pk-orange);
  outline-offset: 2px;
}

.header a:focus-visible,
.hero a:focus-visible { outline-color: #fff; }

/* ── SITE FOOTER ──────────────────────────────────────────── */
.site-footer {
  max-width: 720px;
  margin: 28px auto 0;
  padding: 0 24px;
  text-align: center;
  font-size: 12px;
  color: var(--pk-gray);
  line-height: 1.7;
}

.site-footer a { color: var(--pk-navy); }

/* ── SUCCESS OVERLAY ──────────────────────────────────────── */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 39, 68, 0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.success-overlay.show { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.success-card {
  background: #fff;
  border-radius: 10px;
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.success-icon {
  width: 64px; height: 64px;
  background: rgba(45, 106, 79, 0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}

.success-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--pk-navy);
  margin-bottom: 10px;
}

.success-card p {
  font-size: 14px;
  color: var(--pk-gray);
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-done {
  background: var(--pk-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 32px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-done:hover { background: var(--pk-navy-deep); }

.redirect-note {
  font-size: 12px;
  color: var(--pk-gray);
  margin: 14px 0 0;
}

/* ── SPINNER ──────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .header { padding: 16px 20px; }
  .logo-icon { height: 44px; }
  .hero { padding: 36px 20px 52px; }
  .hero h1 { font-size: 34px; }
  .hero-points { gap: 8px 18px; }
  .hero-points li { font-size: 11px; }
  .form-wrap { margin-top: 20px; padding: 0 12px; }
  .form-body, .form-footer { padding-left: 20px; padding-right: 20px; }
  .error-summary { margin-left: 20px; margin-right: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .section-label { padding: 12px 20px; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .footer-note { max-width: none; }
  .btn-submit { width: 100%; text-align: center; }
  .success-card { padding: 36px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
