/* components.css — Buttons, Cards, Forms, Badges */

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg3);
  color: var(--text);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.0625rem;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-xs);
}

.btn-full {
  width: 100%;
}

/* Vertical-colored buttons */
.btn-finance { background: var(--finance); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,0.3); }
.btn-finance:hover { background: #4338ca; }
.btn-auto    { background: var(--auto);    color: #fff; box-shadow: 0 4px 14px rgba(14,165,233,0.3); }
.btn-auto:hover { background: #0284c7; }
.btn-health  { background: var(--health);  color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,0.3); }
.btn-health:hover { background: #059669; }
.btn-credit  { background: var(--credit);  color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,0.3); }
.btn-credit:hover { background: #d97706; }
.btn-home    { background: var(--home);    color: #fff; box-shadow: 0 4px 14px rgba(236,72,153,0.3); }
.btn-home:hover { background: #db2777; }
.btn-legal   { background: var(--legal);   color: #fff; box-shadow: 0 4px 14px rgba(139,92,246,0.3); }
.btn-legal:hover { background: #7c3aed; }

/* Spinner inside button */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.loading .btn-text { display: none; }
.btn.loading .btn-spinner { display: block; }

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

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--clay-shadow);
  padding: var(--space-6);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.13), var(--clay-inner-lt), var(--clay-inner-dk);
}

.card-sm {
  border-radius: var(--radius-sm);
  padding: var(--space-5);
}

.card-flat {
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-flat:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Vertical accent card */
.card-vertical {
  border-top: 4px solid var(--vc, var(--accent));
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78125rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-accent   { background: var(--accent-light);  color: var(--accent); }
.badge-success  { background: var(--success-light); color: var(--success); }
.badge-warning  { background: var(--warning-light); color: #92400e; }
.badge-error    { background: var(--error-light);   color: #b91c1c; }
.badge-neutral  { background: var(--bg3);           color: var(--text-muted); }
.badge-finance  { background: var(--finance-light); color: var(--finance); }
.badge-auto     { background: var(--auto-light);    color: #0369a1; }
.badge-health   { background: var(--health-light);  color: #065f46; }
.badge-credit   { background: var(--credit-light);  color: #92400e; }
.badge-home     { background: var(--home-light);    color: #9d174d; }
.badge-legal    { background: var(--legal-light);   color: #5b21b6; }

/* ─── Forms ───────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg2);
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-textarea {
  resize: vertical;
  min-height: 96px;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--error);
  display: none;
}

.form-error.visible {
  display: block;
}

/* Checkbox / TCPA */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-check-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-check-label a {
  color: var(--accent);
  text-decoration: underline;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-grid .form-group-full {
  grid-column: 1 / -1;
}

/* Form alert */
.form-alert {
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}

.form-alert.visible {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-alert.success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-alert.error {
  background: var(--error-light);
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ─── Trust bar items ─────────────────────────────────────── */
.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}

.trust-item svg {
  color: var(--success);
  flex-shrink: 0;
}

/* ─── Offer card ──────────────────────────────────────────── */
.offer-card {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--clay-shadow);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.offer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.offer-logo {
  height: 36px;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.offer-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--warning);
}

.offer-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.offer-highlight {
  text-align: center;
}

.offer-highlight-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.offer-highlight-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Section titles ──────────────────────────────────────── */
.section-eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.section-sub {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-top: var(--space-3);
  max-width: 560px;
}

/* ─── How it works steps ──────────────────────────────────── */
.step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
}

.step-number {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--vc, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ─── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
}
