/* ═══════════════════════════════════════════════════════
   TX Vehicle Sale Kit — app.css
   Brand: #861316 red, #fff, #000, #c0c0c0,
          rgba(37,37,37,.97) dark-grey, #f2f2f2 light-grey
   Offered by Dallas Web Pro
   ═══════════════════════════════════════════════════════ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #861316;
  --red-hover:  #6e1012;
  --white:      #fff;
  --black:      #000;
  --grey:       #c0c0c0;
  --dark-grey:  rgba(37,37,37,.97);
  --light-grey: #f2f2f2;
  --error:      #c0392b;
  --success:    #27ae60;
  --font:       'SinkinSans-500Medium', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-bold:  'SinkinSans-700Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius:     4px;
  --max-w:      720px;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  color: var(--dark-grey);
  background: var(--light-grey);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
#app-header {
  background: var(--red);
  color: var(--white);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
#app-header h1 {
  font-family: var(--font-bold);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .3px;
}
.header-sub {
  font-size: .82rem;
  opacity: .85;
}

/* ── Hero / Intro ── */
.hero-intro {
  background: var(--dark-grey);
  color: var(--white);
  padding: 28px 20px 24px;
  border-bottom: 3px solid var(--red);
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero-title {
  font-family: var(--font-bold);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: .2px;
}
.hero-description {
  font-size: .88rem;
  line-height: 1.65;
  opacity: .88;
  margin-bottom: 18px;
}
.hero-description strong {
  color: var(--white);
  opacity: 1;
}
.hero-steps {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 16px;
}
.hero-steps li {
  font-size: .82rem;
  opacity: .9;
  margin-bottom: 4px;
}
.hero-steps strong {
  color: var(--white);
}

/* ── Main ── */
#app-main {
  max-width: var(--max-w);
  width: 100%;
  margin: 20px auto;
  padding: 0 16px;
  flex: 1;
}

/* ── Fieldsets ── */
fieldset {
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  padding: 14px 16px 18px;
  margin-bottom: 16px;
  background: var(--white);
}
legend {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: .95rem;
  color: var(--red);
  padding: 0 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.legend-link {
  font-family: var(--font);
  font-weight: 400;
  font-size: .75rem;
  color: var(--dark-grey);
  opacity: .6;
  text-decoration: underline;
}
.legend-link:hover { opacity: 1; }
.legend-note {
  font-family: var(--font);
  font-weight: 400;
  font-size: .75rem;
  color: var(--dark-grey);
  opacity: .55;
}

/* ── Fields ── */
.field-row {
  margin-bottom: 10px;
}
.field-row label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--dark-grey);
}
.field-row input[type="text"],
.field-row input[type="number"],
.field-row input[type="email"],
.field-row input[type="tel"],
.field-row input[type="date"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .88rem;
  color: var(--dark-grey);
  background: var(--white);
  transition: border-color .15s;
}
.field-row input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(134,19,22,.12);
}
.field-row input.input--short {
  max-width: 100px;
}
.field-hint {
  display: block;
  font-size: .72rem;
  color: var(--dark-grey);
  opacity: .55;
  margin-top: 2px;
}

/* ── Multi-column rows ── */
.field-row--duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-row--trio {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

/* ── Radio groups ── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.radio-label {
  font-size: .82rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.radio-label input[type="radio"] {
  accent-color: var(--red);
}

/* ── Validation errors ── */
.field-row input.has-error {
  border-color: var(--error);
  background: #fdf0ef;
}
.field-error {
  font-size: .72rem;
  color: var(--error);
  margin-top: 2px;
}

/* ── Error summary ── */
.error-summary {
  max-width: var(--max-w);
  margin: 12px auto 0;
  padding: 12px 16px;
  background: #fdf0ef;
  border: 1px solid var(--error);
  border-radius: var(--radius);
  color: var(--error);
  font-size: .82rem;
}
.error-summary ul {
  margin-top: 6px;
  padding-left: 18px;
}
.error-summary li {
  margin-bottom: 2px;
}

/* ── Form versions ── */
.form-versions {
  font-size: .72rem;
  color: var(--dark-grey);
  opacity: .5;
  margin-bottom: 14px;
  padding: 0 2px;
}
.form-versions span {
  display: inline-block;
  margin-right: 16px;
}

/* ── Buttons ── */
.form-actions {
  text-align: center;
  margin: 20px 0;
}
.btn {
  display: inline-block;
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-bold);
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  text-decoration: none;
}
.btn--primary {
  background: var(--red);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--red-hover);
  box-shadow: 0 2px 8px rgba(134,19,22,.25);
}
.btn--primary:disabled {
  background: var(--grey);
  cursor: not-allowed;
}
.btn--secondary {
  background: var(--dark-grey);
  color: var(--white);
}
.btn--secondary:hover {
  background: var(--black);
}
.btn--outline {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}
.btn--outline:hover {
  background: var(--red);
  color: var(--white);
}

/* ── Results pane ── */
.results-pane {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto 30px;
  padding: 0 16px;
}
.results-pane h2 {
  font-family: var(--font-bold);
  font-size: 1.15rem;
  color: var(--red);
  margin-bottom: 14px;
}
.results-preview {
  background: var(--white);
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.results-preview iframe {
  width: 100%;
  height: 600px;
  border: none;
}
.results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.results-individual {
  margin-bottom: 14px;
}
.results-individual summary {
  font-size: .85rem;
  cursor: pointer;
  color: var(--red);
  font-weight: 600;
}
.results-individual ul {
  list-style: none;
  padding: 8px 0 0 0;
}
.results-individual li {
  margin-bottom: 6px;
}
.results-individual a {
  font-size: .85rem;
  color: var(--dark-grey);
  text-decoration: underline;
}
.results-individual a:hover {
  color: var(--red);
}
.courtesy-note {
  font-size: .78rem;
  color: var(--dark-grey);
  opacity: .7;
  border-left: 3px solid var(--red);
  padding-left: 10px;
  margin-top: 10px;
}

/* ── Footer ── */
#app-footer {
  background: var(--dark-grey);
  color: var(--grey);
  padding: 18px 20px;
  margin-top: auto;
}
.disclaimer {
  max-width: var(--max-w);
  margin: 0 auto;
  font-size: .72rem;
  line-height: 1.55;
}
.disclaimer a {
  color: var(--white);
}
.offered-by {
  max-width: var(--max-w);
  margin: 8px auto 0;
  font-size: .72rem;
  color: var(--white);
  opacity: .6;
}
.offered-by a {
  color: var(--white);
}

/* ── Legal pages ── */
.legal-page {
  background: var(--white);
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  padding: 28px 28px 36px;
}
.legal-page h2 {
  font-family: var(--font-bold);
  font-size: 1.25rem;
  color: var(--red);
  margin-bottom: 4px;
}
.legal-page h3 {
  font-family: var(--font-bold);
  font-size: .95rem;
  color: var(--dark-grey);
  margin: 20px 0 6px;
}
.legal-page p {
  font-size: .85rem;
  line-height: 1.6;
  margin-bottom: 8px;
}
.legal-page ul {
  font-size: .85rem;
  line-height: 1.6;
  padding-left: 22px;
  margin-bottom: 10px;
}
.legal-page li {
  margin-bottom: 3px;
}
.legal-date {
  font-size: .78rem !important;
  color: var(--dark-grey);
  opacity: .6;
  margin-bottom: 16px !important;
}
.legal-back {
  margin-top: 24px !important;
}
.legal-back a {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
}
.legal-back a:hover {
  text-decoration: underline;
}

/* ── Loading state ── */
.btn--primary.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn--primary.is-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid var(--white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 540px) {
  .field-row--duo, .field-row--trio {
    grid-template-columns: 1fr;
  }
  .results-actions {
    flex-direction: column;
  }
  .results-actions .btn {
    width: 100%;
    text-align: center;
  }
  .hero-steps {
    flex-direction: column;
    gap: 10px;
  }
}
