/* ============================================================
   My Class Attendance — style.css
   Palette, typography and layout (WordPress-migration friendly)
   ============================================================ */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #3B82F6;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, .10);
  --container: 1120px;
  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--text); line-height: 1.2; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .7rem 1.3rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  min-height: 44px;
}
.btn:active { transform: scale(.98); }
.btn-lg { padding: .9rem 1.6rem; font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { box-shadow: var(--shadow-lg); }
.link { color: var(--primary); font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  background: var(--primary); color: #fff; border-radius: 9px;
}
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 1.4rem; }
.main-nav a { color: var(--text-muted); font-weight: 500; font-size: .92rem; transition: color .15s; }
.main-nav a:hover { color: var(--primary); }
.header-cta { flex-shrink: 0; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
.mobile-nav { display: none; flex-direction: column; gap: .25rem; padding: 12px 20px 20px; border-bottom: 1px solid var(--border); background: #fff; }
.mobile-nav a { padding: .7rem 0; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--border); }
.mobile-nav a.btn { border: 1px solid transparent; margin-top: .5rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; color: var(--primary);
  background: #EFF6FF; padding: .35rem .75rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2.1rem, 4.5vw, 3.3rem); font-weight: 800; letter-spacing: -.02em; }
.hero .lead { font-size: 1.12rem; color: var(--text-muted); margin: 1.1rem 0 1.8rem; max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-trust { display: flex; gap: 1.6rem; margin-top: 1.8rem; color: var(--text-muted); font-size: .9rem; }
.hero-trust strong { color: var(--text); font-family: var(--font-head); }

/* Hero art */
.hero-art { position: relative; min-height: 320px; }
.art-card { position: absolute; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.art-progress { top: 10px; left: 8%; padding: 20px; display: flex; align-items: center; gap: 14px; }
.art-progress-label span { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; }
.art-progress-label small { display: block; color: var(--text-muted); font-size: .8rem; }
.art-chart { bottom: 20px; left: 0; padding: 18px; display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.art-chart .bar { width: 16px; background: linear-gradient(var(--secondary), var(--primary)); border-radius: 4px; }
.art-calendar { top: 40%; right: 4%; padding: 14px; width: 140px; }
.cal-head { height: 8px; width: 46px; background: var(--primary); border-radius: 4px; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--border); }
.cal-grid i.on { background: var(--success); }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin: 0 auto 2.6rem; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 700; letter-spacing: -.01em; }
.section-head p { color: var(--text-muted); margin-top: .6rem; font-size: 1.05rem; }

/* ---------- Ad slot ---------- */
.ad-slot {
  margin: 1.5rem auto; min-height: 90px; display: grid; place-items: center;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: #94A3B8; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase;
  background: #fff;
}

/* ---------- Calculator ---------- */
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.calc-card, .result-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.8rem;
}
.field { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: .45rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input {
  font-family: var(--font-body); font-size: 1rem; padding: .8rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.field-hint { color: var(--text-muted); font-size: .8rem; }
.field-error { color: var(--danger); font-size: .8rem; min-height: 1em; }
.calc-buttons { display: flex; gap: .8rem; margin-top: .5rem; }
.calc-buttons .btn { flex: 1; }

/* Result card */
.result-card { min-height: 100%; text-align: center; }
.result-empty { color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1rem 0; }
/* Respect the [hidden] attribute so the empty-state ring and the result
   ring are never shown at the same time (prevents a duplicate chart). */
.result-empty[hidden],
.result-full[hidden] { display: none !important; }
.result-ring, .result-ring-svg { position: relative; display: inline-grid; place-items: center; }
.result-ring .ring-center { position: absolute; display: flex; flex-direction: column; }
.ring-value { font-family: var(--font-head); font-weight: 800; font-size: 2.1rem; }
.ring-caption { color: var(--text-muted); font-size: .8rem; }
#progressArc { transition: stroke-dashoffset 1s cubic-bezier(.22,1,.36,1), stroke .3s; }
.status-badge {
  display: inline-block; margin: 1rem 0 .5rem; padding: .4rem 1rem; border-radius: 999px;
  font-weight: 600; font-size: .85rem; color: #fff; background: var(--success);
}
.status-badge.excellent { background: var(--success); }
.status-badge.safe { background: var(--primary); }
.status-badge.warning { background: var(--warning); }
.status-badge.critical { background: var(--danger); }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.2rem; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; }
.stat-label { display: block; color: var(--text-muted); font-size: .8rem; }
.stat-value { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.8rem; color: var(--primary); }
.stat-unit { color: var(--text-muted); font-size: .78rem; }
.result-note { margin-top: 1.1rem; color: var(--text-muted); font-size: .92rem; }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; transition: transform .18s, box-shadow .18s, border-color .18s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #CBD5E1; }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; background: #EFF6FF; color: var(--primary); border-radius: 10px; font-size: 1.2rem; margin-bottom: 1rem; }
.feature h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.feature p { color: var(--text-muted); font-size: .95rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem 1.5rem; position: relative; }
.step-num { display: grid; place-items: center; width: 40px; height: 40px; background: var(--primary); color: #fff; border-radius: 10px; font-family: var(--font-head); font-weight: 700; margin-bottom: 1rem; }
.step h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.step p { color: var(--text-muted); font-size: .95rem; }

/* ---------- Explainer ---------- */
.explainer h3 { font-size: 1.2rem; margin: 1.6rem 0 .4rem; }
.explainer h3:first-child { margin-top: 0; }
.explainer p { color: var(--text-muted); }

/* ---------- Tools ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; transition: transform .18s, box-shadow .18s, border-color .18s; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.tool-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #EFF6FF; color: var(--primary); font-family: var(--font-head); font-weight: 700; margin-bottom: .9rem; }
.tool-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.tool-card p { color: var(--text-muted); font-size: .88rem; }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.blog-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: transform .18s, box-shadow .18s; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-tag { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--primary); background: #EFF6FF; padding: .25rem .6rem; border-radius: 6px; margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.blog-card h3 { font-size: 1.12rem; margin-bottom: .45rem; }
.blog-card h3 a:hover { color: var(--primary); }
.blog-card p { color: var(--text-muted); font-size: .92rem; margin-bottom: .9rem; }
.blog-read { color: var(--primary); font-weight: 600; font-size: .88rem; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: .8rem; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 1.2rem; }
.faq-item summary { cursor: pointer; list-style: none; font-weight: 600; padding: 1.1rem 0; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--primary); transition: transform .2s; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { color: var(--text-muted); padding-bottom: 1.1rem; }

/* ---------- CTA ---------- */
.cta { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: clamp(3rem, 6vw, 4.5rem) 0; }
.cta-inner { text-align: center; }
.cta h2 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.cta p { color: rgba(255,255,255,.85); margin: .8rem 0 1.8rem; font-size: 1.1rem; }

/* ---------- Two col ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.two-col h2 { font-size: 1.6rem; margin-bottom: .6rem; }
.two-col p { color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { background: #0F172A; color: #CBD5E1; padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: #94A3B8; margin-top: .6rem; font-size: .92rem; max-width: 34ch; }
.footer-links h3 { color: #fff; font-size: .95rem; margin-bottom: .8rem; }
.footer-links a { display: block; color: #94A3B8; padding: .3rem 0; font-size: .9rem; transition: color .15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { padding-top: 1.3rem; color: #64748B; font-size: .85rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .calc-layout { grid-template-columns: 1fr; }
  .feature-grid, .tools-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .feature-grid, .tools-grid, .blog-grid { grid-template-columns: 1fr; }
  .hero-trust { flex-wrap: wrap; gap: 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #progressArc { transition: none; }
}
