/* ============================================================
   CreditKeys — Design Tokens
   Deliberately distinct from PetBuddy's warm cream/pine palette.
   Cooler, more precise: slate navy + brass, built around the
   "keys" motif established in the hero video.
   ============================================================ */

:root {
  --paper: #F6F5F2;
  --paper-alt: #EFEDE7;
  --ink: #14213D;
  --ink-soft: #3C4A66;
  --brass: #B8863E;
  --brass-light: #D4A85E;
  --slate: #4A5D7C;
  --slate-light: #E8ECF2;
  --success: #3D7A5C;
  --white: #FFFFFF;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(20, 33, 61, 0.08);
  --shadow-lg: 0 16px 48px rgba(20, 33, 61, 0.14);
  --max-width: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { color: var(--ink-soft); }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; }

@media (max-width: 640px) {
  section { padding: 56px 0; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--brass);
  color: var(--white);
  box-shadow: 0 6px 20px rgba(184, 134, 62, 0.35);
}

.btn-primary:hover { box-shadow: 0 8px 26px rgba(184, 134, 62, 0.45); }

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

.btn-outline:hover { background: var(--ink); color: var(--white); }

.btn-light {
  background: var(--white);
  color: var(--ink);
}

/* ---------- Keyhole signature element ---------- */

.keyhole-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 20px 0;
}

.keyhole-divider::before,
.keyhole-divider::after {
  content: '';
  height: 1px;
  width: 40px;
  background: var(--brass-light);
}

.keyhole-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.keyhole-icon svg { width: 100%; height: 100%; }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  text-align: center;
  display: block;
  margin-bottom: 10px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 245, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
}

.logo .keyhole-icon { width: 26px; height: 26px; }

.nav-links {
  display: flex;
  gap: 32px;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover { color: var(--brass); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--white);
}

.hero video,
.hero .poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,33,61,0.15) 0%, rgba(20,33,61,0.75) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: 72px;
  max-width: 640px;
}

.hero-content h1 { color: var(--white); margin-bottom: 18px; }

.hero-content p {
  color: rgba(255,255,255,0.88);
  font-size: 1.15rem;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-badges {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-badge {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 56px;
}

@media (max-width: 780px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
}

.step { text-align: center; }

.step-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  background: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.step-icon img { width: 100%; height: 100%; object-fit: contain; }

.step h3 { margin-bottom: 8px; }
.step p { font-size: 0.95rem; }

/* ---------- Compare cards ---------- */

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

@media (max-width: 900px) {
  .compare-grid { grid-template-columns: 1fr; }
}

.compare-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(20,33,61,0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.compare-card .brand-logo {
  height: 34px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
}

.compare-card .brand-logo img { height: 100%; width: auto; object-fit: contain; }

.compare-card .brand-logo.text-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
}

.compare-card .fit-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brass);
  background: rgba(184, 134, 62, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
  width: fit-content;
}

.compare-card .card-top { flex: 1; }

.compare-card ul {
  list-style: none;
  margin: 18px 0 0;
}

.compare-card li {
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 7px 0;
  padding-left: 22px;
  position: relative;
}

.compare-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brass);
  font-weight: 700;
}

.compare-card .card-bottom {
  margin-top: auto;
  padding-top: 22px;
}

.compare-card .cta-btn {
  width: 100%;
}

.compare-card .disclaimer {
  font-size: 0.7rem;
  color: #8590A3;
  margin-bottom: 14px;
  line-height: 1.5;
  /* Never truncate this — required disclosure text must always display in full. */
}

/* ---------- Trust / mid-page ---------- */

.trust-section {
  background: var(--ink);
  color: var(--white);
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 860px) {
  .trust-grid { grid-template-columns: 1fr; gap: 32px; }
}

.trust-grid img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.trust-section h2 { color: var(--white); margin-bottom: 18px; }
.trust-section p { color: rgba(255,255,255,0.78); }

.faq-item {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0;
}

.faq-item h4 { color: var(--white); margin-bottom: 8px; font-size: 1.02rem; }
.faq-item p { font-size: 0.92rem; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--paper-alt);
  padding: 56px 0 32px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  gap: 24px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.footer-disclosure {
  border-top: 1px solid rgba(20,33,61,0.08);
  padding-top: 24px;
  margin-top: 24px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #8590A3;
}

/* ---------- Quiz page ---------- */

.quiz-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 64px 24px 100px;
  min-height: 70vh;
}

.quiz-progress {
  height: 6px;
  background: var(--slate-light);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 40px;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--brass);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0%;
}

.quiz-step { display: none; }
.quiz-step.active { display: block; animation: fadeIn 0.35s ease; }

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

.quiz-step h2 { margin-bottom: 12px; }
.quiz-step .quiz-sub { margin-bottom: 28px; }

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  background: var(--white);
  border: 1.5px solid rgba(20,33,61,0.1);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-option:hover { border-color: var(--brass); background: rgba(184,134,62,0.04); }

.quiz-option .arrow { color: var(--brass); font-size: 1.1rem; }

.quiz-result-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid rgba(20,33,61,0.06);
}

.quiz-result-card .badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--brass);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.email-capture {
  background: var(--slate-light);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 32px;
}

.email-capture h3 { margin-bottom: 8px; }
.email-capture p { font-size: 0.9rem; margin-bottom: 18px; }

.email-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.email-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(20,33,61,0.15);
  font-size: 1rem;
  font-family: inherit;
}

.email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--brass);
}

.consent-text {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 12px;
  line-height: 1.5;
}

.consent-text a { color: var(--slate); text-decoration: underline; }

.quiz-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 24px;
  background: none;
  border: none;
  padding: 0;
}

.form-success {
  display: none;
  background: rgba(61, 122, 92, 0.1);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 0.9rem;
  color: var(--success);
  margin-top: 16px;
}

.form-success.show { display: block; }
