/* ═══════════════════════════════════════════════════════════════
   OmniaCoin Crypto Academy — Premium CSS v5.0
   Glassmorphism · Tier System · Wide Layout · Udemy Viewer
   Three tiers: Free (2) · Token-Gated (3) · Premium (5)
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --ac-bg:      #060a10;
  --ac-bg2:     #0b1018;
  --ac-bg3:     #0e1420;
  --ac-card:    rgba(11, 17, 27, 0.90);
  --ac-glass:   rgba(10, 15, 25, 0.72);
  --ac-glass2:  rgba(6,  10, 16, 0.88);

  /* Brand colors */
  --ac-g:       #00ff88;
  --ac-gd:      rgba(0, 255, 136, 0.10);
  --ac-g2:      #00dc9b;
  --ac-r:       #ff4757;
  --ac-b:       #3b82f6;
  --ac-p:       #a855f7;
  --ac-pd:      rgba(168, 85, 247, 0.10);
  --ac-cy:      #06b6d4;
  --ac-o:       #f59e0b;
  --ac-od:      rgba(245, 158, 11, 0.10);

  /* Text */
  --ac-t:       #e8edf2;
  --ac-ts:      #8b95a5;
  --ac-tm:      #4a5568;

  /* Borders */
  --ac-br:      rgba(255, 255, 255, 0.06);
  --ac-br2:     rgba(255, 255, 255, 0.12);

  /* Layout */
  --ac-radius:  16px;
  --ac-radius-sm: 10px;
  --ac-sidebar-w: 320px;
  --ac-topbar-h:  60px;
  --ac-max-w:    1380px;

  /* Fonts */
  --ac-fd:  'Rajdhani', sans-serif;
  --ac-fb:  'Outfit', sans-serif;
  --ac-fm:  'JetBrains Mono', monospace;

  /* Tier colors */
  --tier-free-c:   #00ff88;
  --tier-free-bg:  rgba(0, 255, 136, 0.06);
  --tier-free-br:  rgba(0, 255, 136, 0.18);

  --tier-token-c:  #a855f7;
  --tier-token-bg: rgba(168, 85, 247, 0.06);
  --tier-token-br: rgba(168, 85, 247, 0.22);

  --tier-paid-c:   #f59e0b;
  --tier-paid-bg:  rgba(245, 158, 11, 0.06);
  --tier-paid-br:  rgba(245, 158, 11, 0.22);
}

/* ─── Global base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

#academy-root {
  font-family: var(--ac-fb);
  color: var(--ac-t);
  min-height: 100vh;
}

/* Scrollbar premium */
#academy-root ::-webkit-scrollbar        { width: 5px; height: 5px; }
#academy-root ::-webkit-scrollbar-track  { background: transparent; }
#academy-root ::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.10); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */

.ac-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 40px 24px 36px;
}

/* Multi-layer ambient light */
.ac-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 50% -60px,  rgba(0,255,136,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 20% 80%,    rgba(59,130,246,0.05) 0%, transparent 50%),
    radial-gradient(ellipse 600px 400px at 80% 80%,    rgba(168,85,247,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid overlay */
.ac-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 75%);
}

.ac-hero > * { position: relative; z-index: 1; }

/* Academy logo / badge */
.ac-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ac-fm);
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ac-g);
  background: rgba(0,255,136,0.06);
  border: 1px solid rgba(0,255,136,0.22);
  padding: 9px 24px;
  border-radius: 32px;
  margin-bottom: 12px;
  backdrop-filter: blur(12px);
  animation: ac-fadeInUp 0.5s ease-out;
}
.ac-hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ac-g);
  box-shadow: 0 0 8px var(--ac-g);
  animation: ac-blink 2s ease-in-out infinite;
}

/* OC logo coin in hero */
.ac-hero-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  animation: ac-fadeInUp 0.5s ease-out 0.04s both;
}

.ac-hero h1 {
  font-family: var(--ac-fd);
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1.08;
  margin-bottom: 12px;
  animation: ac-fadeInUp 0.5s ease-out 0.08s both;
}
.ac-hero h1 .ac-accent {
  background: linear-gradient(135deg, var(--ac-g), #00b4d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(0,255,136,0.22));
}

.ac-subtitle {
  font-size: 17px;
  color: var(--ac-ts);
  max-width: 620px;
  margin: 0 auto 20px;
  line-height: 1.8;
  animation: ac-fadeInUp 0.5s ease-out 0.14s both;
}

/* Stats row */
.ac-hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  max-width: 700px;
  margin: 20px auto 0;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--ac-br);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  overflow: hidden;
  animation: ac-fadeInUp 0.5s ease-out 0.20s both;
}
.ac-hero-stat {
  flex: 1;
  min-width: 100px;
  padding: 24px 20px;
  position: relative;
  text-align: center;
}
.ac-hero-stat + .ac-hero-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: var(--ac-br);
}
.ac-hero-stat-num {
  font-family: var(--ac-fd);
  font-size: 30px;
  font-weight: 800;
  color: var(--ac-g);
  line-height: 1;
  margin-bottom: 6px;
}
.ac-hero-stat-label {
  font-family: var(--ac-fm);
  font-size: 9.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ac-ts);
}

/* ═══════════════════════════════════════════════════════════════
   CATALOG WRAPPER & LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.ac-catalog {
  max-width: var(--ac-max-w);
  margin: 0 auto;
  padding: 0 32px 80px;
}

.ac-catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ac-br);
  flex-wrap: wrap;
}
.ac-catalog-header h2 {
  font-family: var(--ac-fd);
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}
.ac-catalog-progress {
  font-family: var(--ac-fm);
  font-size: 11px;
  color: var(--ac-ts);
  background: rgba(0,255,136,0.05);
  border: 1px solid rgba(0,255,136,0.14);
  padding: 8px 18px;
  border-radius: 30px;
}

/* ═══════════════════════════════════════════════════════════════
   TIER SECTIONS
   ═══════════════════════════════════════════════════════════════ */

.ac-tier-section {
  margin-bottom: 72px;
  position: relative;
}

/* Tier divider line */
.ac-tier-section + .ac-tier-section::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ac-br), transparent);
  margin-bottom: 72px;
}

/* Tier header */
.ac-tier-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.ac-tier-header-text { flex: 1; min-width: 200px; }
.ac-tier-header-text h2 {
  font-family: var(--ac-fd);
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}
.ac-tier-header-text p {
  font-size: 14px;
  color: var(--ac-ts);
  margin: 0;
  line-height: 1.65;
  max-width: 540px;
}

/* Badge + pill grouped container */
.ac-tier-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Tier badge */
.ac-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ac-fm);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 30px;
  flex-shrink: 0;
}
.ac-tier-badge-free {
  color: var(--tier-free-c);
  background: var(--tier-free-bg);
  border: 1px solid var(--tier-free-br);
}
.ac-tier-badge-token {
  color: var(--tier-token-c);
  background: var(--tier-token-bg);
  border: 1px solid var(--tier-token-br);
}
.ac-tier-badge-paid {
  color: var(--tier-paid-c);
  background: var(--tier-paid-bg);
  border: 1px solid var(--tier-paid-br);
}

/* Tier reward info pill */
.ac-tier-reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ac-fm);
  font-size: 11px;
  color: var(--ac-ts);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--ac-br);
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.ac-tier-reward-pill strong { color: var(--ac-t); }
.ac-tier-reward-pill .oc-coin { pointer-events: none; vertical-align: middle; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   COURSE GRID
   ═══════════════════════════════════════════════════════════════ */

/* Generic grid - used as fallback */
.ac-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
}

/* Tier-specific grids */
.ac-tier-free .ac-courses-grid {
  grid-template-columns: repeat(2, 1fr);
}
.ac-tier-token .ac-courses-grid {
  grid-template-columns: repeat(3, 1fr);
}
.ac-tier-paid .ac-courses-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ═══════════════════════════════════════════════════════════════
   COURSE CARD — Premium Glassmorphism
   ═══════════════════════════════════════════════════════════════ */

.ac-course-card {
  position: relative;
  background: var(--ac-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--ac-br);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.28s ease,
              border-color 0.28s ease;
  display: flex;
  flex-direction: column;
  animation: ac-fadeInUp 0.45s ease-out both;
  min-height: 260px;
}

/* Top accent stripe using card color */
.ac-course-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--card-accent, var(--ac-g)), transparent);
  z-index: 2;
  opacity: 0.8;
  transition: opacity 0.3s;
}

/* Ambient glow from card accent color */
.ac-course-card::after {
  content: '';
  position: absolute;
  top: -80px; left: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, color-mix(in srgb, var(--card-accent, #00ff88) 40%, transparent), transparent 65%);
  pointer-events: none;
  opacity: 0.06;
  z-index: 0;
  transition: opacity 0.3s;
}

.ac-course-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.40),
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 40px color-mix(in srgb, var(--card-accent, #00ff88) 12%, transparent);
}
.ac-course-card:hover::before { opacity: 1; }
.ac-course-card:hover::after  { opacity: 0.12; }

/* Card content area */
.ac-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 26px 16px;
  position: relative;
  z-index: 1;
}

.ac-card-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--card-accent, #00ff88) 50%, transparent));
}

.ac-card-info {
  flex: 1;
  min-width: 0;
}
.ac-card-info h3 {
  font-family: var(--ac-fd);
  font-size: 19px;
  font-weight: 700;
  color: var(--ac-t);
  margin: 0 0 6px;
  line-height: 1.3;
}
.ac-card-meta {
  font-family: var(--ac-fm);
  font-size: 11px;
  color: var(--ac-tm);
  letter-spacing: 0.3px;
}

.ac-card-desc {
  font-size: 15px;
  color: var(--ac-ts);
  line-height: 1.75;
  margin: 0;
  padding: 0 26px 18px;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Card footer */
.ac-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 26px;
  border-top: 1px solid var(--ac-br);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.ac-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-card-tag {
  font-family: var(--ac-fm);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  color: var(--ac-tm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: color 0.2s, border-color 0.2s;
}
.ac-course-card:hover .ac-card-tag {
  color: var(--ac-ts);
  border-color: rgba(255,255,255,0.09);
}

.ac-card-reward {
  font-family: var(--ac-fm);
  font-size: 12px;
  font-weight: 700;
  color: var(--ac-g);
  white-space: nowrap;
  background: rgba(0,255,136,0.06);
  border: 1px solid rgba(0,255,136,0.16);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Progress bar */
.ac-card-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.ac-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--card-accent, var(--ac-g)), var(--ac-cy));
  transition: width 0.6s ease;
}

/* ── Card States ────────────────────────────────────────────── */

/* Completed state */
.ac-course-card.completed {
  border-color: rgba(0,255,136,0.16);
  background: rgba(0,255,136,0.02);
}
.ac-course-card.completed::before {
  background: linear-gradient(90deg, var(--ac-g), transparent);
  opacity: 1;
}
.ac-course-card.completed .ac-card-info h3::after {
  content: ' ✓';
  color: var(--ac-g);
  font-size: 14px;
}

/* Locked state */
.ac-course-card.locked {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.3);
}
.ac-course-card.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--ac-br);
}

/* Lock overlay icon */
.ac-lock-overlay {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 18px;
  z-index: 5;
  opacity: 0.5;
}

/* Token-gated card */
.ac-course-card.token-gated .ac-card-reward {
  color: var(--ac-p);
  background: rgba(168,85,247,0.06);
  border-color: rgba(168,85,247,0.18);
}
.ac-course-card.token-gated::before {
  background: linear-gradient(90deg, var(--ac-p), transparent);
}

/* Paid card */
.ac-course-card.paid-course .ac-card-reward {
  color: var(--ac-o);
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.18);
}

/* Token-gate info banner on card */
.ac-card-gate-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 26px 16px;
  padding: 10px 14px;
  background: rgba(168,85,247,0.06);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 10px;
  font-family: var(--ac-fm);
  font-size: 10px;
  color: var(--ac-p);
  position: relative;
  z-index: 1;
}

/* Card price for paid courses */
.ac-card-price {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px 16px;
  position: relative;
  z-index: 1;
}
.ac-price-tokens {
  font-family: var(--ac-fm);
  font-size: 15px;
  font-weight: 700;
  color: var(--ac-o);
}
.ac-price-eur {
  font-family: var(--ac-fm);
  font-size: 11px;
  color: var(--ac-ts);
}

/* Tier-colored reward chips */
.ac-reward-tokens {
  font-family: var(--ac-fm);
  font-size: 10px;
  color: var(--ac-g);
  background: rgba(0,255,136,0.06);
  border: 1px solid rgba(0,255,136,0.14);
  padding: 3px 10px;
  border-radius: 12px;
}
.ac-reward-done {
  font-family: var(--ac-fm);
  font-size: 10px;
  color: var(--ac-g);
}
.ac-requires-package {
  font-family: var(--ac-fm);
  font-size: 9px;
  color: var(--ac-p);
  background: rgba(168,85,247,0.07);
  border: 1px solid rgba(168,85,247,0.18);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Counter animation */
.ac-counter-bump { animation: ac-bump 0.4s ease; }

/* ═══════════════════════════════════════════════════════════════
   PAID TIER — AMBER REDESIGN (Premium Coming Soon)
   ═══════════════════════════════════════════════════════════════ */

/* Preview grid of future paid courses */
.ac-paid-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.ac-paid-preview-card {
  background: rgba(245,158,11,0.05);
  border: 1px solid rgba(245,158,11,0.22);
  border-radius: 16px;
  padding: 20px 14px;
  text-align: center;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.ac-paid-preview-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(245,158,11,0.0), rgba(245,158,11,0.7), rgba(245,158,11,0.0));
}
.ac-paid-preview-card:hover {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.42);
  transform: translateY(-2px);
}
.ac-paid-preview-icon {
  font-size: 28px;
  margin-bottom: 10px;
  line-height: 1;
}
.ac-paid-preview-title {
  font-family: var(--ac-fd);
  font-size: 13px;
  font-weight: 600;
  color: #e8edf2;
  margin-bottom: 6px;
  line-height: 1.3;
}
.ac-paid-preview-sub {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
  margin-bottom: 12px;
}
.ac-paid-preview-lock {
  font-family: var(--ac-fm);
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(245,158,11,0.7);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.18);
  border-radius: 20px;
  padding: 4px 10px;
  display: inline-block;
}
.ac-paid-cta-bar {
  margin-top: 20px;
  text-align: center;
  padding: 16px;
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 12px;
}
.ac-paid-cta-label {
  font-family: var(--ac-fm);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(245,158,11,0.8);
  text-transform: uppercase;
}
.ac-pill-amber {
  background: rgba(245,158,11,0.12) !important;
  border-color: rgba(245,158,11,0.28) !important;
  color: #f59e0b !important;
}

/* Legacy — kept for backward compat (no longer rendered) */
.ac-tier-paid-teaser { display: none; }
.ac-coming-date-pill {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--ac-fm);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ac-o);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.24);
  padding: 8px 20px;
  border-radius: 20px;
}


/* ─── Card banner image ─────────────────────────────────── */
img.ac-card-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}
/* ═══════════════════════════════════════════════════════════════
   AUTHOR SECTION
   ═══════════════════════════════════════════════════════════════ */

.ac-author-section { padding: 0 0 56px; }
.ac-author-card {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--ac-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--ac-br);
  border-radius: var(--ac-radius);
  padding: 28px 32px;
  max-width: 680px;
  margin: 0 auto;
  transition: border-color 0.3s;
}
.ac-author-card:hover { border-color: var(--ac-br2); }
.ac-author-avatar {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ac-gd);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,255,136,0.2);
  box-shadow: 0 0 24px rgba(0,255,136,0.08);
}
.ac-author-avatar .oc-coin { position:relative !important; width:60px !important; height:60px !important; }
.ac-author-info { flex: 1; min-width: 0; }
.ac-author-label {
  font-family: var(--ac-fm);
  font-size: 9px;
  color: var(--ac-tm);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.ac-author-name {
  font-family: var(--ac-fd);
  font-size: 22px;
  font-weight: 800;
  color: var(--ac-g);
  margin: 0 0 8px;
  letter-spacing: 1px;
}
.ac-author-bio {
  font-size: 13px;
  color: var(--ac-ts);
  line-height: 1.6;
  margin: 0 0 12px;
}
.ac-author-stats { display:flex; gap:20px; flex-wrap:wrap; }
.ac-author-stats span { font-family:var(--ac-fm); font-size:10px; color:var(--ac-ts); }

/* ═══════════════════════════════════════════════════════════════
   VIEWER — Udemy Full-Screen Style
   ═══════════════════════════════════════════════════════════════ */

.ac-viewer {
  display: grid;
  grid-template-rows: var(--ac-topbar-h) 1fr;
  grid-template-columns: var(--ac-sidebar-w) 1fr;
  grid-template-areas:
    "nav   nav"
    "side  main";
  min-height: calc(100vh - 64px);
  background: var(--ac-bg);
}

/* ── Viewer top nav bar ──────────────────────────────────────── */
.ac-viewer-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: var(--ac-glass2);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--ac-br);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ac-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ac-fm);
  font-size: 11px;
  color: var(--ac-ts);
  padding: 8px 16px;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ac-br);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.ac-back-btn:hover {
  color: var(--ac-t);
  background: rgba(255,255,255,0.07);
  border-color: var(--ac-br2);
}

.ac-viewer-title {
  font-family: var(--ac-fd);
  font-size: 16px;
  font-weight: 600;
  color: var(--ac-t);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress mini indicator */
.ac-viewer-progress-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ac-viewer-progress-bar-mini {
  width: 140px; height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ac-viewer-progress-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--ac-g), #00b4d8);
  transition: width 0.5s ease;
}
.ac-viewer-progress-mini span {
  font-family: var(--ac-fm);
  font-size: 11px;
  color: var(--ac-g);
  white-space: nowrap;
}

/* Sidebar toggle button */
.ac-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ac-br);
  color: var(--ac-ts);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.ac-sidebar-toggle:hover { color: var(--ac-t); border-color: var(--ac-br2); }

/* ── Sidebar ─────────────────────────────────────────────────── */
.ac-lesson-sidebar {
  grid-area: side;
  position: sticky;
  top: var(--ac-topbar-h);
  height: calc(100vh - 64px - var(--ac-topbar-h));
  overflow-y: auto;
  background: var(--ac-glass2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--ac-br);
  display: flex;
  flex-direction: column;
  transition: width 0.28s ease;
}

.ac-sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--ac-br);
  flex-shrink: 0;
}
.ac-sidebar-course-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ac-tier-badge-sm {
  font-family: var(--ac-fm);
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 8px;
}
.ac-sidebar-difficulty  { font-family:var(--ac-fm); font-size:10px; color:var(--ac-ts); }
.ac-sidebar-duration    { font-family:var(--ac-fm); font-size:10px; color:var(--ac-ts); }
.ac-sidebar-duration::before { content: '·'; margin-right: 6px; opacity: 0.4; }
.ac-sidebar-social      { font-family:var(--ac-fm); font-size:10px; color:var(--ac-ts); margin-bottom:10px; }
.ac-sidebar-progress    { }
.ac-sidebar-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.ac-sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ac-g), #00b4d8);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.ac-sidebar-progress span { font-family:var(--ac-fm); font-size:10px; color:var(--ac-ts); }
.ac-sidebar-title {
  font-family: var(--ac-fm);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ac-tm);
  padding: 14px 18px 8px;
  flex-shrink: 0;
}

/* Lesson list */
.ac-lesson-list { list-style: none; padding: 0; margin: 0; flex: 1; }

.ac-lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  cursor: pointer;
  transition: background 0.18s;
  font-size: 12.5px;
  color: var(--ac-ts);
  border-bottom: 1px solid rgba(255,255,255,0.025);
  position: relative;
}
.ac-lesson-item:hover { background: rgba(255,255,255,0.03); color: var(--ac-t); }

.ac-lesson-item.active {
  background: rgba(0,255,136,0.05);
  color: var(--ac-t);
}
.ac-lesson-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ac-g);
  border-radius: 0 2px 2px 0;
}
.ac-lesson-item.locked { opacity: 0.35; cursor: not-allowed; }
.ac-lesson-item.completed { color: var(--ac-ts); }

.ac-lesson-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--ac-br2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  transition: all 0.25s;
}
.ac-lesson-item.completed .ac-lesson-check {
  border-color: var(--ac-g);
  background: rgba(0,255,136,0.12);
  color: var(--ac-g);
  font-size: 13px;
}
.ac-lesson-item.active .ac-lesson-check {
  border-color: var(--ac-g);
  box-shadow: 0 0 10px rgba(0,255,136,0.3);
  color: var(--ac-g);
}

.ac-lesson-info  { flex: 1; min-width: 0; }
.ac-lesson-num   { font-family: var(--ac-fm); font-size: 11px; color: var(--ac-tm); flex-shrink: 0; }
.ac-lesson-name  { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.ac-lesson-time  { display: block; font-family: var(--ac-fm); font-size: 11px; color: var(--ac-tm); margin-top: 2px; }

/* Quiz item in sidebar */
.ac-lesson-item.quiz-item {
  border-top: 1px solid rgba(245,158,11,0.12);
  color: var(--ac-o);
}
.ac-lesson-item.quiz-item .ac-lesson-check { border-color: rgba(245,158,11,0.38); }
.ac-lesson-item.quiz-item.completed .ac-lesson-check {
  background: rgba(245,158,11,0.10);
  border-color: var(--ac-o);
  color: var(--ac-o);
}

/* Sidebar reward widget */
.ac-sidebar-reward {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin: 8px 12px 16px;
  background: rgba(0,255,136,0.04);
  border: 1px solid rgba(0,255,136,0.14);
  border-radius: 10px;
  flex-shrink: 0;
}
.ac-sidebar-reward-icon { font-size: 22px; flex-shrink: 0; }
.ac-sidebar-reward > div { display: flex; flex-direction: column; gap: 2px; }
.ac-sidebar-reward strong { font-family: var(--ac-fm); font-size: 11px; color: var(--ac-g); }
.ac-sidebar-reward span   { font-family: var(--ac-fm); font-size: 10px; color: var(--ac-ts); }

/* Collapsed sidebar */
.ac-viewer.sidebar-collapsed .ac-lesson-sidebar {
  width: 0 !important;
  overflow: hidden;
  border-right: none;
}
.ac-viewer.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

/* ── Main content area ───────────────────────────────────────── */
.ac-lesson-content {
  grid-area: main;
  padding: 48px 64px;
  overflow-y: auto;
}
.ac-lesson-content > * { max-width: 820px; margin-left: auto; margin-right: auto; }

/* ─── Lesson rich content wrapper ───────────────────────────── */
.ac-lesson-body {
  font-size: 17px;
  line-height: 1.9;
  color: var(--ac-ts);
}
.ac-lesson-body h2 {
  font-family: var(--ac-fd);
  font-size: 26px;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--ac-t);
}
.ac-lesson-body h3 {
  font-family: var(--ac-fd);
  font-size: 21px;
  font-weight: 600;
  margin: 30px 0 12px;
  color: var(--ac-cy);
}
.ac-lesson-body p      { margin-bottom: 16px; }
.ac-lesson-body strong { color: var(--ac-t); font-weight: 600; }
.ac-lesson-body em     { color: var(--ac-cy); font-style: italic; }
.ac-lesson-body ul,
.ac-lesson-body ol     { padding-left: 22px; margin-bottom: 16px; }
.ac-lesson-body li     { line-height: 1.85; margin-bottom: 9px; }

/* Lesson header badge */
.ac-lesson-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ac-br);
}
.ac-lesson-num-badge {
  font-family: var(--ac-fm);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ac-g);
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.18);
  padding: 4px 12px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 14px;
}
.ac-lesson-title {
  font-family: var(--ac-fd);
  font-size: 30px;
  font-weight: 800;
  color: var(--ac-t);
  margin: 0 0 10px;
  line-height: 1.2;
}
.ac-lesson-readtime {
  font-family: var(--ac-fm);
  font-size: 11px;
  color: var(--ac-ts);
  display: block;
}

/* Lesson nav buttons */
.ac-lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--ac-br);
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.ac-btn {
  font-family: var(--ac-fm);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  padding: 12px 26px;
  border-radius: 10px;
  border: 1px solid var(--ac-br);
  background: rgba(255,255,255,0.04);
  color: var(--ac-ts);
  cursor: pointer;
  transition: all 0.22s;
}
.ac-btn:hover           { background: rgba(255,255,255,0.08); color: var(--ac-t); border-color: var(--ac-br2); }
.ac-btn-primary         { background: rgba(0,255,136,0.09); border-color: rgba(0,255,136,0.28); color: var(--ac-g); }
.ac-btn-primary:hover   { background: rgba(0,255,136,0.15); border-color: rgba(0,255,136,0.5); box-shadow: 0 0 24px rgba(0,255,136,0.13); }
.ac-btn-secondary       { background: rgba(255,255,255,0.04); border-color: var(--ac-br); color: var(--ac-ts); }
.ac-btn:disabled        { opacity: 0.25; cursor: not-allowed; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════
   QUIZ — Premium
   ═══════════════════════════════════════════════════════════════ */

.ac-quiz {
  max-width: 820px;
  margin: 0 auto;
  animation: ac-fadeIn 0.35s ease;
}
.ac-quiz h2 {
  font-family: var(--ac-fd);
  font-size: 28px;
  font-weight: 800;
  color: var(--ac-o);
  margin-bottom: 8px;
}
.ac-quiz-subtitle {
  font-size: 14px;
  color: var(--ac-ts);
  margin-bottom: 32px;
  line-height: 1.65;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ac-br);
}

/* Quiz progress */
.ac-quiz-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}
.ac-quiz-progress-bar {
  flex: 1; height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.ac-quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ac-o), #f97316);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ac-quiz-progress-text {
  font-family: var(--ac-fm);
  font-size: 12px;
  color: var(--ac-ts);
  white-space: nowrap;
}

/* Question */
.ac-question { margin-bottom: 32px; }
.ac-question-text {
  font-size: 17px;
  color: var(--ac-t);
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.65;
}
.ac-options { display: flex; flex-direction: column; gap: 12px; }
.ac-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ac-br);
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: var(--ac-ts);
}
.ac-option:hover    { background: rgba(255,255,255,0.06); border-color: var(--ac-br2); color: var(--ac-t); transform: translateX(3px); }
.ac-option.selected { border-color: rgba(59,130,246,0.45); background: rgba(59,130,246,0.07); color: var(--ac-t); }
.ac-option.correct  { border-color: rgba(0,255,136,0.5) !important; background: rgba(0,255,136,0.07) !important; color: var(--ac-g) !important; }
.ac-option.wrong    { border-color: rgba(255,71,87,0.5) !important;  background: rgba(255,71,87,0.07) !important;  color: var(--ac-r) !important; }
.ac-option-letter {
  font-family: var(--ac-fm);
  font-size: 11px;
  font-weight: 700;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  transition: background 0.2s;
}
.ac-option.selected .ac-option-letter { background: rgba(59,130,246,0.18); color: var(--ac-b); }
.ac-option.correct  .ac-option-letter { background: rgba(0,255,136,0.18); color: var(--ac-g); }
.ac-option.wrong    .ac-option-letter { background: rgba(255,71,87,0.18); color: var(--ac-r); }

/* Explanation */
.ac-explanation {
  margin-top: 16px;
  padding: 16px 20px;
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.14);
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--ac-ts);
  line-height: 1.7;
  animation: ac-fadeIn 0.3s ease;
}
.ac-explanation strong { color: var(--ac-b); }

/* Quiz results */
.ac-quiz-results {
  text-align: center;
  padding: 60px 20px;
  animation: ac-scaleIn 0.4s ease;
}
.ac-result-icon  { font-size: 80px; margin-bottom: 20px; }
.ac-result-score {
  font-family: var(--ac-fd);
  font-size: 72px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.ac-result-score.pass { color: var(--ac-g); text-shadow: 0 0 40px rgba(0,255,136,0.3); }
.ac-result-score.fail { color: var(--ac-r); }
.ac-result-text  { font-size: 17px; color: var(--ac-ts); margin-bottom: 28px; line-height: 1.65; }
.ac-result-reward {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.28);
  border-radius: 14px;
  font-family: var(--ac-fm);
  font-size: 14px;
  color: var(--ac-g);
  margin-bottom: 32px;
  animation: ac-pulse 2s infinite;
}

/* ═══════════════════════════════════════════════════════════════
   CERTIFICATE
   ═══════════════════════════════════════════════════════════════ */

/* Certificate v3 — fixed layout, top-tier rendering */
.ac-cert-outer {
  width: 100%; max-width: 860px; margin: 0 auto; position: relative;
}
.ac-cert-card {
  position: relative; width: 100%;
  /* overflow:visible → contenuto non clippato mai */
  border-radius: 20px; overflow: visible;
  border: 1.5px solid rgba(0,220,155,0.25);
  background: linear-gradient(145deg,
    rgba(6,10,18,.96) 0%,
    rgba(10,18,30,.94) 40%,
    rgba(7,12,20,.96) 100%);
  box-shadow:
    0 0 0 1px rgba(0,220,155,0.06),
    0 32px 100px rgba(0,0,0,.85),
    0 0 80px rgba(0,220,155,.04),
    inset 0 1px 0 rgba(255,255,255,.04);
}
/* Wrapper interno che contiene blobs + bordo arrotondato senza clip il testo */
.ac-cert-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 18px;
  background: inherit;
  z-index: 0;
  pointer-events: none;
}
.ac-blob {
  position: absolute; border-radius: 50%; pointer-events: none; filter: blur(55px);
  /* clip al card senza toccare contenuto */
  clip-path: inset(0 round 18px);
}
.ac-b1 { width: 60%; height: 70%; top: -10%; left: -8%; background: radial-gradient(circle,rgba(0,220,155,.10),transparent 65%); }
.ac-b2 { width: 60%; height: 70%; bottom: -10%; right: -8%; background: radial-gradient(circle,rgba(84,132,255,.07),transparent 65%); }
.ac-cert-borders { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; border-radius: 20px; overflow: hidden; }
.ac-gline {
  width: 65%; height: 1px; align-self: center; flex-shrink: 0;
  background: linear-gradient(90deg,transparent,rgba(190,150,50,.50) 50%,transparent);
  margin: 4px 0;
}
.ac-cc {
  position: relative; z-index: 4;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 9% 20px;
  gap: 2px;
}
.ac-c-head { text-align: center; flex-shrink: 0; }
.ac-c-acad {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(9px, 1.1vw, 12px); letter-spacing: 5px;
  color: #00dc9b; opacity: .9; text-transform: uppercase; margin-bottom: 4px;
}
.ac-c-sub {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(8px, .85vw, 11px); letter-spacing: 4px;
  color: #3d4f5f; text-transform: uppercase;
}
.ac-c-main { text-align: center; flex-shrink: 0; }
.ac-c-ico-coin {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px; margin-top: 2px;
}
.ac-c-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(20px, 3.2vw, 42px); font-weight: 800;
  color: #C9A84C; line-height: 1.05; margin-bottom: 5px;
  text-shadow: 0 0 36px rgba(201,168,76,.35), 0 2px 8px rgba(0,0,0,.5);
  letter-spacing: -0.5px;
}
.ac-c-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(11px, 1.1vw, 13px); color: #5a6a7a; line-height: 1.4;
}
.ac-c-who { text-align: center; flex-shrink: 0; }
.ac-c-conf {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(8px, .75vw, 10px); letter-spacing: 4px;
  color: #3d4f5f; text-transform: uppercase; margin-bottom: 5px;
}
.ac-c-user {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(20px, 2.6vw, 36px); font-weight: 700;
  color: #e8edf2; letter-spacing: 0.5px;
  text-shadow: 0 0 20px rgba(232,237,242,.15);
}
.ac-c-foot {
  width: 100%; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 4px; flex-shrink: 0;
}
.ac-c-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(9px, .95vw, 12px); color: #3d4f5f; text-align: center;
  flex: 1;
}
.ac-c-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(7px, .65vw, 9px); color: #1e2832;
  letter-spacing: 1px; text-align: center; margin-top: 4px;
  width: 100%;
}
/* Share grid */
.ac-share-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px; margin-top: 28px;
}
.ac-sb {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 600;
  padding: 11px 22px; border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04); color: #8b95a5;
  cursor: pointer; text-decoration: none;
  transition: all .2s; white-space: nowrap;
}
.ac-sb svg { flex-shrink: 0; }
.ac-dl { background: linear-gradient(135deg,#00dc9b,#00b4d8) !important; color: #060a10 !important; border-color: transparent !important; font-weight: 800; box-shadow: 0 0 22px rgba(0,220,155,.25); }
.ac-dl:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(0,220,155,.4); }
.ac-wa { color: #25D366 !important; border-color: rgba(37,211,102,.2); } .ac-wa:hover { background: rgba(37,211,102,.12) !important; border-color: rgba(37,211,102,.4); }
.ac-tw { color: #e8edf2 !important; border-color: rgba(255,255,255,.15); } .ac-tw:hover { background: rgba(255,255,255,.08) !important; }
.ac-fb { color: #1877F2 !important; border-color: rgba(24,119,242,.2); } .ac-fb:hover { background: rgba(24,119,242,.12) !important; }
.ac-li { color: #0A66C2 !important; border-color: rgba(10,102,194,.2); } .ac-li:hover { background: rgba(10,102,194,.12) !important; }
.ac-ig { color: #E1306C !important; border-color: rgba(225,48,108,.2); } .ac-ig:hover { background: rgba(225,48,108,.10) !important; }
.ac-tt { color: #e8edf2 !important; border-color: rgba(255,255,255,.12); } .ac-tt:hover { background: rgba(255,255,255,.06) !important; }

/* ═══════════════════════════════════════════════════════════════
   LESSON BODY RICH COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

/* Timeline */
.ac-timeline { position: relative; padding-left: 32px; margin: 28px 0; }
.ac-timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--ac-br), rgba(0,255,136,0.22), var(--ac-br));
}
.ac-timeline-item { position: relative; margin-bottom: 24px; animation: ac-fadeInUp 0.4s ease-out both; }
.ac-timeline-item:nth-child(1){animation-delay:.05s} .ac-timeline-item:nth-child(2){animation-delay:.10s}
.ac-timeline-item:nth-child(3){animation-delay:.15s} .ac-timeline-item:nth-child(4){animation-delay:.20s}
.ac-timeline-item:nth-child(5){animation-delay:.25s} .ac-timeline-item:nth-child(6){animation-delay:.30s}
.ac-timeline-dot {
  position: absolute;
  left: -26px; top: 7px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent, var(--ac-g));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent, var(--ac-g)) 70%, transparent);
}
.ac-timeline-content h4 {
  font-family: var(--ac-fd);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent, var(--ac-t));
  margin-bottom: 5px;
}
.ac-timeline-content p { font-size: 13.5px; color: var(--ac-ts); margin: 0; line-height: 1.65; }

/* Insight box */
.ac-insight {
  display: flex;
  gap: 16px;
  background: rgba(0,255,136,0.03);
  border: 1px solid rgba(0,255,136,0.12);
  border-left: 3px solid var(--ac-g);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 24px 0;
}
.ac-insight-icon { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.ac-insight-text { font-size: 13.5px; color: var(--ac-ts); line-height: 1.75; }
.ac-insight-text strong { color: var(--ac-t); }

/* Comparison grid */
.ac-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0; }
.ac-comp-col {
  background: var(--ac-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ac-br);
  border-radius: 13px;
  padding: 22px;
}
.ac-comp-good { border-color: rgba(0,255,136,0.18); }
.ac-comp-bad  { border-color: rgba(255,71,87,0.18); }
.ac-comp-col h4 { font-family: var(--ac-fd); font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.ac-comp-col ul { padding-left: 16px; margin: 0; }
.ac-comp-col li { font-size: 12.5px; color: var(--ac-ts); line-height: 1.65; margin-bottom: 6px; }

/* Mini cards grid */
.ac-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 24px 0; }
.ac-mini-card {
  background: var(--ac-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ac-br);
  border-top: 2px solid var(--card-accent, var(--ac-g));
  border-radius: 13px;
  padding: 20px;
  transition: transform 0.2s;
}
.ac-mini-card:hover { transform: translateY(-2px); }
.ac-mini-card h4 { font-family: var(--ac-fd); font-size: 14px; font-weight: 700; margin-bottom: 7px; color: var(--ac-t); }
.ac-mini-card p  { font-size: 12.5px; color: var(--ac-ts); line-height: 1.65; margin: 0; }

/* Stats bar */
.ac-stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 24px 0;
  background: var(--ac-glass);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid var(--ac-br);
  overflow: hidden;
}
.ac-stat { text-align: center; flex: 1; padding: 20px 12px; position: relative; }
.ac-stat + .ac-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: var(--ac-br);
}
.ac-stat-num   { font-family: var(--ac-fd); font-size: 26px; font-weight: 800; color: var(--stat-color, var(--ac-g)); }
.ac-stat-label { font-family: var(--ac-fm); font-size: 9px; color: var(--ac-ts); letter-spacing: 0.8px; text-transform: uppercase; }

/* Feature list */
.ac-feature-list { margin: 20px 0; }
.ac-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ac-feature:last-child { border-bottom: none; }
.ac-feature-num {
  font-family: var(--ac-fm);
  font-size: 11px;
  font-weight: 700;
  color: var(--ac-g);
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ac-gd);
  border-radius: 8px;
  flex-shrink: 0;
}
.ac-feature > div { font-size: 13.5px; color: var(--ac-ts); line-height: 1.65; }
.ac-feature strong { color: var(--ac-t); }

/* Diagrams */
.ac-diagram       { margin: 22px 0; overflow-x: auto; }
.ac-svg-diagram   { width: 100%; max-width: 620px; height: auto; display: block; margin: 0 auto; }
.ac-svg-wide      { max-width: 760px; }

/* Code examples */
.ac-code-example {
  background: var(--ac-bg2);
  border: 1px solid var(--ac-br);
  border-radius: 13px;
  padding: 20px 22px;
  margin: 20px 0;
  font-family: var(--ac-fm);
}
.ac-code-label   { font-size: 9px; color: var(--ac-tm); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 12px; }
.ac-code-row     { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.ac-code-key     { font-size: 11px; color: var(--ac-cy); min-width: 90px; flex-shrink: 0; }
.ac-code-val     { font-size: 11px; color: var(--ac-g); }
.ac-code-comment { font-size: 10px; color: var(--ac-tm); margin-left: auto; }
.ac-hash-example { font-size: 11px; color: var(--ac-g); word-break: break-all; margin-top: 8px; line-height: 1.8; }

/* Info box */
.ac-info-box {
  background: rgba(59,130,246,0.04);
  border: 1px solid rgba(59,130,246,0.14);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 22px 0;
  font-size: 13.5px;
  color: var(--ac-ts);
  line-height: 1.75;
}
.ac-info-box strong { color: var(--ac-b); }

/* Highlight box */
.ac-highlight {
  background: rgba(0,255,136,0.04);
  border: 1px solid rgba(0,255,136,0.14);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 22px 0;
  font-size: 13.5px;
  color: var(--ac-ts);
  line-height: 1.75;
}
.ac-highlight strong { color: var(--ac-g); }

/* Warning box */
.ac-warning {
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.18);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 22px 0;
  font-size: 13.5px;
  color: var(--ac-ts);
  line-height: 1.75;
}
.ac-warning strong { color: var(--ac-o); }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes ac-fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ac-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ac-scaleIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes ac-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,136,0.0); }
  50%       { box-shadow: 0 0 24px rgba(0,255,136,0.18); }
}
@keyframes ac-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes ac-bump {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); color: var(--ac-g); }
}
@keyframes ac-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* Staggered card animations */
.ac-course-card:nth-child(1) { animation-delay: 0.04s; }
.ac-course-card:nth-child(2) { animation-delay: 0.10s; }
.ac-course-card:nth-child(3) { animation-delay: 0.16s; }
.ac-course-card:nth-child(4) { animation-delay: 0.22s; }
.ac-course-card:nth-child(5) { animation-delay: 0.28s; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════
   HERO CTA BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.ac-hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px auto 0;
  width: fit-content;
  animation: ac-fadeInUp 0.5s ease-out 0.28s both;
}
/* ── Quando ac-hero-cta è il bottone stesso (struttura legacy) ─────────── */
button.ac-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--ac-fd);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 16px 36px;
  border-radius: 50px;
  border: 1px solid rgba(0,220,155,0.40);
  background: linear-gradient(135deg, rgba(0,220,155,0.18) 0%, rgba(0,180,216,0.14) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #00dc9b;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
  box-shadow: 0 0 28px rgba(0,220,155,.20), inset 0 1px 0 rgba(255,255,255,.06);
  white-space: nowrap;
  margin-bottom: 40px;
}
button.ac-hero-cta:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(0,220,155,0.28) 0%, rgba(0,180,216,0.22) 100%);
  border-color: rgba(0,220,155,.65);
  box-shadow: 0 0 44px rgba(0,220,155,.38), inset 0 1px 0 rgba(255,255,255,.10);
}
.ac-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ac-fd);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 15px 32px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--ac-g), #00b4d8);
  color: #060a10;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 28px rgba(0,220,155,.30);
  white-space: nowrap;
}
.ac-hero-btn:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,220,155,.45); }
.ac-hero-btn-ghost {
  display: inline-flex;
  align-items: center;
  font-family: var(--ac-fd);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 50px;
  border: 1px solid rgba(0,220,155,0.30);
  background: rgba(0,220,155,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ac-g);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.ac-hero-btn-ghost:hover { background: rgba(0,220,155,0.12); border-color: rgba(0,220,155,.5); }

@media (max-width: 1280px) {
  /* legacy paid teaser rules removed — see amber redesign */
}

@media (max-width: 1100px) {
  .ac-tier-token .ac-courses-grid { grid-template-columns: repeat(2, 1fr); }
  .ac-lesson-content { padding: 40px 48px; }
}

/* ── TABLET 900px ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .ac-catalog { padding: 0 20px 60px; }
  .ac-tier-free  .ac-courses-grid { grid-template-columns: 1fr; }
  .ac-tier-token .ac-courses-grid { grid-template-columns: 1fr; }
  .ac-courses-grid { grid-template-columns: 1fr; }

  /* Viewer stacked */
  .ac-viewer {
    grid-template-columns: 1fr;
    grid-template-rows: var(--ac-topbar-h) auto 1fr;
    grid-template-areas: "nav" "side" "main";
  }
  .ac-lesson-sidebar {
    position: relative; top: 0; height: auto;
    max-height: 44vh; border-right: none;
    border-bottom: 1px solid var(--ac-br);
  }
  .ac-viewer.sidebar-collapsed { grid-template-columns: 1fr; }
  .ac-viewer.sidebar-collapsed .ac-lesson-sidebar { max-height: 0; overflow: hidden; }
  .ac-lesson-content { padding: 28px 24px; }
  .ac-quiz           { padding: 24px 16px; }
  .ac-comparison     { grid-template-columns: 1fr; }
  .ac-tier-header    { flex-direction: column; align-items: flex-start; }
  .ac-tier-header-right { width: 100%; justify-content: flex-start; }
  .ac-tier-reward-pill { margin-left: 0; }
}

/* ── MOBILE 640px ───────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Hero mobile compatto */
  .ac-hero { padding: 36px 20px 32px !important; }
  .ac-hero h1 { font-size: 34px !important; line-height: 1.1 !important; }
  .ac-hero-logo { margin-bottom: 14px !important; }
  img.ac-card-banner { height: 160px; }

  /* Hero */
  .ac-hero { padding: 64px 16px 44px; }
  .ac-hero h1 { font-size: clamp(28px, 8vw, 38px); letter-spacing: 0.5px; }
  .ac-hero-badge {
    font-size: 9px; letter-spacing: 2.5px;
    padding: 7px 16px; margin-bottom: 20px;
    max-width: 90vw; text-align: center;
    white-space: normal; line-height: 1.4;
  }
  .ac-hero-logo { margin-bottom: 20px; }
  .ac-subtitle { font-size: 14px; line-height: 1.7; margin-bottom: 28px; padding: 0 4px; }
  .ac-hero-stats {
    border-radius: 14px; width: 100%;
    max-width: 100%; overflow: hidden;
  }
  .ac-hero-stat { padding: 16px 10px; min-width: 0; flex: 1; }
  .ac-hero-stat-num { font-size: 22px; }
  .ac-hero-stat-label { font-size: 8px; letter-spacing: 1px; }
  .ac-hero-cta { flex-direction: column; gap: 12px; margin-top: 24px; padding: 0 8px; }
  .ac-hero-btn, .ac-hero-btn-ghost {
    width: 100%; justify-content: center;
    font-size: 14px; padding: 14px 24px;
  }

  /* Catalog header */
  .ac-catalog { padding: 0 12px 48px; }
  .ac-catalog-header { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 32px; }
  .ac-catalog-header h2 { font-size: 20px; }
  .ac-catalog-progress { font-size: 10px; width: 100%; text-align: center; }

  /* Tier headers */
  .ac-tier-header-text h2 { font-size: 20px; }
  .ac-tier-header-text p  { font-size: 13px; }
  .ac-tier-badge { font-size: 9px; padding: 6px 14px; }
  .ac-tier-reward-pill { font-size: 10px; padding: 5px 12px; }

  /* Course cards */
  .ac-course-card { min-height: 0; border-radius: 16px; }
  .ac-course-card:hover { transform: none; }
  .ac-card-info { padding: 16px 16px 12px; }
  .ac-card-info h3 { font-size: 16px; }
  .ac-card-info p  { font-size: 12.5px; line-height: 1.6; }
  .ac-card-footer  { padding: 12px 16px; }
  .ac-card-tag     { font-size: 8.5px; }
  .ac-card-reward  { font-size: 11px; }

  /* Premium teaser - compact */
  /* legacy paid teaser rules removed — see amber redesign */

  /* Viewer */
  .ac-viewer-topbar { padding: 0 12px; gap: 8px; }
  .ac-viewer-title  { font-size: 12px; max-width: 140px; }
  .ac-viewer-progress-bar-mini { width: 60px; }
  .ac-lesson-title  { font-size: 20px; }
  .ac-lesson-content { padding: 20px 16px; overflow-x: hidden; }
  .ac-lesson-content > * { max-width: 100%; }

  /* Lesson body — no horizontal overflow */
  .ac-lesson-body { font-size: 16px; word-break: break-word; overflow-wrap: break-word; line-height: 1.85; }
  .ac-lesson-body h2  { font-size: 22px; }
  .ac-lesson-body h3  { font-size: 18px; }
  .ac-lesson-body pre,
  .ac-lesson-body code { overflow-x: auto; max-width: 100%; font-size: 12px; }
  .ac-lesson-body table { display: block; overflow-x: auto; max-width: 100%; }

  /* Quiz */
  .ac-quiz { padding: 20px 14px; }
  .ac-quiz-header h2    { font-size: 18px; }
  .ac-quiz-option       { font-size: 13.5px; padding: 14px 14px; }
  .ac-result-score      { font-size: 48px; }
  .ac-result-msg        { font-size: 15px; }

  /* Certificate */
  .ac-cert-outer { padding: 0 4px; }
  .ac-cert-card  { border-radius: 12px; }
  .ac-cc         { padding: 16px 7% 14px; gap: 2px; }
  .ac-c-acad     { font-size: 8px; letter-spacing: 3px; }
  .ac-c-sub      { font-size: 7px; letter-spacing: 3px; }
  .ac-c-name     { font-size: clamp(18px, 5.5vw, 28px); }
  .ac-c-title    { font-size: 11px; }
  .ac-c-conf     { font-size: 7px; letter-spacing: 2px; }
  .ac-c-user     { font-size: clamp(16px, 4.5vw, 24px); }
  .ac-c-meta     { font-size: 9px; }
  .ac-c-tag      { font-size: 7px; margin-top: 3px; }
  .ac-c-foot     { flex-direction: column; gap: 3px; align-items: center; }
  .ac-gline      { margin: 2px 0; }
  .ac-share-grid { gap: 8px; }
  .ac-sb         { font-size: 12px; padding: 10px 14px; border-radius: 40px; }

  /* Author */
  .ac-author-card  { flex-direction: column; text-align: center; }
  .ac-author-stats { justify-content: center; flex-wrap: wrap; gap: 8px; }
  .ac-author-stats span { font-size: 11px; }

  /* Comparison */
  .ac-cards-grid { grid-template-columns: 1fr; }
}

/* ── MOBILE XS 440px ────────────────────────────────────────── */
@media (max-width: 440px) {
  .ac-hero { padding: 52px 12px 36px; }
  .ac-hero h1 { font-size: clamp(24px, 8vw, 32px); }
  .ac-hero-badge { font-size: 8px; letter-spacing: 2px; }
  .ac-hero-stat-num   { font-size: 18px; }
  .ac-hero-stat-label { font-size: 7.5px; }
  .ac-catalog { padding: 0 10px 40px; }
  /* legacy paid teaser rules removed — see amber redesign */
  .ac-author-card { flex-direction: column; text-align: center; }
  .ac-author-stats { justify-content: center; }
  .ac-lesson-content { padding: 16px 12px; }
  .ac-quiz { padding: 16px 10px; }
  .ac-share-grid { gap: 6px; }
  .ac-sb { font-size: 10px; padding: 8px 11px; }
}

/* ── PREVENT HORIZONTAL OVERFLOW GLOBALLY ON MOBILE ────────── */
@media (max-width: 768px) {
  .ac-viewer,
  .ac-lesson-content,
  .ac-lesson-body,
  .ac-quiz,
  .ac-lesson-sidebar { overflow-x: hidden; }

  /* No side-swipe on lesson text elements */
  .ac-lesson-body *:not(pre):not(table):not(code) {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Footer icons - compact */
  .ac-viewer-topbar { gap: 6px; }
  .ac-btn { font-size: 12px; padding: 8px 14px; border-radius: 10px; }
  .ac-viewer-progress-bar-mini { width: 70px; }

  /* Sidebar lessons list - no overflow */
  .ac-lesson-name { max-width: 100%; white-space: normal; line-height: 1.35; font-size: 12px; }
  .ac-lesson-item { padding: 10px 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE BOTTOM TAB BAR — App-style navigation (catalog only)
   ═══════════════════════════════════════════════════════════════ */

.ac-mobile-tab-bar {
  display: none; /* Desktop: hidden */
}

@media (max-width: 767px) {
  /* Spacer so catalog content doesn't hide behind tab bar */
  .ac-catalog { padding-bottom: 80px !important; }

  .ac-mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(10, 14, 23, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 9000;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 32px rgba(0,0,0,0.4);
  }
  .ac-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: #4b5563;
    font-size: 9px;
    font-family: var(--ac-fb);
    letter-spacing: 0.3px;
    cursor: pointer;
    padding: 6px 2px;
    border-radius: 12px;
    transition: color 0.2s, background 0.2s;
    position: relative;
  }
  .ac-tab-item:active {
    background: rgba(255,255,255,0.04);
  }
  .ac-tab-item.ac-tab-active {
    color: var(--ac-g, #00dc9b);
  }
  .ac-tab-item.ac-tab-active svg {
    stroke: var(--ac-g, #00dc9b);
  }
  .ac-tab-item svg {
    flex-shrink: 0;
    transition: stroke 0.2s;
  }
  .ac-tab-item span:not(.ac-tab-badge) {
    font-size: 9px;
    line-height: 1;
  }
  .ac-tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    background: var(--ac-g, #00dc9b);
    color: #0a0e17;
    font-size: 8px;
    font-family: var(--ac-fm);
    font-weight: 700;
    border-radius: 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  /* Grid responsive fixes for premium preview cards */
  .ac-paid-preview-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

