/* =====================================================
   AvantPersonalLoans.com — Design System v2.4
   Theme 4: Ice Blue
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:wght@700;900&display=swap');

/* ---- Tokens ---- */
:root {
  --navy:       #1B3A6B;
  --navy-dark:  #0D2558;
  --navy-light: #2A5FBB;
  --amber:      #1B6FE8;
  --amber-dark: #1558CC;
  --amber-light:#DCE9FF;
  --green:      #2D8B55;
  --red:        #C44B2A;
  --bg:         #F0F6FF;
  --bg-white:   #FFFFFF;
  --text:       #1B3A6B;
  --text-muted: #5A7299;
  --border:     #C8DEFF;
  --shadow-sm:  0 2px 8px rgba(27,111,232,0.08);
  --shadow-md:  0 6px 24px rgba(27,111,232,0.12);
  --shadow-lg:  0 16px 48px rgba(27,111,232,0.16);
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --font-display: 'Merriweather', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --max-w:      1160px;
  --transition: 0.22s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--amber-dark); }
ul { list-style: none; }

/* ---- Global responsive safety ---- */
html, body { overflow-x: hidden; max-width: 100vw; }
img, picture, video, iframe { max-width: 100%; height: auto; }
table { max-width: 100%; }
pre, code { overflow-x: auto; word-wrap: break-word; }
* { min-width: 0; } /* Prevent flex/grid children overflow */


/* ---- Utility ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section--sm { padding: 48px 0; }
.section--dark { background: var(--navy); color: #fff; }
.section--amber { background: #EEF5FF; }
.section--white { background: var(--bg-white); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 700; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 1.125rem; color: var(--text-muted); line-height: 1.75; }
.eyebrow { font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); display: block; margin-bottom: 12px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); text-decoration: none; }
.btn--primary { background: var(--amber); color: #fff; }
.btn--primary:hover { background: var(--amber-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(27,111,232,0.35); }
.btn--secondary { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn--secondary:hover { background: var(--navy); color: #fff; }
.btn--white { background: #fff; color: var(--navy); }
.btn--white:hover { background: var(--amber); color: #fff; }
.btn--lg { padding: 18px 36px; font-size: 1.05rem; }
.btn--full { width: 100%; justify-content: center; }

/* ---- HEADER / NAV ---- */
.site-header {
  position: static;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

/* ---- Logo ---- */
.logo { display: flex; align-items: center; font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.02em; text-decoration: none; }
.logo-mark { display: none; }
.logo span  { display: none; }
.site-header .logo {
  background: linear-gradient(135deg, var(--navy) 0%, var(--amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-footer .logo { font-size: 1.5rem; font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; color: #fff; -webkit-text-fill-color: #fff; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; color: var(--text); }
.nav-links a:hover, .nav-links a.active { color: var(--navy); background: var(--bg); }
.nav-cta { margin-left: 12px; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: all var(--transition); }
.mobile-menu { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg-white); border-bottom: 1px solid var(--border); padding: 16px 24px 24px; flex-direction: column; gap: 4px; z-index: 99; }
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; color: var(--text); display: block; }
.mobile-menu a:hover { background: var(--bg); }

/* ---- HERO ---- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 80px 0 100px;
  background-color: #0D2558;
  background-image:
    linear-gradient(135deg, rgba(9,30,78,0.85) 0%, rgba(13,37,88,0.78) 50%, rgba(10,45,100,0.80) 100%),
    image-set(url('../images/hero-bg.webp') type('image/webp'), url('../images/hero-bg.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero::before { display: none; }
.hero::after  { display: none; }
.hero-grid { display: grid; grid-template-columns: 1fr 420px; gap: 64px; align-items: center; position: relative; z-index: 1; }
.hero-eyebrow { color: #7EB8FF; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px; display: block; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.hero h1 { color: #fff; margin-bottom: 20px; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.hero h1 em { color: rgba(255,255,255,0.6); font-style: italic; font-size: 0.72em; }
.hero .lead { color: rgba(255,255,255,0.88); margin-bottom: 32px; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.15); }
.hero-stat-value { font-size: 1.6rem; font-weight: 800; color: #A3BBFF; display: block; }
.hero-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.65); }

/* ---- Score Card ---- */
.score-card { background: var(--bg-white); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); color: var(--text); }
.score-card-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 20px; }
.score-dial { position: relative; margin: 0 auto 20px; width: 180px; height: 90px; }
.score-zone { display: flex; gap: 8px; margin-bottom: 16px; }
.score-zone-item { flex: 1; padding: 8px 10px; border-radius: var(--radius-sm); text-align: center; }
.score-zone-item.red { background: #FEF2F0; }
.score-zone-item.yellow { background: var(--amber-light); }
.score-zone-item.green { background: #EDF7F2; }
.zone-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 2px; }
.zone-range { font-size: 0.8rem; font-weight: 700; }
.zone-label.red { color: var(--red); }
.zone-label.yellow { color: var(--amber-dark); }
.zone-label.green { color: var(--green); }
.approval-badge { background: linear-gradient(135deg, #EDF7F2, #D0EDDE); border: 1px solid #A8D8BE; border-radius: var(--radius-sm); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.badge-icon { color: var(--green); font-size: 1.4rem; }
.badge-text strong { display: block; font-size: 0.875rem; color: var(--green); }
.badge-text span { font-size: 0.75rem; color: var(--text-muted); }

/* ---- Rating Box ---- */
.rating-summary { background: var(--bg-white); border-radius: var(--radius-md); padding: 28px; box-shadow: var(--shadow-md); border: 2px solid var(--amber); }
.rating-big { font-size: 3.5rem; font-weight: 800; color: var(--navy); line-height: 1; }
.rating-stars { color: #5EA0FF; font-size: 1.4rem; margin: 8px 0; }
.rating-breakdown { margin-top: 20px; }
.rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rating-row-label { font-size: 0.8rem; font-weight: 500; width: 120px; flex-shrink: 0; }
.rating-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.rating-bar-fill { height: 100%; background: var(--amber); border-radius: 3px; }
.rating-row-score { font-size: 0.8rem; font-weight: 700; width: 28px; text-align: right; }

/* ---- Cards / Grid ---- */
.card-grid { display: grid; gap: 24px; }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--bg-white); border-radius: var(--radius-md); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: box-shadow var(--transition), transform var(--transition); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: 14px; }
.card h3 { margin-bottom: 10px; }

/* ---- Pros/Cons ---- */
.pros-cons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pros-box { background: #EDF7F2; border: 1px solid #A8D8BE; border-radius: var(--radius-md); padding: 28px; }
.cons-box { background: #FEF2F0; border: 1px solid #F0B8AE; border-radius: var(--radius-md); padding: 28px; }
.pros-box h3 { color: var(--green); margin-bottom: 16px; }
.cons-box h3 { color: var(--red); margin-bottom: 16px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 0.9rem; line-height: 1.5; }
.check-list li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.cross-list li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 0.9rem; line-height: 1.5; }
.cross-list li::before { content: '✗'; color: var(--red); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ---- Data Table ---- */
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th { background: var(--navy); color: #fff; padding: 14px 20px; text-align: left; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.data-table td { padding: 14px 20px; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--bg); }
.data-table td strong { color: var(--navy); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

/* ---- Alert / Notice ---- */
.alert { border-radius: var(--radius-sm); padding: 16px 20px; display: flex; gap: 14px; margin-bottom: 24px; }
.alert--info { background: #EEF4FF; border-left: 4px solid var(--navy-light); }
.alert--warn { background: var(--amber-light); border-left: 4px solid var(--amber); }
.alert--success { background: #EDF7F2; border-left: 4px solid var(--green); }
.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.alert-body { font-size: 0.875rem; }
.alert-body strong { display: block; margin-bottom: 2px; }

/* ---- Steps ---- */
.steps { counter-reset: step; }
.step-item { display: flex; gap: 24px; margin-bottom: 36px; position: relative; }
.step-item:not(:last-child)::after { content: ''; position: absolute; left: 21px; top: 50px; width: 2px; height: calc(100% - 8px); background: linear-gradient(var(--amber), var(--border)); }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; flex-shrink: 0; position: relative; z-index: 1; }
.step-body h4 { margin-bottom: 6px; font-size: 1rem; }
.step-body p { font-size: 0.875rem; color: var(--text-muted); }

/* ---- FAQ ---- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question { width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 20px 0; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--text); gap: 16px; }
.faq-question:hover { color: var(--navy); }
.faq-icon { color: var(--amber); font-size: 1.2rem; flex-shrink: 0; transition: transform var(--transition); }
.faq-question.open .faq-icon { transform: rotate(45deg); }
.faq-answer { padding: 0 0 20px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; display: none; }
.faq-answer.open { display: block; }

/* ---- CTA Banner ---- */
.cta-banner {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); padding: 56px 48px; text-align: center; color: #fff;
  background-color: #0D2558;
  background-image:
    linear-gradient(135deg, rgba(9,30,78,0.82) 0%, rgba(13,37,88,0.74) 100%),
    image-set(url('../images/cta-bg.webp') type('image/webp'), url('../images/cta-bg.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.cta-banner h2 { color: #fff; margin-bottom: 12px; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.cta-banner p  { color: rgba(255,255,255,0.88); margin-bottom: 28px; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.cta-banner-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---- Comparison Table ---- */
.vs-table { width: 100%; border-collapse: collapse; background: var(--bg-white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); }
.vs-table th { padding: 18px 20px; font-size: 0.9rem; font-weight: 700; }
.vs-table th:first-child { background: var(--bg); color: var(--text-muted); font-weight: 600; text-align: left; }
.vs-table th.highlight { background: var(--navy); color: #fff; }
.vs-table th.alt { background: #445; color: #fff; }
.vs-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.875rem; text-align: center; }
.vs-table td:first-child { text-align: left; font-weight: 500; color: var(--text); }
.vs-table td.highlight { background: #F0F4FF; font-weight: 600; color: var(--navy); }
.vs-table tr:last-child td { border-bottom: none; }
.check { color: var(--green); font-size: 1.1rem; }
.cross { color: var(--red); font-size: 1.1rem; }
.winner-badge { display: inline-block; background: var(--amber); color: #fff; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 20px; margin-top: 4px; }

/* ---- Calculator ---- */
.calc-wrap { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.calc-inputs { padding: 40px; }
.calc-outputs { background: linear-gradient(160deg, var(--navy-dark), var(--navy)); padding: 40px; color: #fff; }
.form-group { margin-bottom: 24px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.form-input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 1rem; color: var(--text); transition: border-color var(--transition); appearance: none; background: var(--bg); }
.form-input:focus { outline: none; border-color: var(--navy); background: #fff; }
input[type=range] { -webkit-appearance: none; width: 100%; height: 6px; background: var(--border); border-radius: 3px; border: none; padding: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--amber); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
input[type=range]:focus { outline: none; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.calc-result-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.calc-result-value { font-size: 2.2rem; font-weight: 800; color: #A3BBFF; line-height: 1.1; margin-bottom: 24px; }
.calc-breakdown { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 24px; margin-top: 8px; }
.calc-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.875rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.calc-row:last-child { border-bottom: none; }
.calc-row-label { color: rgba(255,255,255,0.65); }
.calc-row-value { font-weight: 600; }

/* ---- Breadcrumb ---- */
.breadcrumb { padding: 16px 0; font-size: 0.8rem; }
.breadcrumb ol { display: flex; gap: 8px; align-items: center; }
.breadcrumb li { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.breadcrumb li:not(:last-child)::after { content: '/'; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb li:last-child { color: var(--text); font-weight: 500; }

/* ---- Page Header ---- */
.page-header { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); color: #fff; padding: 56px 0 48px; }
.page-header h1 { color: #fff; margin-bottom: 12px; }
.page-header .lead { color: rgba(255,255,255,0.75); max-width: 680px; }
.page-header .breadcrumb { padding: 0 0 20px; }
.page-header .breadcrumb a { color: rgba(255,255,255,0.6); }
.page-header .breadcrumb li { color: rgba(255,255,255,0.6); }
.page-header .breadcrumb li:last-child { color: rgba(255,255,255,0.9); }

/* ---- Sidebar Layout ---- */
.content-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.sidebar-card { background: var(--bg-white); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-md); border: 1px solid var(--border); margin-bottom: 24px; }
.sidebar-card h4 { margin-bottom: 16px; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.quick-facts li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.quick-facts li:last-child { border-bottom: none; }
.quick-facts li span:first-child { color: var(--text-muted); }
.quick-facts li span:last-child { font-weight: 600; color: var(--navy); }
.apply-sidebar-card { background: var(--amber); border-radius: var(--radius-md); padding: 24px; text-align: center; }
.apply-sidebar-card h4 { color: #fff; margin-bottom: 8px; font-size: 1rem; }
.apply-sidebar-card p { color: rgba(255,255,255,0.85); font-size: 0.8rem; margin-bottom: 16px; }

/* ---- TOC ---- */
.toc { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px 24px; margin-bottom: 32px; }
.toc h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.toc ol { counter-reset: toc; padding-left: 0; }
.toc li { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; font-size: 0.875rem; }
.toc li::before { counter-increment: toc; content: counter(toc); font-size: 0.7rem; font-weight: 700; color: var(--amber); background: var(--amber-light); width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; }
.toc a { color: var(--navy); font-weight: 500; }
.toc a:hover { color: var(--amber-dark); }

/* ---- Trust Badges ---- */
.trust-bar { background: var(--bg-white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 20px 0; }
.trust-bar-inner { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.trust-item span { font-size: 1.2rem; }

/* ---- Section Header ---- */
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { margin-bottom: 14px; }
.section-header p { font-size: 1rem; color: var(--text-muted); max-width: 560px; margin: 0 auto; }

/* ---- Footer ---- */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.7); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .logo { margin-bottom: 16px; }
.footer-desc { font-size: 0.85rem; line-height: 1.7; }
.footer-col h5 { color: #fff; font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 0.85rem; color: rgba(255,255,255,0.65); }
.footer-col ul li a:hover { color: var(--amber); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-bottom p { font-size: 0.75rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.footer-links a:hover { color: var(--amber); }
.disclaimer { background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 32px; font-size: 0.75rem; line-height: 1.6; }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(27,111,232,0.3);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--amber-dark); color: #fff; transform: translateY(-3px); }

/* ---- Service sections ---- */
#personal-loans-service .container > div,
#avantcard-service .container > div,
#pfm-service .container > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

/* ---- Editorial team ---- */
#editorial-team .container > div:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
#editorial-team .container > div:last-child  { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--border); }

/* ==========================================================
   RESPONSIVE — Desktop / Laptop / Tablet / Mobile
   ========================================================== */

/* ---- Large desktop (>1440px) ---- */
@media (min-width: 1441px) {
  :root { --max-w: 1240px; }
  body { font-size: 17px; }
}

/* ---- Laptop (1200–1440px) ---- */
@media (max-width: 1200px) {
  .container { padding: 0 32px; }
  .footer-grid { gap: 32px; }
}

/* ---- Tablet Landscape / Small Laptop (1024px) ---- */
@media (max-width: 1024px) {
  .hero { padding: 64px 0 80px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .score-card { max-width: 480px; margin: 0 auto; }
  .content-sidebar { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .calc-wrap { grid-template-columns: 1fr; }
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }

  /* Service section & Editorial team */
  #personal-loans-service .container > div,
  #editorial-team .container > div:first-child { grid-template-columns: 1fr !important; gap: 40px !important; }

  /* Other products grid */
  #other-products .container > div:last-child { grid-template-columns: 1fr !important; }

  /* Borrower sentiment score cards: 4 → 2 */
  #borrower-sentiment .container > div:nth-child(2) { grid-template-columns: repeat(2, 1fr) !important; }
  /* Borrower sentiment 2-col becomes 1 */
  #borrower-sentiment .container > div:nth-child(3) { grid-template-columns: 1fr !important; }

  /* Related content: 4 → 2 */
  #related-content .container > div:nth-child(2),
  #related-content .container > div:nth-child(3) { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ---- Tablet Portrait (900px) ---- */
@media (max-width: 900px) {
  h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
  h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
  .lead { font-size: 1rem; }
  .section-header { margin-bottom: 40px; }
}

/* ---- Mobile Landscape / Small Tablet (768px) ---- */
@media (max-width: 768px) {
  html { font-size: 15px; }
  .container { padding: 0 20px; }
  .section { padding: 48px 0; }
  .section--sm { padding: 36px 0; }

  /* Navigation */
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }

  /* Hero */
  .hero { padding: 48px 0 64px; }
  .hero-stats { flex-wrap: wrap; gap: 20px; padding-top: 24px; }
  .hero-stat-value { font-size: 1.3rem; }
  .hero-actions .btn { flex: 1; justify-content: center; text-align: center; min-height: 48px; }

  /* Score card */
  .score-card { padding: 20px; }
  .score-zone { flex-direction: column; gap: 8px; }
  .score-zone-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }

  /* Grids */
  .card-grid--2, .card-grid--3, .card-grid--4 { grid-template-columns: 1fr; gap: 16px; }
  .pros-cons-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }

  /* Cards / boxes */
  .card { padding: 20px; }
  .pros-box, .cons-box { padding: 20px; }

  /* CTA */
  .cta-banner { padding: 36px 24px; }
  .cta-banner h2 { font-size: 1.4rem; }
  .cta-banner-actions { flex-direction: column; align-items: stretch; }
  .cta-banner-actions .btn { justify-content: center; min-height: 48px; }

  /* Table — enable horizontal scroll */
  .vs-table, .data-table { font-size: 0.78rem; min-width: 480px; }
  .vs-table th, .vs-table td, .data-table th, .data-table td { padding: 10px 12px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Buttons touch-friendly */
  .btn { min-height: 44px; padding: 12px 20px; }
  .btn--lg { min-height: 52px; padding: 14px 24px; font-size: 1rem; }

  /* Footer */
  .footer-bottom { flex-direction: column; text-align: center; }
  .back-to-top { bottom: 20px; right: 20px; width: 44px; height: 44px; font-size: 1.1rem; }

  /* Trust bar */
  .trust-bar-inner { gap: 16px 24px; }
  .trust-item { font-size: 0.75rem; }

  /* TL;DR — target section by unique CSS */
  section[style*="border:2px solid var(--amber)"] > div > div:last-child { padding: 20px !important; }
  section[style*="border:2px solid var(--amber)"] ul li { font-size: 0.85rem !important; }

  /* Table of Contents — 2col to 1col */
  section[style*="Table of Contents"] + * div[style*="grid-template-columns:1fr 1fr"],
  #eligibility-checker ~ * div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* Byline in hero — smaller */
  .hero div[style*="border-top:1px solid rgba(255,255,255,0.15)"] { flex-direction: column; align-items: flex-start !important; gap: 8px !important; padding: 12px 0 !important; }
  .hero div[style*="border-top:1px solid rgba(255,255,255,0.15)"] span { font-size: 0.72rem !important; }

  /* Editorial team — team members */
  #editorial-team .container > div:last-child > div[style*="border-left:4px solid"] { padding: 12px !important; }

  /* Eligibility checker — grid to stack */
  #eligibility-checker div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; gap: 10px !important; }
  #eligibility-checker button.eq-opt { min-height: 56px; }

  /* Borrower sentiment scoring cards → single column */
  #borrower-sentiment .container > div:nth-child(2) { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Related content → single */
  #related-content .container > div:nth-child(2),
  #related-content .container > div:nth-child(3) { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Disclosure bar single */
  section[style*="EEF5FF"] .container > div { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* Service section stack */
  #personal-loans-service .container > div { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* Other products stack */
  #other-products .container > div:last-child { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* Editorial team photo + text stack */
  #editorial-team .container > div:first-child { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* FAQ item padding */
  .faq-question { padding: 16px 0; font-size: 0.9rem; }
  .faq-answer { font-size: 0.85rem; }

  /* Page header */
  .page-header { padding: 40px 0 32px; }
  .page-header h1 { font-size: 1.6rem; }

  /* Loan form section */
  section[id="loan-form"] { padding: 32px 0 40px !important; }

  /* Logo smaller on mobile */
  .site-header .logo { font-size: 1.25rem; }
}

/* ---- Small Mobile (480px) ---- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }

  h1 { font-size: 1.6rem; line-height: 1.15; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.05rem; }
  .lead { font-size: 0.95rem; }

  /* Hero */
  .hero h1 em { font-size: 1rem !important; display: block; margin-top: 8px; }
  .hero-eyebrow { font-size: 0.68rem; }
  .hero-stats { gap: 12px 20px; padding-top: 20px; margin-top: 28px; }
  .hero-stat-value { font-size: 1.1rem; }
  .hero-stat-label { font-size: 0.7rem; }

  /* CTA buttons */
  .btn { font-size: 0.9rem; padding: 12px 18px; }
  .btn--lg { font-size: 0.95rem; padding: 14px 20px; }

  /* Score card */
  .score-card { padding: 18px; }
  .score-card-title { font-size: 0.72rem; }

  /* Rating */
  .rating-big { font-size: 2.6rem; }
  .rating-summary { padding: 20px; }

  /* Sidebar cards */
  .sidebar-card { padding: 18px; }

  /* Editorial team badges circles */
  #editorial-team div[style*="border-radius:50%"] { width: 36px !important; height: 36px !important; }

  /* Steps */
  .step-num { width: 36px; height: 36px; font-size: 0.8rem; }
  .step-item { gap: 16px; margin-bottom: 24px; }
  .step-item:not(:last-child)::after { left: 17px; }
  .step-body h4 { font-size: 0.95rem; }
  .step-body p { font-size: 0.82rem; }

  /* Section header */
  .section-header { margin-bottom: 32px; }
  .section-header p { font-size: 0.9rem; }

  /* TL;DR box */
  section[style*="border:2px solid var(--amber)"] > div > div:first-child h2 { font-size: 1rem !important; }
  section[style*="border:2px solid var(--amber)"] ul li p { font-size: 0.85rem !important; }
  section[style*="border:2px solid var(--amber)"] ul li > span { width: 22px !important; height: 22px !important; font-size: 0.7rem !important; }

  /* Loan form padding */
  section[id="loan-form"] > .container { padding: 0 12px !important; }
  section[id="loan-form"] h2 { font-size: 1.25rem !important; }

  /* Trust bar tighter */
  .trust-bar { padding: 14px 0; }
  .trust-bar-inner { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Footer */
  .site-footer { padding: 48px 0 24px; }

  /* Related content cards */
  #related-content a[style*="border-radius:var(--radius-md)"] { padding: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Accessibility & Focus states ---- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible, a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

/* Print styles */
@media print {
  .site-header, .site-footer, .back-to-top, .cta-banner, #loan-form { display: none; }
  body { background: #fff; color: #000; }
  .container { max-width: 100%; }
  a { color: #000; text-decoration: underline; }
  h1, h2, h3 { page-break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
}

/* ==========================================================
   LEVEL 1 #3 — TYPOGRAPHY REFINEMENT
   ========================================================== */

body {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

/* Tabular figures for numbers in tables, prices, stats */
.data-table td,
.vs-table td,
.quick-facts,
.rating-big,
.hero-stat-value,
.calc-result-value,
.calc-row-value,
.rating-row-score,
.sitemap-priority,
[class*="stat-value"] {
  font-feature-settings: "kern" 1, "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Display font — optical adjustments */
h1, h2, h3 {
  font-feature-settings: "kern" 1, "liga" 1, "dlig" 1, "onum" 1;
  letter-spacing: -0.015em;
}

h1 {
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

h2 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3, h4 {
  text-wrap: balance;
}

/* Better paragraph rendering */
p, li {
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
  hanging-punctuation: first last;
}

/* Numbers in stats — emphasize */
.rating-big,
.hero-stat-value,
.calc-result-value {
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.03em;
}

/* Small caps for eyebrow labels */
.eyebrow,
.hero-eyebrow {
  font-feature-settings: "kern" 1, "smcp" 1, "c2sc" 1;
  letter-spacing: 0.15em;
}

/* Better selection styling */
::selection {
  background: var(--amber);
  color: #fff;
}

/* ==========================================================
   LEVEL 1 #1 — MICRO-INTERACTIONS
   ========================================================== */

/* Enhanced card hover — subtle elevation */
.card {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(27,111,232,0.14), 0 2px 6px rgba(27,111,232,0.06);
  border-color: var(--amber-light);
}

/* Button — refined hover with subtle shadow bloom */
.btn {
  position: relative;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s ease,
              color 0.2s ease;
  transform-origin: center;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  transition-duration: 0.05s;
}
.btn--primary:hover {
  box-shadow: 0 8px 20px rgba(27,111,232,0.35), 0 2px 4px rgba(27,111,232,0.2);
}
.btn--secondary:hover {
  box-shadow: 0 4px 12px rgba(27,58,107,0.15);
}
.btn--white:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Link underline slide-in animation */
main a:not(.btn):not(.logo):not([class*="card"]):not(.faq-question):not(.eq-opt),
.content-sidebar a:not(.btn):not([class*="card"]):not(.faq-question) {
  background-image: linear-gradient(to right, var(--amber) 0%, var(--amber) 100%);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: background-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: 1px;
}
main a:not(.btn):not(.logo):not([class*="card"]):not(.faq-question):not(.eq-opt):hover,
.content-sidebar a:not(.btn):not([class*="card"]):not(.faq-question):hover {
  background-size: 100% 1.5px;
}

/* Icon rotation on card hover */
.card-icon,
[class*="card"] .card-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.card:hover .card-icon {
  transform: rotate(-8deg) scale(1.08);
}

/* FAQ button — smoother open animation */
.faq-question {
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.faq-question:hover {
  color: var(--navy);
  padding-left: 8px;
}
.faq-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Related content cards — refined hover */
#related-content a[style*="border-radius:var(--radius-md)"] {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}
#related-content a[style*="border-radius:var(--radius-md)"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(27,111,232,0.12);
  border-color: var(--amber) !important;
}

/* State pills hover */
#related-content a[style*="border-radius:20px"] {
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
#related-content a[style*="border-radius:20px"]:hover {
  background: var(--amber) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Nav links — polished hover */
.nav-links a {
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
}
.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn).active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Sidebar card hover */
.sidebar-card {
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.sidebar-card:hover {
  transform: translateY(-2px);
}

/* Back to top — refined */
.back-to-top {
  transition: opacity 0.25s ease,
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s ease,
              box-shadow 0.2s ease;
}
.back-to-top.visible:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(27,111,232,0.4);
}

/* Score card items — subtle hover */
.score-zone-item {
  transition: transform 0.2s ease;
}
.score-zone-item:hover {
  transform: scale(1.03);
}

/* ==========================================================
   LEVEL 2 #4 — VISUAL HIERARCHY & SECTION DIVIDERS
   ========================================================== */

/* Section divider — subtle dot pattern (SVG data URI) */
.section-divider {
  height: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='%23C8DEFF' opacity='0.5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: repeat;
}

/* Section — subtle top pattern */
.section--white + .section--amber,
.section--amber + .section--white,
.section--white + .section {
  position: relative;
}

/* Enhanced section-header — better hierarchy */
.section-header {
  position: relative;
}
.section-header::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--navy) 100%);
  margin: 0 auto 20px;
  border-radius: 2px;
}

/* Eyebrow — bigger, more prominent */
.eyebrow {
  display: inline-block;
  padding: 4px 12px;
  background: var(--amber-light);
  color: var(--amber-dark);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero-eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(163,187,255,0.15);
  color: #A3BBFF;
  border-radius: 20px;
  border: 1px solid rgba(163,187,255,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Trust badges bar (SSL, Secure, etc.) — reusable component */
.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 24px auto;
  max-width: 720px;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.trust-badge-icon {
  width: 28px;
  height: 28px;
  background: var(--amber-light);
  color: var(--amber-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Callout box with author quote — magazine style */
.callout-quote {
  position: relative;
  background: var(--bg);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 28px 32px 28px 40px;
  margin: 32px 0;
}
.callout-quote::before {
  content: '"';
  position: absolute;
  top: -12px;
  left: 20px;
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--amber);
  line-height: 1;
  font-weight: 900;
}
.callout-quote p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--navy);
  margin-bottom: 12px;
}
.callout-quote-author {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.callout-quote-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
}

/* Section anchor style */
h2[id], h3[id] {
  scroll-margin-top: 20px;
}

/* ==========================================================
   LEVEL 2 #5 — DATA VISUALIZATION
   ========================================================== */

/* Animated bar chart — for original data section */
.animated-bar {
  overflow: hidden;
  position: relative;
}
.animated-bar-fill {
  height: 100%;
  transform-origin: left center;
  animation: bar-grow 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform: scaleX(0);
}
@keyframes bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Only animate when in view */
@media (prefers-reduced-motion: no-preference) {
  .original-data-bar {
    animation-play-state: paused;
  }
  .original-data-bar.in-view {
    animation-play-state: running;
  }
}

/* Credit Score Gauge — SVG-based */
.credit-gauge {
  position: relative;
  width: 260px;
  height: 160px;
  margin: 0 auto;
}
.credit-gauge svg {
  width: 100%;
  height: 100%;
}
.credit-gauge-value {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.credit-gauge-value .num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.credit-gauge-value .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 4px;
}
.gauge-needle {
  transform-origin: 130px 140px;
  animation: gauge-sweep 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes gauge-sweep {
  from { transform: rotate(-90deg); }
  to   { transform: rotate(var(--needle-angle, 0deg)); }
}

/* Rating stars animation */
.rating-stars {
  display: inline-flex;
  gap: 2px;
}
.rating-star {
  opacity: 0;
  animation: star-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.rating-star:nth-child(1) { animation-delay: 0.1s; }
.rating-star:nth-child(2) { animation-delay: 0.2s; }
.rating-star:nth-child(3) { animation-delay: 0.3s; }
.rating-star:nth-child(4) { animation-delay: 0.4s; }
.rating-star:nth-child(5) { animation-delay: 0.5s; }
@keyframes star-pop {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

/* Rating breakdown bar — animated */
.rating-bar-fill {
  animation: bar-grow 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: left;
}

/* Chart card wrapper */
.chart-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.chart-title {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Better focus rings — accessibility */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline-offset 0.15s ease;
}

/* Prefers reduced motion — respect */
@media (prefers-reduced-motion: reduce) {
  .card, .btn, .back-to-top, .sidebar-card,
  .credit-gauge, .rating-stars, .rating-star,
  .animated-bar-fill, .gauge-needle {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* ==========================================================
   DARK MODE — 2026 UX Standard
   Auto-detects OS preference + manual toggle support
   ========================================================== */

@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) {
    --bg: #0A1628;
    --bg-white: #0F1E36;
    --text: #E5EDFA;
    --text-muted: #94A9C9;
    --border: #2A3D5E;
    --amber-light: #1B2540;
    --navy: #E5EDFA;
    --navy-dark: #F0F6FF;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
  }

  :root:not(.light-mode) body {
    background: var(--bg);
    color: var(--text);
  }

  :root:not(.light-mode) .site-header {
    background: rgba(15,30,54,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
  }

  :root:not(.light-mode) .logo {
    background: linear-gradient(135deg, #A3BBFF 0%, #7EB8FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  :root:not(.light-mode) .nav-links a { color: var(--text); }
  :root:not(.light-mode) .nav-links a:hover { color: #7EB8FF; }

  :root:not(.light-mode) .card,
  :root:not(.light-mode) .chart-card,
  :root:not(.light-mode) .sidebar-card,
  :root:not(.light-mode) .callout-quote,
  :root:not(.light-mode) .trust-badges {
    background: var(--bg-white);
    border-color: var(--border);
  }

  :root:not(.light-mode) .section--white {
    background: var(--bg);
  }

  :root:not(.light-mode) .section--amber {
    background: #1A2540;
  }

  :root:not(.light-mode) .data-table,
  :root:not(.light-mode) .vs-table {
    background: var(--bg-white);
    color: var(--text);
  }

  :root:not(.light-mode) .data-table th,
  :root:not(.light-mode) .vs-table th {
    background: #162236;
    color: var(--text);
    border-color: var(--border);
  }

  :root:not(.light-mode) .data-table td,
  :root:not(.light-mode) .vs-table td {
    border-color: var(--border);
  }

  :root:not(.light-mode) .data-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
  }

  :root:not(.light-mode) .faq-question {
    color: var(--text);
    border-bottom-color: var(--border);
  }

  :root:not(.light-mode) .faq-answer { color: var(--text-muted); }

  :root:not(.light-mode) .footer-grid,
  :root:not(.light-mode) .site-footer {
    background: #050D1A;
  }

  :root:not(.light-mode) .btn--white {
    background: var(--bg-white);
    color: var(--text);
    border: 1px solid var(--border);
  }

  :root:not(.light-mode) .btn--secondary {
    background: transparent;
    border-color: #7EB8FF;
    color: #7EB8FF;
  }

  :root:not(.light-mode) .alert--info {
    background: rgba(126,184,255,0.08);
    border-color: rgba(126,184,255,0.25);
    color: var(--text);
  }

  :root:not(.light-mode) .alert--success {
    background: rgba(45,139,85,0.12);
    border-color: rgba(45,139,85,0.3);
    color: var(--text);
  }

  :root:not(.light-mode) .alert--warn {
    background: rgba(232,160,32,0.1);
    border-color: rgba(232,160,32,0.25);
    color: var(--text);
  }

  :root:not(.light-mode) .breadcrumb,
  :root:not(.light-mode) .breadcrumb a { color: var(--text-muted); }

  :root:not(.light-mode) .page-header { background: linear-gradient(180deg, #0A1628 0%, #0F1E36 100%); }

  :root:not(.light-mode) .eyebrow {
    background: rgba(232,160,32,0.15);
    color: #E8A020;
  }

  :root:not(.light-mode) .credit-gauge-value .num { color: var(--text); }

  :root:not(.light-mode) .quick-facts li,
  :root:not(.light-mode) .apply-sidebar-card { color: var(--text); }
}

/* Dark mode toggle button (optional manual override) */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 50;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--navy);
}
.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) .theme-toggle .sun-icon { display: block; }
  :root:not(.light-mode) .theme-toggle .moon-icon { display: none; }
}

/* ==========================================================
   ENHANCED PRINT STYLESHEET
   Optimized for readable, shareable finance guides
   ========================================================== */

@media print {
  @page {
    margin: 0.75in 0.6in;
    size: letter;
  }

  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
    overflow: visible;
  }

  /* Hide non-content elements */
  .site-header, .site-footer, .back-to-top, .theme-toggle,
  .cta-banner, .trust-badges, .mobile-menu, .hamburger,
  #loan-form, .apply-sidebar-card, .nav-links, .nav-cta,
  .hero-actions, .cta-banner-actions, .callout-quote::before,
  .rating-stars, script, .btn { display: none !important; }

  /* Hero — simplified */
  .hero {
    padding: 0 0 20px;
    background: none !important;
    color: #000;
    border-bottom: 2px solid #000;
    margin-bottom: 20px;
  }
  .hero h1 { color: #000; text-shadow: none; font-size: 22pt; margin-bottom: 8pt; }
  .hero .lead { color: #333; font-size: 12pt; margin-bottom: 12pt; }
  .hero-grid { display: block; }
  .score-card { display: none; }
  .hero-eyebrow { color: #666; }

  /* Sections */
  .section { padding: 20pt 0; page-break-inside: avoid; }
  h1 { font-size: 22pt; page-break-after: avoid; }
  h2 { font-size: 16pt; page-break-after: avoid; margin-top: 18pt; }
  h3 { font-size: 13pt; page-break-after: avoid; margin-top: 12pt; }
  h4 { font-size: 12pt; page-break-after: avoid; }

  p, li, td, th { orphans: 3; widows: 3; }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
    page-break-inside: avoid;
    margin: 10pt 0;
  }
  th, td {
    border: 1px solid #333 !important;
    padding: 6pt 8pt;
    text-align: left;
    font-size: 10pt;
  }
  th {
    background: #f0f0f0 !important;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Links — show URL in print */
  a[href^="http"]::after,
  a[href^="/"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666 !important;
    font-style: italic;
    word-wrap: break-word;
  }
  a[href^="#"]::after { content: ""; }

  /* Preserve alerts */
  .alert {
    border: 1px solid #333 !important;
    padding: 8pt 12pt;
    margin: 8pt 0;
    page-break-inside: avoid;
  }
  .alert--info { border-left: 4px solid #185FA5 !important; }
  .alert--warn { border-left: 4px solid #E8A020 !important; }
  .alert--success { border-left: 4px solid #2D8B55 !important; }

  /* Chart cards — keep visible */
  .chart-card {
    border: 1px solid #333 !important;
    padding: 10pt;
    page-break-inside: avoid;
    margin: 10pt 0;
  }

  /* Original data bars — show percentages */
  .animated-bar {
    background: #ddd !important;
    height: 8px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .animated-bar-fill {
    background: #333 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    animation: none !important;
    transform: none !important;
  }

  /* Content sidebar — stack for print */
  .content-sidebar { display: block; }
  aside { display: none; }

  /* Page break control */
  .section-header, table, h2, h3 { page-break-after: avoid; }
  ul, ol { page-break-inside: avoid; }

  /* Print header/footer */
  body::before {
    content: "AvantPersonalLoans.com — Independent Financial Guide";
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #666;
    border-bottom: 1px solid #999;
    padding-bottom: 6pt;
    margin-bottom: 12pt;
  }

  body::after {
    content: "Printed from AvantPersonalLoans.com | Last Reviewed: 2026-07-27 | Not affiliated with Avant, LLC.";
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #666;
    border-top: 1px solid #999;
    padding-top: 6pt;
    margin-top: 24pt;
  }

  /* Disclaimer — always print */
  .disclaimer {
    border: 1px dashed #666 !important;
    padding: 8pt;
    margin: 12pt 0;
    font-size: 9pt;
    page-break-inside: avoid;
  }

  /* FAQ answers — always visible in print */
  .faq-answer { display: block !important; max-height: none !important; padding: 8pt 0; }
  .faq-icon { display: none !important; }
  .faq-question { border: none !important; padding: 0 !important; font-weight: 700; }

  /* Container adjustments */
  .container { max-width: 100%; padding: 0; }
}

/* SVG icon inside trust badges */
.trust-badge-icon svg {
  display: block;
}
.trust-badge-icon:has(svg) {
  background: var(--amber);
  color: #fff;
}

/* Theme toggle button styling for header */
.header-inner .theme-toggle-inline {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy);
  transition: background 0.2s ease, border-color 0.2s ease;
  margin-right: 8px;
}
.header-inner .theme-toggle-inline:hover {
  background: var(--amber-light);
  border-color: var(--amber);
}
