/* castecertificateinfo.com — Design System
   White #FFFFFF | Section gray #F8FAFC | Primary blue #1E40AF
   Accent saffron #F59E0B | Headings #1E293B | Body #64748B... body #475569 */

:root {
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;
  --primary: #1E40AF;
  --primary-dark: #1E3A8A;
  --primary-soft: #EFF6FF;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --heading: #1E293B;
  --body: #475569;
  --muted: #94A3B8;
  --border: #E2E8F0;
  --green-soft: #ECFDF5;
  --green: #047857;
  --amber-soft: #FFFBEB;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--heading); line-height: 1.3; font-weight: 700; }
h1 { font-size: 2.1rem; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.55rem; margin: 2.4rem 0 1rem; padding-top: .4rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
p { margin: 0 0 1.1rem; }
ul, ol { margin: 0 0 1.2rem 1.3rem; }
li { margin-bottom: .45rem; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.content-narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--heading); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; flex: 0 0 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 60%, var(--accent) 130%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem;
}
.brand small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); line-height: 1.2; }

.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a {
  color: var(--heading); font-weight: 600; font-size: .95rem;
  padding: 9px 14px; border-radius: 8px; white-space: nowrap;
}
.main-nav a:hover { background: var(--bg-soft); text-decoration: none; color: var(--primary); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 1.2rem; cursor: pointer; color: var(--heading); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 100%);
  padding: 64px 0 56px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.5rem; max-width: 760px; margin: 0 auto 1rem; }
.hero p.lead { font-size: 1.15rem; max-width: 640px; margin: 0 auto 1.8rem; }
.hero-badge {
  display: inline-block; background: #fff; border: 1px solid var(--border);
  color: var(--primary); font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 6px 14px; border-radius: 999px; margin-bottom: 1.1rem;
}

.btn {
  display: inline-block; font-weight: 700; border-radius: 10px;
  padding: 13px 26px; font-size: 1rem; border: none; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-accent { background: var(--accent); color: #1E293B; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-soft); text-decoration: none; }

/* ---------- Pillar cards ---------- */
.section { padding: 56px 0; }
.section-gray { background: var(--bg-soft); }
.section-title { text-align: center; margin-bottom: .6rem; }
.section-sub { text-align: center; max-width: 640px; margin: 0 auto 2.2rem; }

.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15,23,42,.1); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 14px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800;
}
.card h3 { margin: 0 0 .5rem; font-size: 1.12rem; }
.card h3 a { color: var(--heading); }
.card p { font-size: .93rem; margin-bottom: 1rem; flex: 1; }
.card .card-meta { font-size: .8rem; color: var(--muted); margin-bottom: .8rem; }
.card-link { font-weight: 700; font-size: .93rem; }

/* ---------- Article layout ---------- */
.article-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; padding: 40px 0 64px; align-items: start; }
.toc {
  position: sticky; top: 96px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  font-size: .9rem; max-height: calc(100vh - 130px); overflow: auto;
}
.toc strong { display: block; margin-bottom: 8px; color: var(--heading); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--body); font-size: .88rem; }
.toc a:hover { background: #fff; color: var(--primary); text-decoration: none; }
.toc a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.article-body h1 { margin-top: 0; }
.article-meta { color: var(--muted); font-size: .88rem; margin-bottom: 1.6rem; }

/* Breadcrumbs */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 6px; }

/* Step cards */
.steps { counter-reset: step; margin: 1.6rem 0; display: grid; gap: 14px; }
.step {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 20px;
  box-shadow: var(--shadow); position: relative;
}
.step h3 { margin: 0 0 .4rem; font-size: 1.08rem; display: flex; align-items: center; gap: 10px; }
.step-num {
  counter-increment: step; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .95rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.step-num::before { content: counter(step); }
.step p:last-child { margin-bottom: 0; }

/* Callout boxes */
.callout {
  border-radius: var(--radius); padding: 18px 20px; margin: 1.6rem 0;
  border: 1px solid var(--border); font-size: .96rem;
}
.callout strong { display: block; margin-bottom: .3rem; color: var(--heading); }
.callout-official { background: var(--primary-soft); border-color: #BFDBFE; }
.callout-official strong { color: var(--primary); }
.callout-tip { background: var(--green-soft); border-color: #A7F3D0; }
.callout-tip strong { color: var(--green); }
.callout-warn { background: var(--amber-soft); border-color: #FDE68A; }
.callout-warn strong { color: #92400E; }
.callout-verify { background: #F5F3FF; border-color: #DDD6FE; }
.callout-verify strong { color: #5B21B6; }


/* Document checklist */
.doc-list { list-style: none; margin-left: 0; }
.doc-list li {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px 12px 44px; position: relative; margin-bottom: 10px;
}
.doc-list li::before {
  content: "✓"; position: absolute; left: 16px; top: 12px;
  color: var(--green); font-weight: 800;
}
.doc-list li strong { color: var(--heading); }

/* FAQ accordion */
.faq { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 1.4rem 0; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; text-align: left; background: #fff; border: none; cursor: pointer;
  padding: 16px 20px; font-size: 1rem; font-weight: 700; color: var(--heading);
  font-family: var(--font); display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-q:hover { background: var(--bg-soft); }
.faq-q .faq-icon { flex: 0 0 auto; color: var(--primary); font-size: 1.2rem; transition: transform .2s; }
.faq-item.open .faq-q .faq-icon { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 20px 18px; font-size: .97rem; }
.faq-item.open .faq-a { display: block; }

/* Related cards */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 1.2rem; }
.related-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  background: #fff; transition: box-shadow .15s;
}
.related-card:hover { box-shadow: var(--shadow); }
.related-card h4 { font-size: 1rem; margin: 0 0 .4rem; }
.related-card p { font-size: .87rem; margin: 0; }

/* Quick-link list (homepage) */
.guide-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 1.6rem; }
.guide-link {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.guide-link:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow); }
.guide-link .gl-arrow { color: var(--accent-dark); font-weight: 800; }
.guide-link strong { color: var(--heading); display: block; font-size: .98rem; }
.guide-link span { font-size: .86rem; color: var(--muted); }

/* State pills */
.state-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2rem 0; }
.state-pill {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 8px 18px; font-size: .9rem; font-weight: 600; color: var(--heading);
}
.state-pill:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--heading); color: #CBD5E1; padding: 48px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: .6rem; display: block; }
.site-footer p, .site-footer li { font-size: .9rem; }
.site-footer ul { list-style: none; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: #CBD5E1; }
.site-footer a:hover { color: #fff; }
.footer-h { color: #fff; font-size: .95rem; font-weight: 700; margin-bottom: .9rem; }
.disclaimer-box {
  border-top: 1px solid #334155; padding: 22px 0; font-size: .82rem; color: #94A3B8;
}
.disclaimer-box strong { color: #E2E8F0; }
.footer-bottom { border-top: 1px solid #334155; padding: 16px 0; font-size: .82rem; color: #94A3B8; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; margin-bottom: 8px; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    border-bottom: 1px solid var(--border); padding: 10px 20px 16px;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 8px; border-bottom: 1px solid var(--bg-soft); }
  .nav-toggle { display: block; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 44px 0 40px; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .guide-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}
