/* ==========================================================================
   Chancenly – styles.css
   Mobile-first, light/dark themes via CSS custom properties.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --bg-soft: #eef2f7;
  --text: #1a2332;
  --text-muted: #55627a;
  --accent: #1465c9;
  --accent-strong: #0f4fa0;
  --accent-soft: #e3eefc;
  --border: #dde3ec;
  --success-bg: #e6f6ec;
  --success-text: #14683a;
  --success-border: #9ad4b0;
  --warn-bg: #fdf3e0;
  --warn-text: #8a5a10;
  --warn-border: #ecc98a;
  --fail-bg: #fbe9e9;
  --fail-text: #942222;
  --fail-border: #e5a5a5;
  --shadow: 0 1px 3px rgba(16, 30, 54, .07), 0 8px 24px rgba(16, 30, 54, .06);
  --radius: 12px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --max-width: 1100px;
}

html[data-theme="dark"] {
  --bg: #0f1522;
  --bg-alt: #171f30;
  --bg-soft: #1e2840;
  --text: #e8edf5;
  --text-muted: #a3aec4;
  --accent: #5c9dee;
  --accent-strong: #82b5f3;
  --accent-soft: #1c2f4d;
  --border: #2c3852;
  --success-bg: #12301f;
  --success-text: #8fdcae;
  --success-border: #2b5c40;
  --warn-bg: #34290f;
  --warn-text: #eecb84;
  --warn-border: #6b5320;
  --fail-bg: #391818;
  --fail-text: #f0a3a3;
  --fail-border: #6b2c2c;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

/* ---------- Language visibility ----------
   Default language is English. JS sets data-lang on <html>. */
html[data-lang="en"] .lang-de { display: none !important; }
html[data-lang="de"] .lang-en { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 .6em;
  font-weight: 600;
}

h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 700; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

img, svg { max-width: 100%; height: auto; }

ul, ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
li { margin-bottom: .35em; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.1rem;
}

.muted { color: var(--text-muted); }
.small { font-size: .87rem; }

/* Visible keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .65rem 1.1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}
.brand svg { flex-shrink: 0; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: .95rem;
  padding: .35rem 0;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--accent);
}
.main-nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); }

.header-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.lang-toggle, .theme-toggle, .nav-toggle {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .38rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}
.lang-toggle:hover, .theme-toggle:hover, .nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lang-toggle .active { color: var(--accent); }
.lang-toggle .inactive { color: var(--text-muted); font-weight: 400; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: .5rem 1.1rem 1rem; }
  .main-nav a { display: block; padding: .6rem 0; font-size: 1.05rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 3.2rem 0 2.6rem;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
}
.hero .container { max-width: 850px; text-align: center; }
.hero .eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .85rem;
  margin-bottom: 1.1rem;
}
.hero p.lead { font-size: 1.12rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 1.6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  padding: .75rem 1.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }

/* Large hero CTA — extra padding, larger type, strong contrast, easy to tap */
.btn-hero {
  font-size: 1.15rem;
  padding: 1.05rem 2.4rem;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(20, 101, 201, .35);
  min-height: 56px; /* comfortable mobile tap target */
}
.btn-hero:hover {
  background: var(--accent-strong);
  box-shadow: 0 6px 20px rgba(20, 101, 201, .45);
  transform: translateY(-2px);
}
@media (max-width: 480px) {
  .btn-hero { display: block; width: 100%; text-align: center; }
}
.btn-secondary { background: var(--bg-alt); color: var(--accent); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: none; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

/* ---------- Sections & cards ---------- */
.section { padding: 2.8rem 0; }
.section-alt { background: var(--bg-soft); }
.section-title { text-align: center; margin-bottom: .4em; }
.section-sub { text-align: center; color: var(--text-muted); max-width: 620px; margin: 0 auto 2rem; }

.card-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .points-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: .82rem;
  border-radius: 999px;
  padding: .18rem .7rem;
  margin-bottom: .5rem;
}

/* ---------- Notice / info boxes ---------- */
.notice {
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.2rem 0;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.notice-info { background: var(--accent-soft); border-color: var(--accent); }
.notice-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.notice-fail { background: var(--fail-bg); border-color: var(--fail-border); color: var(--fail-text); }
.notice h3, .notice h2 { margin-top: 0; color: inherit; }
.notice a { color: inherit; font-weight: 600; }

/* ---------- Calculator form ---------- */
.calc-step {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow);
}
.calc-step legend, .calc-step .step-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  padding: 0 .3rem;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: .8em;
  font-weight: 700;
  margin-right: .5rem;
}

fieldset { border: none; margin: 0; padding: 0; }
fieldset.calc-step { border: 1px solid var(--border); }

.field { margin: 1.15rem 0; }
.field > label, .field > .field-label {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
}
.field .help {
  font-size: .86rem;
  color: var(--text-muted);
  margin: .3rem 0 0;
}

select, input[type="number"], input[type="text"] {
  width: 100%;
  max-width: 420px;
  padding: .6rem .75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.radio-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .9rem;
  cursor: pointer;
  background: var(--bg);
  font-weight: 500;
}
.radio-row label:hover { border-color: var(--accent); }
.radio-row input { accent-color: var(--accent); }
.radio-row input:checked + span { color: var(--accent); font-weight: 600; }

/* Tooltip via <details> */
details.tip { margin-top: .4rem; font-size: .87rem; }
details.tip summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}
details.tip summary::before { content: "ⓘ "; }
details.tip[open] summary { margin-bottom: .3rem; }
details.tip .tip-body {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  padding: .6rem .8rem;
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}

.calc-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.5rem 0; }

/* Result panel */
#calc-result[hidden] { display: none; }
.result-panel {
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  margin: 1.5rem 0;
  border: 2px solid var(--border);
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}
.result-score {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: .2em;
}
.result-panel.pass { border-color: var(--success-border); }
.result-panel.pass .result-score { color: var(--success-text); }
.result-panel.fail { border-color: var(--fail-border); }
.result-panel.fail .result-score { color: var(--fail-text); }
.result-breakdown { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .93rem; }
.result-breakdown th, .result-breakdown td {
  text-align: left;
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--border);
}
.result-breakdown td:last-child, .result-breakdown th:last-child { text-align: right; }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .7rem;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: .95rem 1.15rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-weight: 700; color: var(--accent); }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 1.15rem 1rem; color: var(--text-muted); }

/* ---------- Blog ---------- */
.post-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.post-card time { font-size: .82rem; color: var(--text-muted); }
.post-card h3 { margin: .35rem 0 .5rem; }
.post-card h3 a { text-decoration: none; color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { flex: 1; color: var(--text-muted); font-size: .93rem; }
.post-card .read-more {
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  display: inline-block;
  margin-top: .4rem;
}
.post-card .read-more:hover { text-decoration: underline; }

/* Example profile cards on the homepage */
.profile-card .verdict {
  display: inline-block;
  font-weight: 700;
  font-size: .85rem;
  border-radius: 999px;
  padding: .25rem .8rem;
  margin-top: .6rem;
}
.profile-card .verdict.pass { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.profile-card .verdict.fail { background: var(--fail-bg); color: var(--fail-text); border: 1px solid var(--fail-border); }
.profile-card ul { font-size: .92rem; color: var(--text-muted); margin-bottom: .3rem; }

/* Article layout */
.article-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  padding: 2.2rem 0;
}
@media (min-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
article.post { max-width: 720px; }
article.post .post-meta { color: var(--text-muted); font-size: .88rem; margin-bottom: 1.6rem; }
article.post h2 { margin-top: 1.6em; }
article.post h3 { margin-top: 1.3em; }

/* ---------- Sidebar / monetization placeholders ---------- */
.sidebar { display: flex; flex-direction: column; gap: 1.1rem; }
.promo-box {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.promo-box h3 { margin-top: 0; font-size: 1rem; }
.promo-box ul { margin-bottom: 0; font-size: .9rem; }

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--bg-soft);
  margin: 1.6rem 0;
}
.ad-slot.horizontal { min-height: 90px; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  text-align: center;
}
.cta-banner h2 { color: #fff; }
.cta-banner .btn { background: #fff; color: var(--accent); }
.cta-banner .btn:hover { background: var(--bg-soft); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2.4rem 0 2rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.8rem;
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h3 { font-size: .95rem; color: var(--text); margin-bottom: .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

.disclaimer {
  border-top: 1px solid var(--border);
  padding-top: 1.3rem;
  font-size: .82rem;
  line-height: 1.6;
}
.disclaimer strong { color: var(--text); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-2 { margin-bottom: 2rem; }

@media print {
  .site-header, .site-footer, .ad-slot, .promo-box, .calc-actions { display: none; }
}
