/* ==========================================================
   Apply Funnel — apply.css
   10-step application quiz at /apply/
   ========================================================== */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-dark);
  background: var(--color-tan);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 3px solid var(--color-orange);
  outline-offset: 2px;
}
input { font-family: inherit; font-size: 18px; }
a { color: var(--color-blue); }

/* ---- Header Accent ---- */
.header-accent {
  height: 4px;
  background: var(--color-orange);
}

/* ---- Sticky Header ---- */
.apply-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-secondary-tan);
  position: sticky;
  top: 0;
  z-index: 50;
}
.apply-header-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.header-logo { height: 32px; display: block; }
.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-blue);
  font-weight: 700;
  font-size: 20px;
  font-family: var(--font-heading);
  text-decoration: none;
  transition: color 0.15s;
  min-height: 48px;
}
.header-phone:hover {
  color: var(--color-blue-hover);
}
.header-phone svg { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .header-phone { font-size: 16px; }
  .header-phone svg { width: 16px; height: 16px; }
}

/* ---- Main Shell ---- */
.apply-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
@media (max-width: 480px) {
  .apply-shell { padding: 20px 16px 40px; }
}

/* ---- Hero Section ---- */
.apply-hero {
  text-align: center;
  padding: 0 0 24px;
}
.apply-h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--color-blue);
  line-height: 1.15;
  margin-bottom: 12px;
}
.apply-h1 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}
.apply-sub {
  font-size: 17px;
  color: var(--color-dark);
  line-height: 1.55;
  opacity: 0.8;
}
@media (max-width: 480px) {
  .apply-h1 { font-size: 28px; }
  .apply-sub { font-size: 16px; }
}

/* ---- Value Card ---- */
.value-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.vc-title {
  font: 700 12px/1 var(--font-heading);
  color: var(--color-blue);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}
.vc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.vc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 14px/1.4 var(--font-heading);
  color: var(--color-dark);
}
.vc-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #E8F5E9;
  color: #2E7D32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .value-card { padding: 20px; }
}

/* ---- Card ---- */
.apply-card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0;
  overflow: hidden;
}
.apply-card-body {
  padding: 28px 28px 24px;
}
@media (max-width: 480px) {
  .apply-card-body { padding: 22px 20px 20px; }
}

/* ---- Progress Bar ---- */
.progress-track {
  height: 6px;
  background: #E9E2D4;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--color-blue);
  width: 10%;
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  border-radius: 0 3px 3px 0;
}
.progress-label {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dark);
  padding: 14px 0 0;
  margin: 0;
}

/* ---- Steps ---- */
.step { display: none; }
.step.active { display: block; }
.step.slide-forward {
  animation: fadeSlideLeft 0.3s ease both;
}
.step.slide-back {
  animation: fadeSlideRight 0.3s ease both;
}
@keyframes fadeSlideLeft {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeSlideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-blue);
  margin-bottom: 10px;
}
@media (max-width: 480px) {
  .step-title { font-size: 22px; }
}

.step-sub {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-dark);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ---- Option Buttons ---- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.options-grid.cols-3 {
  grid-template-columns: 1fr;
}
.options-grid.cols-5 {
  grid-template-columns: 1fr;
}

.option-btn {
  background: #fff;
  border: 2px solid #E2E5E8;
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  width: 100%;
  color: var(--color-dark);
  position: relative;
}
.option-btn:hover {
  border-color: #C8CDD2;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.option-btn.selected {
  border-color: var(--color-blue);
  background: #E7EEF4;
  box-shadow: none;
}
.option-btn.selected::after {
  content: '✓';
  position: absolute;
  right: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-btn-text {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-dark);
  line-height: 1.3;
}
.option-btn.selected .option-btn-text {
  color: var(--color-blue);
}

/* ---- Form Fields ---- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #E2E5E8;
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 18px;
  font-family: inherit;
  color: var(--color-dark);
  transition: all 0.15s;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2353565B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}
.field select.placeholder {
  color: #9CA3AF;
}
.field input:focus,
.field select:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(16, 73, 117, 0.15);
  outline: none;
}
.field input.invalid {
  border-color: var(--color-error);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field-row.cols-3 {
  grid-template-columns: 2fr 1fr 1.2fr;
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .field-row.cols-3 { grid-template-columns: 2fr 1fr 1.2fr; }
}

.field-error {
  font-size: 13px;
  color: var(--color-error);
  margin-top: 6px;
  display: none;
  font-weight: 600;
}
.field-error.visible { display: block; }

.zip-preview {
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  min-height: 20px;
}
.zip-preview.ok { color: var(--color-success); }
.zip-preview.err { color: var(--color-error); }

.dob-age {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-success);
  margin-top: 8px;
  min-height: 20px;
}

/* ---- Navigation Buttons ---- */
.nav {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}
.btn-next {
  background: var(--color-orange);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  min-height: 56px;
  padding: 16px 28px;
  flex: 1;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-button-orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-next:hover:not(:disabled) {
  background: #B5651F;
  transform: translateY(-1px);
}
.btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-back {
  background: transparent;
  color: var(--color-dark);
  border: 0;
  padding: 16px 18px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.btn-back:hover { color: var(--color-blue); }

/* ---- TCPA Disclosure ---- */
.tcpa-disclosure {
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-dark);
  opacity: 0.7;
  margin-top: 16px;
}

/* ---- Submit Error ---- */
.submit-error {
  color: var(--color-error);
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}
.submit-error a { color: var(--color-blue); font-weight: 700; }

/* ---- Processing Screen ---- */
.processing-screen {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 32px 28px;
  text-align: center;
}
.processing-title {
  font: 700 22px/1.2 var(--font-heading);
  color: var(--color-blue);
  margin-bottom: 24px;
}
.processing-progress {
  margin-bottom: 28px;
}
.processing-bar {
  height: 8px;
  background: #E9E2D4;
  border-radius: 4px;
  overflow: hidden;
}
.processing-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-blue);
  border-radius: 4px;
  transition: width 1.8s ease;
}
.processing-status {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font: 600 13px/1 var(--font-heading);
  color: var(--color-dark);
}
.processing-pct {
  color: var(--color-blue);
}
.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.processing-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 2px solid #E2E5E8;
  border-radius: var(--radius-md);
  text-align: left;
  opacity: 0.4;
  transition: all 0.4s ease;
}
.processing-step.proc-active {
  opacity: 1;
  border-color: var(--color-blue);
  background: #F0F5FA;
}
.processing-step.proc-done {
  opacity: 1;
  border-color: #2E7D32;
  background: #F1F8F1;
}
.proc-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.proc-icon.proc-pending {
  background: #F3F4F6;
  color: #9CA3AF;
}
.proc-icon.proc-spinning {
  background: #E7EEF4;
  color: var(--color-blue);
  animation: procSpin 1s linear infinite;
}
.proc-icon.proc-checked {
  background: #E8F5E9;
  color: #2E7D32;
}
@keyframes procSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.proc-label {
  font: 600 16px/1.3 var(--font-heading);
  color: var(--color-dark);
}
.proc-done .proc-label {
  color: #2E7D32;
}
.proc-active .proc-label {
  color: var(--color-blue);
  font-weight: 700;
}
.proc-detail {
  font-size: 14px;
  color: #6B7280;
  margin-top: 2px;
}
.processing-wait {
  font-size: 15px;
  color: var(--color-dark);
  opacity: 0.7;
}
@media (max-width: 480px) {
  .processing-screen { padding: 24px 20px; }
  .processing-title { font-size: 20px; }
  .processing-step { padding: 14px 16px; gap: 12px; }
  .proc-icon { width: 36px; height: 36px; }
  .proc-label { font-size: 15px; }
}

/* ---- Trust Strip ---- */
.trust-strip {
  text-align: center;
  padding: 28px 0 8px;
  font: 600 14px/1 var(--font-heading);
  color: var(--color-dark);
}
.ts-star { color: #F5A623; font-size: 16px; }

/* ---- Hedge Line ---- */
.hedge-line {
  text-align: center;
  font-size: 13px;
  color: var(--color-dark);
  opacity: 0.45;
  font-style: italic;
  padding: 0 8px 16px;
}

/* ---- Review Cards ---- */
.review-card:first-of-type {
  margin-top: 24px;
}
.review-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.rc-stars {
  color: #F5A623;
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.rc-quote {
  font-size: 15px;
  color: var(--color-dark);
  line-height: 1.65;
  margin-bottom: 12px;
}
.rc-attr {
  font: 700 13px/1 var(--font-heading);
  color: var(--color-blue);
}

/* ---- FAQ ---- */
.faq-section {
  margin-top: 32px;
}
.faq-heading {
  font: 700 20px/1.2 var(--font-heading);
  color: var(--color-blue);
  text-align: center;
  margin-bottom: 14px;
}
.faq-item {
  background: #fff;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.faq-item summary {
  padding: 18px 44px 18px 20px;
  font: 600 16px/1.4 var(--font-heading);
  color: var(--color-dark);
  cursor: pointer;
  list-style: none;
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 20px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-blue);
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: '\2212';
}
.faq-item p {
  padding: 0 20px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-dark);
}

/* ---- Bottom CTA ---- */
.bottom-cta {
  text-align: center;
  padding: 32px 0 8px;
}
.bottom-cta-btn {
  display: inline-flex;
  text-decoration: none;
  width: 100%;
}

/* ---- Mobile section spacing ---- */
@media (max-width: 480px) {
  .trust-strip { padding: 36px 0 12px; }
  .review-card:first-of-type { margin-top: 32px; }
  .review-card { margin-bottom: 16px; }
  .faq-section { margin-top: 40px; }
  .bottom-cta { padding: 40px 0 12px; }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  .step.slide-forward, .step.slide-back { animation: none; }
  .progress-fill { transition: none; }
}

/* ---- Footer ---- */
.apply-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--color-dark);
  opacity: 0.7;
  line-height: 1.8;
}
.apply-footer a {
  color: var(--color-dark);
  text-decoration: underline;
}
.apply-footer a:hover { color: var(--color-blue); }
