/* GiagEdu Solutions — main stylesheet */
:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font-size: 1.35rem; font-weight: 800; color: var(--primary-dark); }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; list-style: none; align-items: center; }
.nav-links a { color: var(--text); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-toggle {
  display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--text);
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--card); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 16px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 8px; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; font-size: 1rem; transition: 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #111827; }
.btn-accent:hover { filter: brightness(0.95); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 80px 0 90px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin-bottom: 16px; }
.hero p { font-size: 1.15rem; max-width: 620px; opacity: 0.92; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.page-hero { padding: 50px 0; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.page-hero p { margin-bottom: 0; }

/* ---------- Sections ---------- */
section { padding: 70px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); color: var(--primary-dark); }
.section-title p { color: var(--muted); max-width: 620px; margin: 8px auto 0; }
.alt-bg { background: #eef2ff; }

.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.card .icon { font-size: 2rem; margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; color: var(--primary-dark); }
.card p { color: var(--muted); margin-bottom: 14px; }
.card ul { padding-left: 18px; color: var(--muted); margin-bottom: 14px; }

.badge {
  display: inline-block; background: #fef3c7; color: #92400e; font-size: 0.75rem;
  font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}

.stats { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; text-align: center; }
.stats strong { display: block; font-size: 2.2rem; color: var(--primary); }
.stats span { color: var(--muted); }

.cta {
  background: var(--primary-dark); color: #fff; text-align: center; border-radius: var(--radius);
  padding: 48px 24px;
}
.cta h2 { margin-bottom: 10px; }
.cta p { opacity: 0.9; margin-bottom: 22px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
select, input, textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }

.radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-row label {
  flex: 1; min-width: 140px; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  cursor: pointer; font-weight: 500; display: flex; gap: 8px; align-items: flex-start;
}
.radio-row input { width: auto; margin-top: 5px; }
.radio-row small { display: block; color: var(--muted); font-weight: 400; }

/* ---------- CBT / practice ---------- */
.hidden { display: none !important; }
.setup-card { max-width: 640px; margin: 0 auto; }
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.steps {
  display: flex; gap: 8px; list-style: none; counter-reset: step; margin-bottom: 22px; flex-wrap: wrap;
}
.steps li {
  flex: 1; min-width: 150px; counter-increment: step; background: #eef2ff; border-radius: 8px;
  padding: 10px 12px; font-size: 0.9rem; color: var(--primary-dark);
}
.steps li::before {
  content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--primary); color: #fff; font-size: 0.8rem; font-weight: 700; margin-right: 6px;
}
.exam-info {
  margin-top: 8px; padding: 10px 12px; background: #fffbeb; border-left: 4px solid var(--accent);
  border-radius: 6px; font-size: 0.9rem; color: #78350f;
}
.check-row {
  display: flex; gap: 10px; align-items: center; font-weight: 500; margin-bottom: 12px; cursor: pointer;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px;
}
.check-row input { width: auto; }
@media (max-width: 520px) { .setup-row { grid-template-columns: 1fr; } }

.cbt-top {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 20px;
}
.cbt-top .meta { font-weight: 600; }
.cbt-top .meta small { display: block; color: var(--muted); font-weight: 400; }
.timer {
  font-family: Consolas, monospace; font-size: 1.4rem; font-weight: 700;
  background: #eef2ff; color: var(--primary-dark); padding: 6px 14px; border-radius: 8px;
}
.timer.low { background: #fee2e2; color: var(--danger); }

.cbt-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .cbt-layout { grid-template-columns: 1fr; } }

.question-number { color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.question-text { font-size: 1.2rem; margin-bottom: 22px; }

.options { display: grid; gap: 12px; }
.option {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: #fff; border: 2px solid var(--border); border-radius: 10px; padding: 14px 16px;
  font-size: 1rem; cursor: pointer; font-family: inherit; color: var(--text);
}
.option:hover { border-color: var(--primary); }
.option .letter {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: #eef2ff;
  display: grid; place-items: center; font-weight: 700; color: var(--primary-dark);
}
.option.selected { border-color: var(--primary); background: #eff6ff; }
.option.selected .letter { background: var(--primary); color: #fff; }
.option.correct { border-color: var(--success); background: #f0fdf4; }
.option.correct .letter { background: var(--success); color: #fff; }
.option.wrong { border-color: var(--danger); background: #fef2f2; }
.option.wrong .letter { background: var(--danger); color: #fff; }
.option:disabled { cursor: default; }

.explanation {
  margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--accent);
  background: #fffbeb; border-radius: 6px;
}

.cbt-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.palette button {
  aspect-ratio: 1; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.palette button.answered { background: var(--primary); color: #fff; border-color: var(--primary); }
.palette button.current { outline: 3px solid var(--accent); }
.palette button.is-correct { background: var(--success); color: #fff; border-color: var(--success); }
.palette button.is-wrong { background: var(--danger); color: #fff; border-color: var(--danger); }
.legend { font-size: 0.85rem; color: var(--muted); }
.kbd-hint { font-size: 0.8rem; color: var(--muted); margin-top: 12px; }

/* Results */
.score-ring {
  width: 160px; height: 160px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  font-size: 2.2rem; font-weight: 800; color: var(--primary-dark);
}
.result-summary { text-align: center; }
.result-summary .grid { margin: 24px 0; }
.result-summary .card { padding: 18px; }
.result-summary .card strong { display: block; font-size: 1.6rem; color: var(--primary-dark); }
.review-item { margin-bottom: 18px; }
.review-item .q { font-weight: 600; margin-bottom: 8px; }
.review-item .ans { font-size: 0.95rem; }
.ok { color: var(--success); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { background: #eef2ff; color: var(--primary-dark); }

.bar { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; min-width: 120px; }
.bar > div { height: 100%; background: var(--primary); }

.empty { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 50px 0 24px; }
.site-footer h4 { color: #fff; margin-bottom: 12px; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 30px; padding-top: 18px; text-align: center; font-size: 0.9rem; }
