/* IndianCivils shared styles: used by redesigned pages.
   Path: static/css/site.css  ->  <link rel="stylesheet" href="/static/css/site.css"> */
:root {
  --blue: #1D4ED8;
  --blue-deep: #1E3A8A;
  --blue-tint: #EFF4FF;
  --purple: #6D28D9;
  --purple-tint: #F5F3FF;
  --green: #15803D;
  --green-tint: #ECFDF3;
  --ink: #0F172A;
  --muted: #475569;
  --line: #E2E8F0;
  --surface: #F8FAFC;
  --white: #FFFFFF;
  --radius: 10px;
  --wrap: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 16px; line-height: 1.6;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #93B4FF; outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--blue-deep); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--surface { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.section__head h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.section__head p { color: var(--muted); margin-top: 8px; max-width: 640px; font-size: 1.05rem; }
.section__head > a { font-weight: 600; text-decoration: none; }
.section__head > a:hover { text-decoration: underline; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--white); padding: 8px 12px; }
.c-blue { color: var(--blue); } .c-purple { color: var(--purple); } .c-green { color: var(--green); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.97rem/1 "IBM Plex Sans", sans-serif; text-decoration: none; white-space: nowrap;
  padding: 13px 22px; border-radius: 8px; border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn--blue { background: var(--blue); color: var(--white); }
.btn--blue:hover { background: var(--blue-deep); }
.btn--green { background: var(--green); color: var(--white); }
.btn--green:hover { background: #166534; }
.btn--purple { background: var(--purple); color: var(--white); }
.btn--purple:hover { background: #5B21B6; }
.btn--outline { background: var(--white); color: var(--blue-deep); border-color: #C7D2E5; }
.btn--outline:hover { border-color: var(--blue); color: var(--blue); }
.btn--sm { padding: 9px 16px; font-size: 0.92rem; }
.btn img { width: 20px; height: 20px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; gap: 26px; margin-right: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.97rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
.actions { display: flex; align-items: center; gap: 12px; }
.link-quiet { color: var(--muted); font-weight: 500; text-decoration: none; font-size: 0.95rem; }
.link-quiet:hover { color: var(--ink); text-decoration: underline; }
.mobile-nav { display: none; gap: 20px; overflow-x: auto; padding: 10px 24px; border-top: 1px solid var(--line); white-space: nowrap; }
.mobile-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.93rem; }
.mobile-nav a[aria-current="page"] { color: var(--blue); }

/* Breadcrumb */
.crumbs { font-size: 0.9rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs span { margin: 0 6px; }

/* Contact box */
.contact { padding: 0 0 72px; }
.contact__box { background: var(--green-tint); border: 1px solid #C6EBD4; border-radius: 14px; padding: 36px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.contact__box h2 { font-size: 1.5rem; font-weight: 700; }
.contact__box p { color: var(--muted); margin-top: 6px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.footer { background: var(--blue-deep); color: #C7D4F0; padding: 56px 0 28px; font-size: 0.95rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
.footer h3 { color: var(--white); font-size: 0.98rem; font-weight: 600; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 3px 0; }
.footer a { color: #C7D4F0; text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; }
.footer__logo { height: 40px; width: auto; background: var(--white); padding: 6px 10px; border-radius: 6px; }
.footer__about { margin-top: 14px; max-width: 28em; }
.footer__iso { width: 64px; height: 64px; object-fit: contain; background: var(--white); border-radius: 6px; padding: 4px; margin-top: 16px; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 40px; padding-top: 20px; font-size: 0.88rem; }

/* Responsive (shared parts) */
@media (max-width: 1040px) {
  .nav { display: none; }
  .actions { margin-left: auto; }
  .mobile-nav { display: flex; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .section { padding: 52px 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hide-sm { display: none; }
  .brand img { height: 34px; }
  .topbar__inner { min-height: 60px; gap: 12px; }
  .contact__box { padding: 28px 22px; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   Shared components used by pages that extend templates/base.html
   ===================================================================== */
.page-head { padding: 36px 0 40px; background: linear-gradient(180deg, var(--blue-tint) 0%, var(--white) 100%); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 700; letter-spacing: -0.01em; margin-top: 14px; }
.page-head__lead { color: var(--muted); font-size: 1.08rem; margin-top: 10px; max-width: 46em; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 26px; }
.panel > h2 { font-size: 1.3rem; font-weight: 700; }
.panel > p.sub { color: var(--muted); margin-top: 6px; }
.narrow { max-width: 520px; margin: 0 auto; }
.center-page { padding: 56px 0 72px; background: linear-gradient(180deg, var(--blue-tint) 0%, var(--white) 70%); }

/* Forms */
.form { display: grid; gap: 16px; margin-top: 20px; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.input, .select {
  width: 100%; font: 400 1rem/1.4 "IBM Plex Sans", sans-serif; color: var(--ink);
  padding: 11px 13px; border: 1px solid #CBD5E1; border-radius: 8px; background: var(--white);
}
.input:focus, .select:focus { outline: 2px solid #93B4FF; outline-offset: 1px; border-color: var(--blue); }
.form .btn { width: 100%; padding: 14px; font-size: 1rem; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 0.94rem; border: 1px solid; }
.alert--success { background: var(--green-tint); color: #14532D; border-color: #BBE5CB; }
.alert--error, .alert--danger { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.alert--info, .alert--message, .alert--warning { background: var(--blue-tint); color: var(--blue-deep); border-color: #C7D7FE; }
.alerts { display: grid; gap: 8px; margin-bottom: 16px; }

/* Status pages (payment success / failure / errors) */
.status { text-align: center; }
.status__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; }
.status__icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.status__icon--ok { background: var(--green-tint); color: var(--green); }
.status__icon--fail { background: #FEF2F2; color: #B91C1C; }
.status__icon--info { background: var(--blue-tint); color: var(--blue); }
.status h1 { font-size: 1.7rem; font-weight: 700; }
.status p { color: var(--muted); margin-top: 10px; }
.status .actions-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }
.steps-list { text-align: left; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; }
.steps-list li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.steps-list li::before { content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }

/* Data tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-weight: 600; font-size: 0.84rem; color: var(--muted); background: var(--surface); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFCFE; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stat strong { display: block; font-size: 1.7rem; line-height: 1.15; color: var(--blue-deep); }
.stat span { color: var(--muted); font-size: 0.9rem; }

/* Long-form content (guides, syllabus pages) */
.prose { font-size: 1.02rem; }
.prose h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 700; margin: 0 0 12px; }
.prose h2 { font-size: 1.45rem; font-weight: 700; margin: 0 0 12px; }
.prose h3 { font-size: 1.12rem; font-weight: 600; margin: 0 0 8px; }
.prose p { margin: 0 0 12px; color: #334155; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; color: #334155; }
.prose li { margin: 4px 0; }
.prose section + section { margin-top: 48px; }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose th { background: var(--surface); font-weight: 600; }

.badge { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-deep); white-space: nowrap; }
.badge--green { background: var(--green-tint); color: #14532D; }
.badge--purple { background: var(--purple-tint); color: #5B21B6; }
.badge--muted { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.tick { color: var(--green); font-weight: 700; }
.dash { color: #CBD5E1; }
