﻿/* ============================================
   1099Hubs — Component Library
   Button | Badge | Card | Form | Alert | Misc
   ============================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary CTA — Emerald */
.btn-primary {
  background: var(--emerald-500);
  color: #fff;
}

.btn-primary:hover {
  background: var(--emerald-600);
  color: #fff;
}

/* Secondary — Navy */
.btn-secondary {
  background: var(--navy-600);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--navy-700);
  color: #fff;
}

/* Outline */
.btn-outline {
  background: #fff;
  color: var(--slate-700);
  border-color: var(--slate-300);
}

.btn-outline:hover {
  background: var(--slate-50);
  color: var(--slate-900);
}

/* Ghost / text link */
.btn-ghost {
  background: transparent;
  color: var(--navy-600);
  padding: var(--space-2) var(--space-3);
}

.btn-ghost:hover {
  color: var(--navy-800);
}

/* Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info-text);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.badge-primary {
  background: var(--navy-50);
  color: var(--navy-600);
}

.badge-highlight {
  background: var(--amber-50);
  color: var(--amber-700);
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card-hover:hover {
  border-color: var(--slate-300);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Metric card — flat, no border */
.card-metric {
  background: var(--slate-50);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.card-metric .metric-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.card-metric .metric-value {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--slate-900);
  font-family: var(--font-mono);
}

/* Tool card — with icon */
.tool-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tool-card:hover {
  border-color: var(--navy-200);
  box-shadow: 0 4px 16px rgba(26, 50, 96, 0.08);
  transform: translateY(-2px);
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.tool-card-icon svg {
  width: 22px;
  height: 22px;
}

.tool-card-icon.navy {
  background: var(--navy-50);
  color: var(--navy-600);
}

.tool-card-icon.emerald {
  background: var(--emerald-50);
  color: var(--emerald-700);
}

.tool-card-icon.amber {
  background: var(--amber-50);
  color: var(--amber-700);
}

.tool-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--slate-900);
}

.tool-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  flex: 1;
}

.tool-card-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--navy-600);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.tool-card-link:hover {
  color: var(--navy-800);
  gap: var(--space-2);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: var(--space-2);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--slate-900);
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(74, 111, 192, 0.12);
}

.form-input::placeholder {
  color: var(--slate-400);
}

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

/* Input with prefix (e.g. $) */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: var(--space-4);
  font-size: var(--text-sm);
  color: var(--slate-400);
  font-weight: 500;
  pointer-events: none;
}

.input-group .form-input {
  padding-left: calc(var(--space-4) + 16px);
}

/* ---------- Mobile form controls: prevent iOS input zoom ---------- */
/* iOS Safari auto-zooms the whole viewport when a text/select/textarea control
   renders at a font-size below 16px. Use a hard-coded 16px (not a design token)
   so a future change to --text-sm cannot silently reintroduce the zoom. The
   selector list mirrors the base group at L254-256 (plus .input-prefix, which
   sets the inline "$" glyph) so the two never diverge. */
@media (max-width: 640px) {
  .form-input,
  .form-select,
  .form-textarea,
  .input-prefix {
    font-size: 16px;
  }
}

/* ---------- Alert ---------- */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  border: 1px solid;
}

.alert-info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: var(--info-border);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--color-border);
  border: none;
  margin: var(--space-8) 0;
}

/* ---------- Section Header ---------- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-3);
}

.section-header p {
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto;
}



/* ---------- Hero (split layout) ---------- */
.hero.hero-split {
  padding: var(--space-12) 0 var(--space-16);
  text-align: left;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 560px;
}

.hero-copy .hero-badge {
  margin-bottom: var(--space-6);
}

.hero-copy h1 {
  width: 100%;
  font-size: clamp(2.25rem, 3.4vw + 1rem, 3.25rem);
  margin-bottom: var(--space-5);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hero-copy .hero-sub {
  width: 100%;
  margin: 0 0 var(--space-8);
  max-width: 520px;
}

.hero-copy .hero-actions {
  justify-content: flex-start;
}

.hero-visual {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
}

.hero-visual img {
  width: 100%;
  height: auto;
  max-width: 640px;
  filter: drop-shadow(0 12px 40px rgba(15, 23, 42, 0.08));
}

@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .hero-copy {
    min-width: 0;
    max-width: 100%;
    text-align: center;
    align-items: center;
  }
  .hero-copy .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  .hero-visual {
    order: 2;
  }
}

@media (max-width: 640px) {
  .hero-copy h1 {
    font-size: clamp(2rem, 8vw, 2.25rem);
    line-height: 1.2;
  }
  .hero-copy .hero-actions .btn {
    width: 100%;
  }
}

/* ---------- Nav brand mark (now <img>) ---------- */
.nav-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-brand img.nav-brand-mark {
  display: block;
}

/* ---------- Misc ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ============================================
   Second-iteration polish (2026-08-05)
   ============================================ */

/* ---------- Section rhythm (replaces inline style) ---------- */
.section { padding: var(--space-16) 0; }
.section--tight { padding: var(--space-10) 0; }
.section--loose { padding: var(--space-20) 0; }
.section--alt { background: var(--color-bg-secondary); }
.section--primary { background: var(--navy-50); }

/* ---------- Section header (centered) ---------- */
.section-header h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.4vw, 2.25rem);
  margin-bottom: var(--space-3);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.section-header p {
  font-size: var(--text-lg);
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-text-secondary);
}
.section-header--left { text-align: left; }
.section-header--left p { margin: 0; }

/* ---------- Outline border bump for AA contrast ---------- */
.btn-outline { border-color: var(--slate-400); }

/* ---------- "Sign in" as plain text link in nav ---------- */
.nav-link--text {
  color: var(--slate-600);
  font-size: var(--text-sm);
  font-weight: 500;
}
.nav-link--text:hover { color: var(--navy-600); }

/* ---------- CTA band (dark) ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-600) 60%, var(--navy-500) 100%);
  color: #fff;
  border-radius: var(--radius-2xl);
  padding: var(--space-16) var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(800px circle at 0% 0%, rgba(13, 159, 110, 0.25), transparent 55%),
    radial-gradient(700px circle at 100% 100%, rgba(232, 160, 32, 0.18), transparent 55%);
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 {
  color: #fff;
  margin-bottom: var(--space-4);
  letter-spacing: var(--tracking-tight);
}
.cta-band p {
  color: var(--navy-100);
  font-size: var(--text-lg);
  max-width: 540px;
  margin: 0 auto var(--space-8);
}
.cta-band .btn-primary {
  background: var(--emerald-400);
  color: var(--navy-900);
  font-weight: 600;
}
.cta-band .btn-primary:hover {
  background: var(--emerald-300);
  color: var(--navy-900);
}

/* ---------- How it works (3 steps) ---------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  position: relative;
}
.how-step {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
}
.how-step__index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--navy-600); color: #fff;
  font-size: var(--text-sm); font-weight: 700;
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
}
.how-step__title {
  font-size: var(--text-lg); font-weight: 600;
  color: var(--slate-900); margin-bottom: var(--space-2);
}
.how-step__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}
@media (max-width: 968px) { .how-grid { grid-template-columns: 1fr; } }

/* ---------- FAQ (accordion) ---------- */
.faq {
  max-width: 760px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: var(--space-3);
}
.faq-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--transition-base);
}
.faq-item[open] {
  border-color: var(--navy-200);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-5) var(--space-6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  font-weight: 600; color: var(--slate-900);
  font-size: var(--text-base);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A3260' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item__body {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  font-size: var(--text-sm);
}
.faq-item__body p + p { margin-top: var(--space-3); }

/* ---------- Last reviewed stamp ---------- */
.last-reviewed {
  display: inline-flex; align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--space-4);
}
.last-reviewed::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--emerald-500);
  box-shadow: 0 0 0 4px var(--emerald-100);
}

.trust-strip {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg);
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}
.trust-strip span { font-weight: 600; color: var(--slate-500); }

/* ---------- Disclaimer ---------- */
.disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-align: center;
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

/* ---------- ad-slot (real placeholder, SVG noise) ---------- */
.ad-slot {
  position: relative;
  background: linear-gradient(135deg, var(--slate-50), var(--slate-100));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  min-height: 96px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ad-slot::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.58 0 0 0 0 0.63 0 0 0 0 0.72 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.45;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.ad-slot-label {
  position: relative;
  font-size: var(--text-xs);
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  font-weight: 600;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  background: var(--navy-600);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus { top: var(--space-3); color: #fff; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .tool-card:hover, .card-hover:hover { transform: none; }
}

/* ---------- Tool page footer (Last reviewed + Disclaimer) ---------- */
.tool-footer {
  text-align: center;
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-light);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb-wrap {
  padding: var(--space-5) 0 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.breadcrumb a {
  color: var(--slate-500);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--navy-600);
}

.breadcrumb-separator {
  color: var(--slate-400);
}

.breadcrumb-current {
  color: var(--slate-700);
  font-weight: 500;
}

/* ---------- Editorial / legal pages ---------- */
.page-hero {
  padding: var(--space-12) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border-light);
}

.page-kicker {
  display: inline-flex;
  margin-bottom: var(--space-3);
  color: var(--emerald-700);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.page-lead {
  color: var(--color-text-secondary);
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  max-width: 760px;
}

.prose {
  color: var(--slate-700);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.prose h2 {
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.prose h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: var(--space-4);
}

.prose li + li {
  margin-top: var(--space-2);
}

.resource-list {
  display: grid;
  gap: var(--space-4);
}

.resource-link {
  display: block;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: #fff;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.resource-link:hover {
  border-color: var(--navy-200);
  box-shadow: 0 4px 16px rgba(26, 50, 96, 0.08);
  transform: translateY(-1px);
}

.resource-link strong {
  display: block;
  color: var(--slate-900);
  margin-bottom: var(--space-1);
}

.resource-link span {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.legal-updated {
  margin-top: var(--space-4);
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
}
