/* ===========================
   Together Loans - Global CSS
   togetherloansapply.com
   =========================== */

/* font-display:swap loaded via <link> in HTML for LCP performance */

:root {
  --navy: #0a1628;
  --navy-mid: #132040;
  --gold: #c8973a;
  --gold-light: #e8b96a;
  --cream: #f8f4ee;
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-600: #6b7280;
  --gray-800: #1f2937;
  --green: #1a7a4a;
  --red: #c0392b;
  --shadow: 0 4px 24px rgba(10,22,40,0.12);
  --shadow-lg: 0 12px 48px rgba(10,22,40,0.18);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.6rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); font-weight: 600; }
h4 { font-size: 1.2rem; font-weight: 600; }

p { margin-bottom: 1rem; color: #444; }
a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--navy); }

img { max-width: 100%; height: auto; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== HEADER / NAV ===== */
header {
  background: var(--navy);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}

.logo span { color: var(--gold); }

nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav ul li a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--gold-light);
  border-color: var(--gold);
}

.nav-cta {
  background: var(--gold) !important;
  color: var(--navy) !important;
  padding: 0.55rem 1.4rem !important;
  border-radius: 50px !important;
  font-weight: 600 !important;
  border-bottom: none !important;
}
.nav-cta:hover { background: var(--gold-light) !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200,151,58,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border-color: var(--white);
}

.btn-dark {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-dark:hover {
  background: var(--navy-mid);
  transform: translateY(-2px);
}

.btn-lg { padding: 1.1rem 2.5rem; font-size: 1.05rem; }

/* ===== SECTIONS ===== */
section { padding: 5rem 0; }
.section-label {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.section-title { margin-bottom: 1rem; }
.section-subtitle { font-size: 1.1rem; color: var(--gray-600); max-width: 600px; }
.text-center { text-align: center; }
.text-center .section-subtitle { margin: 0 auto; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
  transition: var(--transition);
  border: 1px solid var(--gray-200);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-gold { background: rgba(200,151,58,0.15); color: var(--gold); }
.badge-green { background: rgba(26,122,74,0.12); color: var(--green); }
.badge-navy { background: rgba(10,22,40,0.1); color: var(--navy); }

/* ===== TRUST BAR ===== */
.trust-bar {
  background: var(--cream);
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.trust-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
}
.trust-item .icon { font-size: 1.1rem; }

/* ===== FOOTER ===== */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand .logo { font-size: 1.5rem; margin-bottom: 1rem; display: block; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; margin-bottom: 1.5rem; }
.footer-col h5 {
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.2rem;
}
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col ul li a {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
}
.footer-col ul li a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.8rem; margin: 0; }
.footer-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
  max-width: 700px;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== HERO ===== */
.hero {
  background:
    linear-gradient(135deg, rgba(10,22,40,0.88) 0%, rgba(26,48,96,0.82) 50%, rgba(13,32,80,0.90) 100%),
    url('../images/hero-family.jpg') center center / cover no-repeat;
  padding: 4rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(200,151,58,0.10) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.hero-content h1 { color: var(--white); margin-bottom: 1.25rem; }
.hero-content h1 span { color: var(--gold); }
.hero-content p {
  color: rgba(255,255,255,0.8);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.stat-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
}
.stat-card .number {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold);
  display: block;
  margin-bottom: 0.2rem;
}
.stat-card .label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
}

/* ===== LOAN CARD GRID ===== */
.loan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.loan-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.loan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.loan-card-header {
  background: var(--navy);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.loan-icon {
  width: 48px;
  height: 48px;
  background: rgba(200,151,58,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.loan-card-header h3 { color: var(--white); font-size: 1.1rem; }
.loan-card-body { padding: 1.5rem; }
.loan-card-body p { font-size: 0.9rem; color: #555; margin-bottom: 1rem; }
.loan-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.loan-meta-item { font-size: 0.8rem; color: var(--gray-600); }
.loan-meta-item strong { color: var(--navy); display: block; font-size: 0.9rem; }

/* ===== PROCESS STEPS ===== */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  counter-reset: step-counter;
}
.process-step {
  text-align: center;
  padding: 2rem 1.5rem;
  position: relative;
}
.step-num {
  width: 56px;
  height: 56px;
  background: var(--gold);
  color: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.3rem;
  margin: 0 auto 1.2rem;
}
.process-step h4 { margin-bottom: 0.5rem; }
.process-step p { font-size: 0.9rem; color: var(--gray-600); margin: 0; }

/* ===== FAQ ===== */
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-question {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--white);
  transition: var(--transition);
  font-weight: 500;
  color: var(--navy);
}
.faq-question:hover { background: var(--cream); }
.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  font-size: 0.95rem;
  color: #555;
}
.faq-answer.open { max-height: 300px; padding: 1.25rem 1.5rem; border-top: 1px solid var(--gray-200); }
.faq-toggle { font-size: 1.2rem; transition: var(--transition); color: var(--gold); }
.faq-item.open .faq-toggle { transform: rotate(45deg); }

/* ===== REVIEW STARS ===== */
.stars { color: #f5a623; letter-spacing: 2px; font-size: 1.1rem; }
.review-card { padding: 1.5rem; }
.reviewer-info { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.reviewer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.reviewer-name { font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.reviewer-date { font-size: 0.75rem; color: var(--gray-600); }

/* ===== TABLE ===== */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
th {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
}
td { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--gray-200); font-size: 0.9rem; }
tr:hover td { background: var(--cream); }
.table-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* ===== PAGE HERO (inner pages) ===== */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 4rem 0;
  text-align: center;
  position: relative;
}
.page-hero h1 { color: var(--white); margin-bottom: 0.75rem; }
.page-hero p { color: rgba(255,255,255,0.75); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.breadcrumb a { color: rgba(255,255,255,0.6); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: rgba(255,255,255,0.4); }
.breadcrumb .current { color: var(--gold); }

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, var(--navy), #1a3060);
  padding: 5rem 0;
  text-align: center;
}
.cta-section h2 { color: var(--white); margin-bottom: 1rem; }
.cta-section p { color: rgba(255,255,255,0.75); margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== EXPERT PROFILE ===== */
.expert-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--cream);
  border-radius: var(--radius);
  border-left: 4px solid var(--gold);
}
.expert-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.expert-info .name { font-weight: 700; color: var(--navy); margin-bottom: 0.1rem; }
.expert-info .title { font-size: 0.85rem; color: var(--gold); margin-bottom: 0.5rem; }
.expert-info p { font-size: 0.9rem; color: #555; margin: 0; }

/* ===== UTILS ===== */
.bg-cream { background: var(--cream); }
.bg-navy { background: var(--navy); }
.divider { height: 1px; background: var(--gray-200); margin: 2rem 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1.5rem; }
.check-list li {
  padding: 0.4rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
}
.check-list li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .loan-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  section { padding: 3.5rem 0; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-stats { display: none; }
  nav ul { display: none; }
  nav ul.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }
  .hamburger { display: flex; }
  .loan-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.7rem; }
  .hero-form-wrap { width: 100%; }
}

@media (max-width: 480px) {
  .process-grid { grid-template-columns: 1fr; }
  .trust-items { gap: 1rem; }
}

/* ===== PERFORMANCE OPTIMISATIONS ===== */
/* Reduce layout shift from web fonts */
html { font-display: swap; }

/* Lazy-render off-screen sections */
section { content-visibility: auto; contain-intrinsic-size: 0 500px; }

/* Prevent layout shift on images */
img { display: block; max-width: 100%; height: auto; }

/* Smooth scrolling only when user hasn't disabled motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Focus visible for accessibility / Core Web Vitals */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Skip to main content (accessibility + SEO) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--gold);
  color: var(--navy);
  padding: 0.5rem 1rem;
  font-weight: 700;
  z-index: 9999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }

/* Article content typography for readability score */
.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #2d2d2d;
}
.article-body p { max-width: 72ch; }

/* Last-updated date stamp */
.last-updated {
  font-size: 0.8rem;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--cream);
  border-radius: 6px;
  width: fit-content;
}

/* Print styles */
@media print {
  header, footer, .cta-section, .product-anchor-nav, .footer-sitelinks { display: none; }
  .hero { background: white !important; }
  .hero-content h1 { color: black !important; }
  body { font-size: 12pt; }
}
