/* ===== CardDebtCalc — Fintech monoline, wide & light ===== */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Archivo:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #222837;
  --ink-soft: #5b6270;
  --muted: #97a0af;
  --paper: #f6f7f9;
  --card: #ffffff;
  --line: #e6e9ee;
  --primary: #3155e0;
  --primary-dark: #2442b8;
  --primary-soft: #e9eefe;
  --emerald: #0fa97c;
  --emerald-soft: #e2f6ee;
  --danger: #d64545;
  --danger-soft: #fbeaea;
  --gold: #f0a63b;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 32px rgba(34,40,55,.06);
  --max-width: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--paper); line-height: 1.7; font-size: 16px;
}

/* Header */
.site-header { background: rgba(255,255,255,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.site-header .inner { max-width: var(--max-width); margin: 0 auto; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; }
.site-header .logo { font-family: 'Libre Baskerville', Georgia, serif; font-size: 20px; font-weight: 700; color: var(--primary-dark); text-decoration: none; letter-spacing: -.2px; display: inline-flex; align-items: center; gap: 10px; }
.site-header .logo em, .footer-brand em { font-style: normal; color: var(--emerald); }
.site-header .logo-img { width: 36px; height: 36px; border-radius: 9px; display: block; flex-shrink: 0; background: var(--primary-soft); }
.site-header .nav-links { display: flex; gap: 24px; list-style: none; }
.site-header .nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 600; transition: color .2s; }
.site-header .nav-links a:hover { color: var(--primary); }

.menu-btn { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.menu-btn .bar { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .2s; }
.menu-btn[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 34px 20px 70px; }
.hero { margin-bottom: 24px; }
.hero h1 { font-family: 'Libre Baskerville', Georgia, serif; font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; color: var(--ink); }
.hero-sub { color: var(--ink-soft); font-size: 17px; margin-top: 10px; max-width: 660px; }

/* Tool */
.tool-panel { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.inputs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); position: sticky; top: 78px; }
.inputs .input-field { margin-bottom: 16px; }
.inputs label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; color: var(--ink); letter-spacing: .02em; }
.input-suffix { position: relative; }
.input-suffix input {
  width: 100%; padding: 13px 14px; border: 2px solid var(--line); border-radius: 12px;
  font-size: 16px; color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s;
  font-family: 'Archivo', sans-serif;
}
.input-suffix input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(49,85,224,.1); }
.input-suffix .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; font-weight: 600; pointer-events: none; }
.input-suffix-cur input { padding-left: 30px; }
.input-suffix-cur .pre { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; font-weight: 600; pointer-events: none; }

.mode-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.mode-tabs.inner { margin-bottom: 14px; }
.mode-tab { flex: 1; padding: 11px; border: 2px solid var(--line); background: #fff; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; transition: all .2s; font-family: 'Archivo', sans-serif; }
.mode-tab.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.input-field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(214,69,69,.12); }

.btn { width: 100%; padding: 15px; background: var(--primary); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 6px; transition: background .2s, transform .1s; font-family: 'Archivo', sans-serif; letter-spacing: .01em; }
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(.99); }
.btn-mini { padding: 12px; margin-top: 2px; }

.error-msg { color: var(--danger); font-size: 14px; margin-top: 12px; display: none; }
.error-msg.show { display: block; }

/* Card rows (multi) */
.cards-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.card-input-row { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--paper); position: relative; }
.card-input-row .card-head { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.card-input-row .rm-btn { border: none; background: none; color: var(--danger); font-size: 13px; font-weight: 700; cursor: pointer; }
.card-input-row .card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-input-row .mini-field label { font-size: 11px; }
.card-input-row input { padding: 11px; font-size: 15px; }
.card-input-row .card-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
.add-btn { width: 100%; padding: 11px; border: 2px dashed var(--line); background: none; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--primary); cursor: pointer; margin-bottom: 14px; font-family: 'Archivo', sans-serif; }
.add-btn:hover { border-color: var(--primary); }

/* Results */
.results { display: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.results.show { display: block; animation: fadeUp .45s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.score-hero { text-align: center; background: linear-gradient(135deg, var(--primary-soft), #f4f6ff); border: 1px solid #d7e0ff; border-radius: var(--radius); padding: 26px 20px; margin-bottom: 18px; }
.score-num { font-family: 'Libre Baskerville', Georgia, serif; font-size: 58px; font-weight: 700; line-height: 1; color: var(--primary-dark); }
.score-label { font-size: 15px; font-weight: 700; color: var(--primary); margin-top: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-card .stat-num { font-family: 'Libre Baskerville', Georgia, serif; font-size: 26px; font-weight: 700; color: var(--ink); }
.stat-card.warn .stat-num { color: var(--danger); }
.stat-card .stat-cap { font-size: 12px; color: var(--muted); margin-top: 4px; }

.min-warn { display: none; padding: 12px 16px; background: var(--danger-soft); border-left: 4px solid var(--danger); border-radius: 8px; font-size: 13px; color: #b02e2e; line-height: 1.6; }
.min-warn.show { display: block; }

/* Multi results */
.sum-line { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.sum-line strong { color: var(--ink); font-family: 'Libre Baskerville', Georgia, serif; }
.vs-wrap { display: flex; gap: 12px; align-items: stretch; margin-bottom: 14px; }
.vs-card { flex: 1; text-align: center; padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.vs-card:first-child { border-color: #d7e0ff; background: #f7f9ff; }
.vs-card:last-child { border-color: #cdeee3; background: #f4fbf8; }
.vs-head { font-weight: 800; font-size: 15px; }
.vs-card:first-child .vs-head { color: var(--primary-dark); }
.vs-card:last-child .vs-head { color: var(--emerald); }
.vs-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.vs-months { font-family: 'Libre Baskerville', Georgia, serif; font-size: 40px; font-weight: 700; line-height: 1; }
.vs-card:first-child .vs-months { color: var(--primary-dark); }
.vs-card:last-child .vs-months { color: var(--emerald); }
.vs-cap { font-size: 12px; color: var(--muted); }
.vs-interest { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 6px; }
.vs-divider { align-self: center; font-family: 'Libre Baskerville', Georgia, serif; font-style: italic; color: var(--muted); font-weight: 700; }
.vs-verdict { padding: 14px 18px; background: var(--emerald-soft); border-left: 4px solid var(--emerald); border-radius: 8px; font-size: 14px; color: #0b7a5b; line-height: 1.6; margin-bottom: 12px; }
.pp-warn { display: none; padding: 12px 16px; background: var(--danger-soft); border-left: 4px solid var(--danger); border-radius: 8px; font-size: 13px; color: #b02e2e; line-height: 1.6; }
.pp-warn.show { display: block; }

/* Balance transfer */
.bt-block { margin-top: 22px; padding-top: 22px; border-top: 2px solid var(--line); }
.block-title { font-size: 15px; font-weight: 800; margin-bottom: 14px; color: var(--ink); }
.bt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.bt-result { margin-top: 14px; padding: 16px 18px; border-radius: 12px; font-size: 13px; line-height: 1.7; }
.bt-result.show-savings { background: var(--emerald-soft); border-left: 4px solid var(--emerald); color: #0b7a5b; }
.bt-result.show-loss { background: var(--danger-soft); border-left: 4px solid var(--danger); color: #b02e2e; }
.bt-result strong { font-family: 'Libre Baskerville', Georgia, serif; font-size: 18px; }

/* Sections */
.section { margin-top: 52px; }
.section h2 { font-family: 'Libre Baskerville', Georgia, serif; font-size: 28px; font-weight: 700; margin-bottom: 16px; letter-spacing: -.4px; color: var(--ink); }
.section h3 { font-size: 17px; font-weight: 700; margin: 24px 0 10px; color: var(--primary-dark); }
.section p { margin-bottom: 14px; color: var(--ink); }
.section ul { margin: 0 0 16px 22px; }
.section li { margin-bottom: 8px; }
.safety-box { margin: 14px 0; padding: 14px 18px; background: var(--danger-soft); border-left: 4px solid var(--danger); border-radius: 10px; font-size: 14px; color: #8f3030; }

.ref-table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: 14px; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.ref-table th, .ref-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.ref-table thead th { background: var(--paper); font-weight: 700; color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table td.cell-strong { font-weight: 600; color: var(--primary-dark); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item summary { font-weight: 700; font-size: 16px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 22px; color: var(--primary); font-weight: 400; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin-top: 12px; color: var(--ink-soft); font-size: 15px; }

/* Footer */
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding: 38px 20px; }
.site-footer .inner { max-width: var(--max-width); margin: 0 auto; }
.site-footer .footer-brand { font-family: 'Libre Baskerville', Georgia, serif; font-size: 18px; font-weight: 700; color: var(--primary-dark); display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.footer-logo { border-radius: 6px; background: var(--primary-soft); }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }
.site-footer .footer-links a { color: var(--ink-soft); text-decoration: none; font-size: 14px; transition: color .2s; }
.site-footer .footer-links a:hover { color: var(--primary); }
.site-footer .copyright { font-size: 13px; color: #9fa6b3; }

/* Cookie banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--ink); color: #fff; padding: 18px 20px; z-index: 9999; display: none; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.cookie-banner.show { display: flex; }
.cookie-banner p { font-size: 14px; max-width: 600px; }
.cookie-banner p a { color: #9fb2ff; }
.cookie-banner .cookie-btns { display: flex; gap: 10px; }
.cookie-banner .btn-cookie { padding: 9px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; }
.cookie-banner .btn-accept { background: var(--primary); color: #fff; }
.cookie-banner .btn-decline { background: transparent; color: #fff; border: 1px solid #64748b; }

/* Responsive */
@media (max-width: 880px) {
  .tool-panel { grid-template-columns: 1fr; }
  .inputs { position: static; }
}
@media (max-width: 600px) {
  .site-header .inner { position: relative; }
  .menu-btn { display: flex; }
  nav { display: contents; }
  .site-header .nav-links { position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; gap: 2px; padding: 8px; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(34,40,55,.14); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s; }
  .site-header .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .site-header .nav-links a { display: block; padding: 11px 14px; }
  .hero h1 { font-size: 30px; }
  .score-num { font-size: 46px; }
  .stat-grid { grid-template-columns: 1fr; }
  .vs-wrap { flex-direction: column; }
  .vs-divider { align-self: center; }
  .bt-grid { grid-template-columns: 1fr; }
  .section h2 { font-size: 23px; }
  .cookie-banner { flex-direction: column; text-align: center; }
}

/* Compliance pages */
.page-content { max-width: 820px; margin: 0 auto; padding: 46px 20px 70px; }
.page-content h1 { font-family: 'Libre Baskerville', Georgia, serif; font-size: 34px; font-weight: 700; margin-bottom: 24px; letter-spacing: -.4px; }
.page-content h2 { font-size: 20px; font-weight: 700; margin: 30px 0 12px; color: var(--primary-dark); }
.page-content p { margin-bottom: 14px; color: var(--ink); }
.page-content ul { margin: 0 0 16px 22px; }
.page-content li { margin-bottom: 8px; }
.page-content a { color: var(--primary); }
.contact-form { margin-top: 20px; }
.contact-form .field { margin-bottom: 18px; }
.contact-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 13px 16px; border: 2px solid var(--line); border-radius: 10px; font-size: 15px; font-family: 'Archivo', sans-serif; background: #fff; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary); }
.contact-form .btn { width: auto; padding: 13px 30px; margin-top: 0; }
#contact-status { margin-top: 14px; font-weight: 600; }

/* Articles */
.content-section h2 { font-family: 'Libre Baskerville', Georgia, serif; font-size: 28px; font-weight: 700; margin-bottom: 20px; letter-spacing: -.4px; }
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-list a { display: block; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.article-list a:hover { border-color: var(--primary); box-shadow: 0 4px 18px rgba(49,85,224,.1); transform: translateY(-2px); }
.article-list .article-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; line-height: 1.4; }
.article-list a:hover .article-title { color: var(--primary); }
.article-list .article-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.article-content { padding: 46px 0; }
.article-content .inner { max-width: 780px; margin: 0 auto; padding: 0 20px; }
.article-content article { background: #fff; border-radius: 16px; padding: 46px 54px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.article-content h1 { font-family: 'Libre Baskerville', Georgia, serif; font-size: 2rem; font-weight: 700; color: var(--ink); margin-bottom: 12px; line-height: 1.25; letter-spacing: -.5px; }
.article-content .article-meta { font-size: .85rem; color: var(--muted); margin-bottom: 30px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article-content h2 { font-family: 'Libre Baskerville', Georgia, serif; font-size: 1.4rem; font-weight: 700; color: var(--ink); margin: 38px 0 14px; letter-spacing: -.3px; }
.article-content h3 { font-size: 1.08rem; font-weight: 700; color: var(--primary-dark); margin: 26px 0 10px; }
.article-content p { margin-bottom: 18px; color: var(--ink); line-height: 1.85; }
.article-content ul, .article-content ol { margin: 0 0 20px 24px; }
.article-content li { margin-bottom: 10px; line-height: 1.8; }
.article-content a { color: var(--primary); text-decoration: none; font-weight: 500; }
.article-content a:hover { text-decoration: underline; }
.article-content blockquote { border-left: 4px solid var(--primary); padding: 16px 22px; margin: 24px 0; background: var(--primary-soft); border-radius: 0 8px 8px 0; color: var(--ink); }
.article-content code { font-family: 'Archivo', monospace; background: var(--primary-soft); color: var(--primary-dark); padding: 2px 7px; border-radius: 4px; font-size: .88em; }
.article-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; font-size: .88rem; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.article-back:hover { color: var(--primary); }
.article-back::before { content: '\2190'; font-size: 1.1rem; }
.faq-section { margin-top: 46px; padding-top: 30px; border-top: 2px solid var(--line); }
.faq-section .faq details { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--paper); overflow: hidden; }
.faq-section .faq details[open] { border-color: var(--primary); }
.faq-section .faq summary { padding: 15px 20px; font-weight: 700; font-size: .95rem; cursor: pointer; list-style: none; color: var(--ink); }
.faq-section .faq summary::-webkit-details-marker { display: none; }
.faq-section .faq details p { padding: 0 20px 18px 20px; margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.75; }
.related-articles { margin-top: 46px; padding-top: 30px; border-top: 2px solid var(--line); }
.related-articles ul { list-style: none; display: grid; gap: 10px; }
.related-articles a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 15px 19px; color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500; }
.related-articles a:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 600px) {
  .article-content article { padding: 28px 22px; border-radius: 12px; }
  .article-content h1 { font-size: 1.5rem; }
  .article-content h2 { font-size: 1.2rem; }
  .site-header .inner:not(:has(.menu-btn)) nav { display: block; }
  .site-header .inner:not(:has(.menu-btn)) .nav-links { position: static; opacity: 1; visibility: visible; transform: none; flex-direction: row; flex-wrap: wrap; gap: 6px; background: none; border: none; box-shadow: none; padding: 0; }
  .site-header .inner:not(:has(.menu-btn)) .nav-links a { padding: 6px 9px; font-size: .8rem; }
}