/* Amplitude Academy — interactive training-module framework (Brilliant-style: bite-size beats +
   check-for-understanding + progress). Delivery shell; CONTENT is Community's (CONTENT_SCHEMA.md).
   Reusable on the public Academy (website) and the authenticated dashboard Training. Brand tokens. */
:root { --ac-ease: var(--amp-ease-standard, cubic-bezier(0.2,0,0,1)); --ac-maxw: 760px; --ac-r: 14px;
  /* sans = brand body (UI/chrome/headers); serif = deliberate, for in-module READING content only */
  --ac-sans: var(--amp-font-body, system-ui, sans-serif);
  --ac-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Charter", Georgia, "Times New Roman", serif; }
* { box-sizing: border-box; }
/* Standalone Learn pages have no <body> font set → was falling back to Times. Pin brand sans.
   (Harmless inside the dashboard, whose <body> is already sans.) */
body { font-family: var(--ac-sans); }
.ac-wrap { max-width: var(--ac-maxw); margin: 0 auto; padding: 0 22px; }

/* ---- bar ---- */
.ac-bar { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 22px;
  border-bottom: 1px solid var(--amp-hairline); position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--amp-surface-raised) 86%, transparent); backdrop-filter: blur(10px); }
.ac-bar__home { display: inline-flex; align-items: center; }
.ac-bar__crumb { font-size: 0.9rem; color: var(--amp-ink-tertiary); }
.ac-bar__crumb a { color: var(--amp-ink-secondary); text-decoration: none; }
.ac-bar__crumb a:hover { color: var(--amp-ink); }

/* ---- preview banner (staged, pre-Quality-bless) ---- */
.ac-note { max-width: var(--ac-maxw); margin: 18px auto -6px; padding: 10px 14px; border-radius: 10px;
  background: var(--amp-status-info-tint, #e6edf9); color: var(--amp-status-info, #38598c);
  font-size: 0.84rem; border: 1px solid color-mix(in srgb, var(--amp-status-info, #38598c) 22%, transparent); }

/* ---- catalog ---- */
.ac-hero { padding: clamp(36px, 7vh, 72px) 0 8px; }
.ac-hero .eyebrow { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--amp-accent-strong, #506bb4); margin: 0 0 12px; }
.ac-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -0.02em; margin: 0 0 12px; font-weight: 700; }
.ac-hero p { font-size: 1.08rem; color: var(--amp-ink-secondary); margin: 0; max-width: 56ch; }
.ac-track { margin: 30px 0 0; }
.ac-track__h { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amp-ink-tertiary);
  margin: 0 0 12px; font-weight: 700; }
.ac-cards { display: grid; gap: 14px; }
.ac-card { display: block; text-align: left; background: var(--amp-surface-raised, #fff); border: 1px solid var(--amp-hairline);
  border-radius: var(--ac-r); padding: 20px 22px; cursor: pointer; color: inherit; text-decoration: none; font: inherit;
  transition: border-color 130ms var(--ac-ease), box-shadow 130ms var(--ac-ease), transform 130ms var(--ac-ease); }
.ac-card:hover { border-color: var(--amp-accent-soft, #aab8e0); box-shadow: 0 8px 24px rgba(40,52,80,0.07); transform: translateY(-1px); }
.ac-card__top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ac-card h3 { font-size: 1.12rem; font-weight: 650; margin: 0; letter-spacing: -0.01em; flex: 1; }
.ac-card p { margin: 0; color: var(--amp-ink-secondary); font-size: 0.95rem; }
.ac-card__meta { margin-top: 12px; display: flex; gap: 10px; align-items: center; font-size: 0.82rem; color: var(--amp-ink-tertiary); }
.ac-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; }
.ac-badge--ok { background: var(--amp-status-ok-tint, #e4f1ea); color: var(--amp-status-ok, #2f8f63); }
.ac-badge--review { background: var(--amp-surface-sunken, #e7ebf3); color: var(--amp-ink-secondary); }
.ac-badge--done { background: var(--amp-accent-tint, #e6ebf7); color: var(--amp-accent-strong, #506bb4); }
.ac-empty { color: var(--amp-ink-tertiary); padding: 28px 0; }

/* ---- module player ---- */
.ac-player { padding: 22px 0 72px; }
/* static (not sticky) so it's robust in both contexts — standalone page + inside the dashboard shell */
.ac-prog { background: var(--amp-surface-raised, #fff); padding: 4px 0 14px; }
.ac-prog__bar { height: 6px; border-radius: 999px; background: var(--amp-surface-sunken, #e7ebf3); overflow: hidden; }
.ac-prog__fill { height: 100%; background: var(--amp-accent, #6f86c9); border-radius: 999px; transition: width 280ms var(--ac-ease); }
.ac-prog__txt { margin: 8px 0 0; font-size: 0.8rem; color: var(--amp-ink-tertiary); }

.ac-step { animation: ac-in 240ms var(--ac-ease); }
@keyframes ac-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* In-module reading content uses the deliberate serif (editorial feel); chrome/UI stays sans. */
.ac-step h2 { font-family: var(--ac-serif); font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.01em; margin: 18px 0 16px; font-weight: 600; }
.ac-step__body { font-family: var(--ac-serif); font-size: 1.12rem; color: var(--amp-ink); line-height: 1.7; }
.ac-step__body p { margin: 0 0 14px; }
.ac-step__body strong { font-weight: 650; }
.ac-step__body ul { margin: 0 0 14px; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.ac-step__body li { display: flex; gap: 10px; align-items: flex-start; color: var(--amp-ink-secondary); }
.ac-step__body li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 8px;
  background: var(--amp-accent, #6f86c9); }

/* video lesson — responsive 16:9; supports mp4 (<video>) or YouTube/Vimeo (<iframe>) */
.ac-video { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 18px 0 6px; border-radius: var(--ac-r);
  overflow: hidden; background: var(--amp-surface-sunken, #e7ebf3); border: 1px solid var(--amp-hairline); }
.ac-video iframe, .ac-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.ac-video__ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px;
  color: var(--amp-ink-tertiary); text-align: center; padding: 16px; }
.ac-video__ph svg { width: 48px; height: 48px; opacity: 0.45; }
.ac-video__ph small { font-size: 0.82rem; opacity: 0.85; }

/* check (the prompt reads as content → serif; the option buttons stay sans for UI clarity) */
.ac-check__q { font-family: var(--ac-serif); font-size: 1.3rem; font-weight: 600; line-height: 1.4; margin: 18px 0 18px; }
.ac-opts { display: grid; gap: 10px; }
.ac-opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; font: inherit; cursor: pointer;
  background: var(--amp-surface-raised, #fff); border: 1.5px solid var(--amp-hairline); border-radius: 12px; padding: 15px 16px;
  color: var(--amp-ink); transition: border-color 120ms var(--ac-ease), background 120ms var(--ac-ease); }
.ac-opt:hover:not(:disabled) { border-color: var(--amp-accent-soft, #aab8e0); }
.ac-opt__mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--amp-hairline);
  display: grid; place-items: center; font-size: 0.8rem; color: #fff; }
.ac-opt[data-state="correct"] { border-color: var(--amp-status-ok, #2f8f63); background: var(--amp-status-ok-tint, #e4f1ea); }
.ac-opt[data-state="correct"] .ac-opt__mark { background: var(--amp-status-ok, #2f8f63); border-color: var(--amp-status-ok, #2f8f63); }
.ac-opt[data-state="wrong"] { border-color: var(--amp-status-danger, #c0473e); background: var(--amp-status-danger-tint, #f7e6e4); }
.ac-opt[data-state="wrong"] .ac-opt__mark { background: var(--amp-status-danger, #c0473e); border-color: var(--amp-status-danger, #c0473e); }
.ac-opt:disabled { cursor: default; }
.ac-feedback { margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; font-size: 0.95rem; line-height: 1.6;
  border: 1px solid var(--amp-hairline); background: var(--amp-surface, #f4f6fa); color: var(--amp-ink-secondary); }
.ac-feedback b { color: var(--amp-ink); }

/* nav buttons */
.ac-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; }
.ac-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px;
  border: 1px solid var(--amp-hairline); background: var(--amp-surface-raised, #fff); color: var(--amp-ink); border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; transition: background 120ms var(--ac-ease), transform 120ms var(--ac-ease); }
.ac-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ac-btn--primary { background: var(--amp-accent, #6f86c9); border-color: var(--amp-accent, #6f86c9); color: #fff;
  box-shadow: 0 6px 18px rgba(111,134,201,0.28); }
.ac-btn--primary:hover:not(:disabled) { background: var(--amp-accent-strong, #506bb4); border-color: var(--amp-accent-strong, #506bb4); }
.ac-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ac-btn--ghost { color: var(--amp-ink-secondary); }

/* completion */
.ac-done { text-align: center; padding: 30px 0; }
.ac-done__ring { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  background: var(--amp-status-ok-tint, #e4f1ea); color: var(--amp-status-ok, #2f8f63); }
.ac-done h2 { margin: 0 0 10px; }
.ac-done p { color: var(--amp-ink-secondary); margin: 0 0 8px; }
.ac-done__score { font-weight: 650; color: var(--amp-ink); }

.ac-foot { border-top: 1px solid var(--amp-hairline); padding: 28px 22px 40px; text-align: center; }
.ac-foot p { max-width: 720px; margin: 0 auto; font-size: 0.8rem; color: var(--amp-ink-tertiary); }
