/* CertiAI design system. Colors come only from theme tokens (themes.css). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

:root {
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --container: 1180px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --brand-gradient: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
html[lang="ar"] body { font-family: var(--font-ar); }

img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--fg-muted); }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.center { text-align: center; }
.gradient-text { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; }
.lead { font-size: 1.15rem; color: var(--fg-muted); max-width: 62ch; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -100px; background: var(--accent); color: var(--accent-fg); padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: 820px; }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-tight { padding-block: 40px; }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .layout-sidebar { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-3, .split { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .65rem 1.2rem; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.btn-gradient { background: var(--brand-gradient); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-outline { background: var(--bg-elevated); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-lg { min-height: 52px; padding: .85rem 1.6rem; font-size: 1.02rem; }
.btn-sm { min-height: 36px; padding: .4rem .85rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-social { justify-content: flex-start; background: var(--bg-elevated); border-color: var(--border); color: var(--fg); border-radius: var(--radius-sm); }
.btn-social svg { width: 20px; height: 20px; flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-weight: 800; font-size: 1.32rem; letter-spacing: -.02em; }
.brand img { width: 36px; height: 36px; }
.brand .ai { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-main { display: flex; gap: 4px; margin-inline-start: 12px; }
.nav-main a { color: var(--fg-muted); text-decoration: none; font-weight: 600; font-size: .94rem; padding: .5rem .75rem; border-radius: 999px; }
.nav-main a:hover, .nav-main a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; color: var(--fg); background: transparent; border: 1px solid transparent; text-decoration: none; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.badge-dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 230px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; z-index: 60; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; text-align: start; gap: 10px; padding: .55rem .75rem; border-radius: 8px; color: var(--fg); text-decoration: none; font: inherit; font-size: .93rem; background: none; border: 0; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-head { padding: .5rem .75rem .65rem; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand-gradient); color: #fff; font-weight: 800; font-size: .9rem; }
.mobile-nav { display: none; }
@media (max-width: 1080px) {
  .nav-main, .header-actions .hide-mobile { display: none; }
  .mobile-nav { display: block; }
}
.mobile-nav .menu-panel { position: fixed; inset-inline: 12px; top: 74px; max-height: calc(100vh - 90px); overflow: auto; }

/* Messages */
.messages { margin-top: 18px; display: grid; gap: 10px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elevated); }
.alert-success { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 9%, var(--bg-elevated)); }
.alert-error, .alert-danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--bg-elevated)); }
.alert-warning { border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 9%, var(--bg-elevated)); }
.alert-info { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }

/* Cards */
.card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-flat { box-shadow: none; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card h3 { margin-bottom: .35rem; }
.card-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.card-icon svg { width: 24px; height: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.1rem; }

/* Badges & pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: .22rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--fg-muted); border: 1px solid var(--border); }
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill-success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border-color: transparent; }
.pill-warning { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); border-color: transparent; }
.pill-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-color: transparent; }
.level-badge { display: inline-flex; align-items: center; gap: 7px; padding: .25rem .7rem .25rem .3rem; border-radius: 999px; font-size: .78rem; font-weight: 800; color: #fff; letter-spacing: .02em; }
.level-badge::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.35); box-shadow: inset 0 0 0 3px rgba(255,255,255,.55); }
.level-foundation { background: linear-gradient(120deg, #0f766e, #14b8a6); }
.level-practitioner { background: linear-gradient(120deg, #1d4ed8, #38bdf8); }
.level-professional { background: linear-gradient(120deg, #5b21b6, #8b5cf6); }
.level-expert { background: linear-gradient(120deg, #0f172a, #b7791f); }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(48px, 7vw, 96px); }
.hero::before { content: ""; position: absolute; inset: -30% -10% auto auto; width: 720px; height: 720px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 18%, transparent), transparent); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: auto auto -40% -15%; width: 620px; height: 620px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent); pointer-events: none; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { max-width: 15ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 22px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--fg-muted); font-size: .93rem; padding: 0; margin: 0; list-style: none; }
.hero-points li::before { content: "✓"; color: var(--success); font-weight: 800; margin-inline-end: 7px; }
.hero-visual { position: relative; }
.float-card { position: absolute; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; font-size: .85rem; }

/* Journey diagram */
.journey { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.journey li { position: relative; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 14px; text-align: center; }
.journey li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 10px; border-radius: 50%; background: var(--brand-gradient); color: #fff; font-weight: 800; font-size: .9rem; }
.journey li:not(:last-child)::after { content: ""; position: absolute; top: 34px; inset-inline-end: -10px; width: 10px; height: 2px; background: var(--border); }
.journey strong { display: block; font-size: .95rem; }
.journey span { font-size: .8rem; color: var(--fg-muted); }
@media (max-width: 1024px) { .journey { grid-template-columns: repeat(4, minmax(0, 1fr)); } .journey li::after { display: none; } }
@media (max-width: 560px) { .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Pillars (Assess / Learn / Practice / Build / Prove) */
.pillar { position: relative; }
.pillar .step-no { position: absolute; top: 18px; inset-inline-end: 20px; font-size: 2.6rem; font-weight: 800; color: var(--surface-2); line-height: 1; }

/* Stat tiles */
.stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-label { color: var(--fg-muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1.15; margin-top: 4px; }
.stat-sub { font-size: .85rem; color: var(--fg-muted); }

/* Progress */
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-gradient); }
.skill-bars { display: grid; gap: 14px; list-style: none; padding: 0; margin: 0; }
.skill-bar-head { display: flex; justify-content: space-between; font-size: .92rem; font-weight: 600; margin-bottom: 6px; }
.band-strong > span { background: var(--success); }
.band-good > span { background: var(--accent); }
.band-developing > span { background: var(--warning); }
.band-gap > span { background: var(--danger); }
.score-strong { color: var(--success); } .score-good { color: var(--accent); } .score-developing { color: var(--warning); } .score-gap { color: var(--danger); } .score-none { color: var(--fg-muted); }

/* Radar & ring */
.radar { width: 100%; max-width: 460px; display: block; margin-inline: auto; overflow: visible; }
.radar-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-spoke { stroke: var(--border); stroke-width: 1; }
.radar-area { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.radar-compare { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-dasharray: 5 5; }
.radar-dot { fill: var(--bg-elevated); stroke: var(--accent); stroke-width: 2.5; }
.radar-label { fill: var(--fg-muted); font-size: 13px; font-weight: 600; font-family: inherit; }
.radar-value { fill: var(--fg); font-weight: 800; font-size: 14px; }
.ring-track { stroke: var(--surface-2); }
.ring-value { stroke: var(--accent); transition: stroke-dashoffset .8s ease; }
.ring-text { fill: var(--fg); font-weight: 800; font-size: 28px; font-family: inherit; }

/* Steps checklist */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.check { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); color: transparent; font-weight: 800; font-size: .8rem; }
.done .check { background: var(--success); border-color: var(--success); color: #fff; }
.checklist .meta { margin-inline-start: auto; font-size: .85rem; color: var(--fg-muted); }

/* Tables (become cards on mobile) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .table-cards thead { display: none; }
  .table-cards tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .table-cards td { display: flex; justify-content: space-between; gap: 16px; border: 0; padding: 6px 16px; }
  .table-cards td::before { content: attr(data-label); font-weight: 700; color: var(--fg-muted); font-size: .82rem; }
}

/* Forms */
.form { display: grid; gap: 18px; }
.field label, .field legend { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.field .help { font-size: .84rem; color: var(--fg-muted); margin-top: 5px; }
.field .errorlist, .errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--danger); font-size: .87rem; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: .65rem .85rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--fg); font: inherit; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 2px 0 0; }
.check-field { display: flex; gap: 10px; align-items: flex-start; }
.check-field label { font-weight: 600; margin: 0; }
.field-invalid input, .field-invalid textarea, .field-invalid select { border-color: var(--danger); }
.divider { display: flex; align-items: center; gap: 14px; color: var(--fg-muted); font-size: .85rem; margin: 6px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-shell { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: var(--brand-gradient); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-aside h2 { color: #fff; }
.auth-aside p, .auth-aside li { color: rgba(255,255,255,.88); }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* Assessment taking */
.question { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.question + .question { margin-top: 16px; }
.question fieldset { border: 0; padding: 0; margin: 0; }
.question legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; line-height: 1.45; }
.scenario { background: var(--accent-soft); border-inline-start: 4px solid var(--accent); padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: .95rem; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 8px; cursor: pointer; background: var(--bg); }
.option:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option-correct { border-color: var(--success) !important; background: color-mix(in srgb, var(--success) 8%, var(--bg)) !important; }
.option-wrong { border-color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 7%, var(--bg)) !important; }
.timer { position: sticky; top: 80px; z-index: 5; display: inline-flex; gap: 8px; align-items: center; font-weight: 800; font-variant-numeric: tabular-nums; padding: 8px 14px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow); }
.timer.low { color: var(--danger); border-color: var(--danger); }
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* Lesson content */
.prose { font-size: 1.04rem; max-width: 72ch; }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-inline-start: 4px solid var(--accent); background: var(--accent-soft); border-radius: 8px; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.prose pre { background: var(--surface-2); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: start; }

/* Module list */
.module { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); overflow: hidden; }
.module + .module { margin-top: 14px; }
.module-head { padding: 18px 20px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.lesson-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.lesson-list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.lesson-list li:last-child { border-bottom: 0; }
.lesson-list a { color: var(--fg); text-decoration: none; font-weight: 600; }
.lesson-list a:hover { color: var(--accent); }
.lesson-list .done .check { background: var(--success); border-color: var(--success); color: #fff; }

/* Breadcrumbs */
.breadcrumbs { font-size: .87rem; color: var(--fg-muted); margin-bottom: 14px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .6; }
.breadcrumbs a { color: var(--fg-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

/* Page header */
.page-head { padding-block: 40px 28px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--bg)); }
.page-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: .3rem; }

/* Empty state */
.empty { text-align: center; padding: 44px 24px; border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.empty svg { width: 64px; height: 64px; color: var(--accent); opacity: .85; margin-bottom: 10px; }
.empty h3 { margin-bottom: .35rem; }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: start; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
@media (max-width: 1024px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } .span-3 { grid-column: span 6; } }
@media (max-width: 560px) { .span-3 { grid-column: span 12; } }
.readiness { display: flex; gap: 20px; align-items: center; }
.chart-box { position: relative; height: 260px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-plain > li:last-child { border-bottom: 0; }

/* Pricing */
.plan { display: flex; flex-direction: column; }
.plan.highlight { border: 2px solid var(--accent); position: relative; }
.plan .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li::before { content: "✓"; color: var(--success); font-weight: 800; margin-inline-end: 8px; }
.ribbon { position: absolute; top: -13px; inset-inline-start: 24px; background: var(--accent); color: var(--accent-fg); font-size: .75rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); padding: 0 18px; }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding-bottom: 16px; color: var(--fg-muted); }

/* Verification */
.verify-status { display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--radius); font-weight: 700; }
.verify-valid { background: color-mix(in srgb, var(--success) 12%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--success) 45%, transparent); }
.verify-invalid { background: color-mix(in srgb, var(--danger) 9%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.verify-status svg { width: 40px; height: 40px; flex: none; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; }
.dl dt { color: var(--fg-muted); font-weight: 600; font-size: .9rem; }
.dl dd { margin: 0; font-weight: 600; }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; } }

/* Certificate (web rendering; mirrors credentials/pdf.py) */
.cert-frame { container-type: inline-size; }
.cert-sheet { --c-primary: #0f766e; --c-accent: #14b8a6; --c-soft: #ccfbf1; --c-ink: #0f1b2a; --c-paper: #fff; --c-muted: #4a5b6d;
  position: relative; aspect-ratio: 297 / 210; width: 100%; background: var(--c-paper); color: var(--c-ink); border-radius: 6px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 27, 42, .18); font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
.cert-sheet.d-practitioner { --c-primary: #1d4ed8; --c-accent: #38bdf8; --c-soft: #dbeafe; }
.cert-sheet.d-professional { --c-primary: #5b21b6; --c-accent: #8b5cf6; --c-soft: #ede9fe; --c-paper: #fdfcff; --c-ink: #1e1b2e; }
.cert-sheet.d-expert { --c-primary: #b7791f; --c-accent: #f6c453; --c-soft: #3b3f58; --c-ink: #f8f5ec; --c-paper: #0f172a; --c-muted: #cbd5e1; }
.cert-deco { position: absolute; inset: 0; width: 100%; height: 100%; }
.cert-body { position: absolute; inset: 9% 32% 8% 8%; display: flex; flex-direction: column; }
.d-foundation .cert-body { inset-inline-start: 11%; }
.cert-logo { width: 19cqi; background: transparent; }
.d-expert .cert-logo { background: #f8fafc; padding: .6cqi .9cqi; border-radius: .6cqi; }
.cert-kicker { margin-top: 3cqi; font-size: 1.35cqi; font-weight: 800; letter-spacing: .2em; color: var(--c-primary); }
.d-expert .cert-kicker, .d-expert .cert-level { color: var(--c-accent); }
.cert-small { font-size: 1.45cqi; color: var(--c-muted); margin-top: 2cqi; }
.cert-name { font-size: 4.3cqi; font-weight: 800; line-height: 1.1; margin-top: 1.2cqi; padding-bottom: 1.2cqi; border-bottom: .2cqi solid var(--c-accent); align-self: flex-start; }
.cert-title { font-size: 2.6cqi; font-weight: 800; margin-top: 1.2cqi; line-height: 1.15; }
.cert-level { font-size: 1.45cqi; font-weight: 800; color: var(--c-primary); margin-top: .8cqi; }
.cert-skills { font-size: 1.15cqi; color: var(--c-muted); margin-top: 1.4cqi; }
.cert-details { margin-top: auto; display: flex; gap: 4cqi; }
.cert-details small { display: block; font-size: .95cqi; font-weight: 800; letter-spacing: .12em; color: var(--c-muted); }
.cert-details strong { font-size: 1.3cqi; }
.cert-sign { margin-top: 2.4cqi; font-size: 1cqi; color: var(--c-muted); }
.cert-sign .sig { font-family: "Times New Roman", serif; font-style: italic; font-size: 2cqi; color: var(--c-ink); border-bottom: .12cqi solid var(--c-muted); min-width: 22cqi; display: inline-block; min-height: 2.6cqi; }
.cert-side { position: absolute; inset-inline-end: 8%; top: 12%; bottom: 9%; width: 17%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.cert-seal { width: 100%; }
.cert-qr { width: 70%; background: #fff; border-radius: .5cqi; padding: .3cqi; }
.cert-qr svg { width: 100%; height: auto; display: block; }
.cert-verify { font-size: .95cqi; text-align: center; color: var(--c-muted); }
.cert-verify b { display: block; color: var(--c-ink); word-break: break-all; }
.cert-revoked { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9cqi; font-weight: 900; color: rgba(220, 38, 38, .75); transform: rotate(-18deg); pointer-events: none; }
html[dir="rtl"] .cert-sheet { direction: ltr; }

/* Passport */
.passport-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.passport-head .avatar { width: 72px; height: 72px; font-size: 1.6rem; }

/* Footer */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); background: var(--bg-elevated); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-block: 48px 32px; }
.footer-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--fg); text-decoration: none; font-size: .93rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-prefs { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; padding-block: 20px; border-top: 1px solid var(--border); }
.footer-prefs label { display: block; font-size: .78rem; font-weight: 700; color: var(--fg-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; }
.footer-prefs select { min-height: 40px; width: auto; min-width: 170px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw-ocean { background: linear-gradient(135deg, #2563eb, #f7fafc); } .sw-midnight { background: linear-gradient(135deg, #818cf8, #0b0f19); }
.sw-sunset { background: linear-gradient(135deg, #c2410c, #fff8f2); } .sw-graphite { background: linear-gradient(135deg, #94a3b8, #161718); }
.sw-evergreen { background: linear-gradient(135deg, #15803d, #f5faf6); } .sw-orchid { background: linear-gradient(135deg, #a21caf, #fbf7fc); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 20px 28px; border-top: 1px solid var(--border); font-size: .88rem; color: var(--fg-muted); }
.ams-logo { height: 40px; width: auto; background: #fff; border-radius: 6px; padding: 3px 6px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Utilities */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }
.nowrap { white-space: nowrap; }
.fade-up { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media print {
  .site-header, .site-footer, .no-print, .messages { display: none !important; }
  body { background: #fff; }
  .cert-sheet { box-shadow: none; border-radius: 0; }
  @page { size: A4 landscape; margin: 0; }
}

/* allauth pages (password reset, email management, etc.) */
.allauth-page main { max-width: 580px; margin-inline: auto; padding: 36px 20px 0; }
.allauth-page main > .container { padding: 0; }
.allauth-page main h1 { margin-bottom: .6rem; }
.allauth-page main form { margin-top: 18px; }
.stack > .btn + .btn { margin-top: 10px; }
.auth-full main { max-width: none; padding: 0; }
.auth-full .site-footer { margin-top: 0; }
@media (max-width: 640px) { .hero-visual .float-card { inset-inline: 8px auto !important; bottom: -18px !important; } .hero-visual .float-card + .float-card { inset-inline: auto 8px !important; } }
/* Charts and certificate artwork keep left-to-right geometry in RTL languages. */
.radar, .ring, .chart-box { direction: ltr; }
html[dir="rtl"] .icon-flip, html[dir="rtl"] .btn > svg:last-child { transform: scaleX(-1); }
