/* === APP STYLES — Quote Comparison Engine === */
/* Uses same CSS custom properties as theme.css */

.app-main {
  background: var(--light);
  min-height: calc(100vh - 64px);
  padding: 56px 32px 96px;
}

.app-container {
  max-width: 960px;
  margin: 0 auto;
}

/* Header */
.app-header { margin-bottom: 40px; }

.app-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
  margin: 12px 0 16px;
}

.app-subtitle {
  font-size: 16px;
  color: var(--slate);
  line-height: 1.65;
  max-width: 580px;
}

/* Quote card (form wrapper) */
.quote-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group--full { grid-column: 1 / -1; }

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: 0.1px;
}

.form-group .optional {
  font-weight: 400;
  color: var(--slate);
}

.form-group input,
.form-group select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--navy);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-group input::placeholder { color: #CBD5E1; }

.form-group select { cursor: pointer; }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: var(--white);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}

.btn-primary:hover:not(:disabled) { background: #1D4ED8; }
.btn-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-secondary:hover { border-color: var(--blue); background: var(--blue-lt); color: var(--blue); }

.form-error {
  margin-top: 12px;
  font-size: 13px;
  color: #DC2626;
  min-height: 18px;
}

/* Loader */
.loader {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* Results */
.results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.results-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.results-meta {
  font-size: 14px;
  color: var(--slate);
}

/* Table */
.quotes-table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.quotes-table {
  width: 100%;
  border-collapse: collapse;
}

.quotes-table th {
  background: var(--light);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate);
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.quotes-table th.num { text-align: right; }

.quotes-table td {
  padding: 18px 20px;
  font-size: 14px;
  color: var(--navy);
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.quotes-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.quotes-table td.details-cell { color: var(--slate); font-size: 13px; line-height: 1.5; }

.quotes-table tr:last-child td { border-bottom: none; }

.quotes-table tr.row-current td {
  background: #EFF6FF;
}

.cost-highlight { color: var(--blue) !important; font-weight: 600; }

.carrier-cell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.carrier-name { font-weight: 500; }

.current-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--blue);
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* Note */
.results-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--blue-lt);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--slate);
  line-height: 1.55;
  margin-bottom: 28px;
}

.note-icon { font-size: 16px; flex-shrink: 0; }

/* Actions */
.results-actions { display: flex; gap: 12px; }

/* === ONBOARDING — Base (desktop) === */
.onboarding-main {
  background: var(--light);
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 32px 96px;
}

.onboarding-wrap {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Progress bar */
.onboarding-progress {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.progress-step span {
  font-size: 11px;
  color: var(--slate);
  font-weight: 500;
  white-space: nowrap;
}

.progress-step.active span,
.progress-step.done span { color: var(--navy); }

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  background: var(--white);
  transition: all 0.2s;
}

.step-circle.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.step-circle.done {
  border-color: #10B981;
  background: #10B981;
  color: white;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 18px;
}

.progress-line.done { background: #10B981; }

/* Card */
.onboarding-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 48px 44px;
}

.onboarding-card--complete { text-align: center; }

.ob-complete-check {
  width: 64px;
  height: 64px;
  background: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
}

.ob-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.ob-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.ob-sub {
  font-size: 15px;
  color: var(--slate);
  line-height: 1.65;
  margin-bottom: 32px;
  max-width: 480px;
}

.onboarding-card--complete .ob-sub {
  margin-left: auto;
  margin-right: auto;
}

/* Feature list */
.ob-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}

.ob-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ob-feature-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ob-feature-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}

.ob-feature-desc {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
}

/* CTA */
.ob-cta {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Actions row */
.ob-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.ob-actions--center { justify-content: center; }

.ob-actions .btn-secondary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 13px 20px;
}

/* Stats row */
.ob-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin: 40px 0 36px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ob-stat { text-align: center; }

.ob-stat-num {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.ob-stat-label {
  font-size: 12px;
  color: var(--slate);
  line-height: 1.4;
  max-width: 100px;
}

/* Footnote */
.ob-footnote {
  margin-top: 20px;
  font-size: 13px;
  color: var(--slate);
  text-align: center;
}

.ob-footnote a {
  color: var(--blue);
  text-decoration: none;
}

.ob-footnote a:hover { text-decoration: underline; }

/* Best Value badge */
.best-value-badge {
  font-size: 11px;
  font-weight: 600;
  background: #065F46;
  color: #D1FAE5;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.quotes-table tr.row-best td { background: #F0FDF4; }

/* Real-time estimate panel */
.estimate-panel {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 1.5px solid #BFDBFE;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.estimate-inner {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.estimate-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate);
}

.estimate-value {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
}

.estimate-sub {
  font-size: 12px;
  color: var(--slate);
  margin-left: auto;
}

@media (max-width: 480px) {
  .estimate-inner { flex-direction: column; gap: 4px; }
  .estimate-sub { margin-left: 0; }
}

/* Complete screen */
.ob-complete-icon {
  width: 64px;
  height: 64px;
  background: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
}

.ob-complete-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ob-complete-actions .ob-cta { width: auto; }

.ob-secondary-cta {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--navy);
}

/* Demo fill button */
/* Welcome page estimate teaser */
.ob-teaser {
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.teaser-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
  flex-shrink: 0;
  max-width: 180px;
  line-height: 1.4;
}

.teaser-estimate {
  flex: 1;
  text-align: right;
}

.teaser-value {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  display: block;
}

.teaser-sub {
  font-size: 12px;
  color: var(--slate);
}

@media (max-width: 520px) {
  .ob-teaser { flex-direction: column; align-items: flex-start; }
  .teaser-estimate { text-align: left; }
}

/* Demo fill button */
.demo-fill-row {
  text-align: center;
  margin-top: 14px;
}

.demo-fill-btn {
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.demo-fill-btn:hover { background: var(--blue-lt); }

/* License section */
.license-section {
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.license-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 16px;
  letter-spacing: 0.2px;
}

.license-icon {
  color: var(--blue);
  display: flex;
  align-items: center;
}

.optional-label {
  font-weight: 400;
  color: var(--slate);
  font-size: 12px;
}

/* Choose method grid */
.choose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.choose-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px 24px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
  font-family: inherit;
}

.choose-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.choose-card:active {
  transform: translateY(0);
}

.choose-icon {
  color: var(--blue);
  background: var(--blue-lt);
  border-radius: 10px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.choose-card-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.choose-card-desc {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.6;
  flex: 1;
}

.choose-card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.choose-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--slate);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 9px;
}

.choose-arrow {
  position: absolute;
  top: 24px;
  right: 20px;
  color: var(--slate);
  transition: color 0.15s, transform 0.15s;
}

.choose-card:hover .choose-arrow {
  color: var(--blue);
  transform: translateX(3px);
}

.ob-actions--col .demo-fill-row {
  margin-top: -8px;
  margin-bottom: 4px;
}

/* Mobile overrides for choose + license */
@media (max-width: 520px) {
  .choose-grid { grid-template-columns: 1fr; }
  .license-section { padding: 16px; }
  .license-section .form-grid { gap: 14px; }
}

@media (max-width: 640px) {
  .app-main { padding: 40px 20px 72px; }
  .quote-card { padding: 28px 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .app-title { font-size: 26px; }

  .quotes-table th, .quotes-table td { padding: 12px 14px; font-size: 13px; }
  .quotes-table td.details-cell { display: none; }
  .quotes-table th:last-child { display: none; }

  .results-header { flex-direction: column; }
  .results-actions { flex-direction: column; }
  .btn-secondary { text-align: center; }

  /* Onboarding mobile overrides */
  .onboarding-main { padding: 32px 16px 72px; }
  .onboarding-card { padding: 32px 24px; }
  .ob-title { font-size: 22px; }
  .progress-step span { font-size: 10px; }
  .ob-stats { gap: 24px; flex-wrap: wrap; }
  .ob-stat-num { font-size: 22px; }
  .ob-actions { flex-direction: column; }
  .ob-actions .btn-secondary { text-align: center; }
}