/* CertiApto site styles. System fonts only: no third-party font requests (GDPR). */

:root {
  --ink: #14202b;
  --ink-soft: #4a5866;
  --line: #dde3e8;
  --paper: #ffffff;
  --wash: #f4f7f5;
  --brand: #13795b;
  --brand-dark: #0d5a43;
  --brand-wash: #e3f2ec;
  --accent: #f2b33d;
  --danger: #b3261e;
  --danger-wash: #fbe9e7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 32, 43, .06), 0 4px 16px rgba(20, 32, 43, .06);
  --max: 1080px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", sans-serif;
  color: var(--ink);
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-size: 17px; }
img { max-width: 100%; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 .6em; }
h3, h2.h3 { font-size: 1.15rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* Preview banner */
.preview-banner { background: #3b2f00; color: #fff3c4; font-size: .88rem; padding: 8px 0; text-align: center; }
.preview-banner strong { color: #fff; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: .95rem; white-space: nowrap; }
.nav a:hover { color: var(--brand); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }

/* Buttons */
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 12px 24px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand-dark); box-shadow: inset 0 0 0 2px var(--brand); }
.btn-ghost:hover { background: var(--brand-wash); }
.btn-small { padding: 8px 16px; font-size: .92rem; }
.btn[disabled] { background: #9aa6b0; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--brand-wash), var(--paper)); padding: 64px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.hero .lead { font-size: 1.2rem; color: var(--ink-soft); }
.eyebrow { display: inline-block; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dark); margin-bottom: 12px; }
.price-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; border: 1px solid var(--line); }
.price-card .price { font-size: 3rem; font-weight: 800; line-height: 1; }
.price-card .price small { font-size: 1rem; font-weight: 500; color: var(--ink-soft); }
.checklist { list-style: none; padding: 0; margin: 16px 0 20px; }
.checklist li { padding-inline-start: 28px; position: relative; margin-bottom: 8px; }
.checklist li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--brand); font-weight: 800; }

/* Sections */
.section { padding: 64px 0; }
.section-wash { background: var(--wash); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 12px; }
.langs { display: flex; flex-wrap: wrap; gap: 10px; }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--paper); font-size: .95rem; }
.lang.on { border-color: var(--brand); background: var(--brand-wash); font-weight: 600; color: var(--brand-dark); text-decoration: none; }
a.lang.on:hover { background: var(--paper); }
.lang-switch { margin-top: 14px; }
.lang .soon { font-size: .75rem; color: var(--ink-soft); margin-inline-start: 4px; }
.note { border-inline-start: 4px solid var(--accent); background: #fff8e6; padding: 16px 20px; border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); }

/* Module list */
.module-list { list-style: none; padding: 0; margin: 0; counter-reset: m; }
.module-list li { counter-increment: m; border-bottom: 1px solid var(--line); }
.module-list a { display: flex; gap: 16px; align-items: center; padding: 14px 4px; text-decoration: none; color: var(--ink); }
.module-list a::before { content: counter(m); width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--brand-wash); color: var(--brand-dark); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.module-list a:hover { color: var(--brand); }

/* Course layout */
.course-head { padding: 40px 0 24px; border-bottom: 1px solid var(--line); }
.facts { display: flex; gap: 24px; flex-wrap: wrap; color: var(--ink-soft); font-size: .95rem; }
.facts strong { color: var(--ink); }
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 48px; padding: 40px 0 64px; }
.sidebar { position: sticky; top: 88px; align-self: start; font-size: .92rem; }
.sidebar ol { padding-inline-start: 20px; margin: 0 0 20px; }
.sidebar li { margin-bottom: 6px; }
.sidebar .current { font-weight: 700; color: var(--brand-dark); }
.prose { max-width: 700px; }
.prose h2 { margin-top: 1.6em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; }
.prose th { background: var(--wash); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Test */
.question { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 0 0 16px; }
.question legend { font-weight: 600; float: inline-start; width: 100%; padding: 0; margin-bottom: 8px; }
.question legend + * { clear: both; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.option:hover { background: var(--wash); }
.option input { margin-top: 5px; accent-color: var(--brand); }
.progress { position: sticky; top: 64px; background: var(--paper); padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; z-index: 5; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }

/* Result */
.result-hero { text-align: center; padding: 48px 0 32px; }
.score { font-size: 4rem; font-weight: 800; line-height: 1; }
.badge { display: inline-block; padding: 6px 16px; border-radius: 999px; font-weight: 700; margin-bottom: 16px; }
.badge-pass { background: var(--brand-wash); color: var(--brand-dark); }
.badge-fail { background: var(--danger-wash); color: var(--danger); }
.review-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.review-item .ok { color: var(--brand-dark); font-weight: 700; }
.review-item .ko { color: var(--danger); font-weight: 700; }

/* Forms */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-row input[type=text], .form-row input[type=email] { width: 100%; padding: 12px 14px; font: inherit; border: 1px solid #b9c3cc; border-radius: 8px; }
.form-row .help { font-size: .88rem; color: var(--ink-soft); margin-top: 4px; }
.waiver { display: flex; gap: 12px; align-items: flex-start; background: var(--wash); padding: 16px; border-radius: 8px; font-size: .93rem; }
.waiver input { margin-top: 4px; accent-color: var(--brand); }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checkout-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
.summary-total { font-weight: 800; font-size: 1.2rem; border-bottom: 0; }

/* Certificate */
.cert { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 1.414 / 1; padding: 5%; position: relative; font-family: Georgia, "Times New Roman", serif; display: flex; flex-direction: column; }
.cert-border { position: absolute; inset: 14px; border: 2px solid var(--brand); pointer-events: none; }
.cert-head { display: flex; justify-content: space-between; align-items: flex-start; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.cert .cert-title { font-weight: 700; line-height: 1.2; font-size: clamp(1.1rem, 3vw, 2rem); text-align: center; margin: 4% 0 1%; letter-spacing: .04em; text-transform: uppercase; }
.cert .name { font-size: clamp(1.2rem, 3.4vw, 2.2rem); text-align: center; font-style: italic; margin: 2% 0; }
.cert .body { text-align: center; font-size: clamp(.7rem, 1.5vw, 1rem); }
.cert-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; font-size: clamp(.6rem, 1.2vw, .85rem); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.qr { width: clamp(56px, 11vw, 110px); aspect-ratio: 1; background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 20% 20%; border: 4px solid #fff; outline: 1px solid var(--line); }
.watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: clamp(2rem, 9vw, 6rem); color: rgba(19, 121, 91, .08); font-weight: 800; font-family: sans-serif; pointer-events: none; }

/* Verify */
.verify-card { max-width: 560px; margin: 48px auto; }
.verify-card dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; }
.verify-card dt { color: var(--ink-soft); }
.verify-card dd { margin: 0; font-weight: 600; }
.status { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 16px; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 12px 0 0; color: var(--ink-soft); }

/* Footer */
.site-footer { background: var(--ink); color: #c8d1d9; padding: 48px 0 32px; font-size: .92rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .fine { border-top: 1px solid #2c3a47; padding-top: 20px; color: #8d9aa6; }

@media (max-width: 820px) {
  .hero .wrap, .grid-3, .grid-2, .checkout-grid, .layout, .site-footer .cols { grid-template-columns: 1fr; }
  .site-header .wrap, .nav { flex-wrap: nowrap; }
  .hero { padding: 40px 0 32px; }
  .sidebar { position: static; }
  .section { padding: 44px 0; }
  .nav { gap: 14px; }
  .nav .hide-sm { display: none; }
}
@media (max-width: 480px) {
  /* Long translations ("Почати безкоштовно") must not push the header past a phone's width. */
  .nav { gap: 10px; }
  .nav a { font-size: .88rem; }
  .nav a.btn-small { white-space: normal; text-align: center; line-height: 1.2; }
  .prose, .sidebar { overflow-wrap: anywhere; }
  .layout > * { min-width: 0; }
  .prose table { display: block; overflow-x: auto; }
}
.form-error { color: var(--danger); font-size: .9rem; margin-top: 4px; }

/* Region and sector index */
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.region-link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.region-link:hover { border-color: var(--brand); }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Right-to-left (Arabic). Layout uses logical properties above; this covers the rest.
   Latin chunks inside Arabic text (RD 1021/2022, 63 °C, codes) keep their own direction. */
[dir="rtl"] body { font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, system-ui, sans-serif; }
[dir="rtl"] .prose, [dir="rtl"] .question { line-height: 1.8; }
[dir="rtl"] .logo, [dir="rtl"] .score, [dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
.read-mark { color: var(--brand); font-weight: 700; margin-inline-start: 6px; }
.region-section { padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }

/* Pay-after-pass strip (operator 2026-11-24: make it unmistakable for young users) */
.payflow { list-style: none; margin: 20px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.payflow li { display: flex; gap: 10px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: .95rem; line-height: 1.3; }
.payflow .pf-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-wash); color: var(--brand-dark); font-weight: 700; }
.payflow .pf-tag { display: inline-block; background: var(--brand-wash); color: var(--brand-dark); border-radius: 999px; padding: 1px 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.payflow .pf-pay { border-color: var(--brand); border-width: 2px; }
.payflow .pf-pay .pf-n { background: var(--brand); color: #fff; }
.payflow .is-here { box-shadow: 0 0 0 3px var(--brand-wash); }
.payflow-note { font-weight: 600; color: var(--brand-dark); margin: 0 0 16px; }
@media (max-width: 820px) { .payflow { grid-template-columns: 1fr; } }
.payflow .pf-sub { display: block; font-size: .82rem; color: var(--ink-soft); }
