/* ===== WEBICA ACADEMY — DESIGN SYSTEM ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #7C3AED;
  --bg: #F9FAFB;
  --card: #FFFFFF;
  --sidebar-bg: #1E1B4B;
  --text: #111827;
  --text-secondary: #6B7280;
  --success: #059669;
  --warning: #D97706;
  --border: #E5E7EB;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --sidebar-width: 280px;
  --header-height: 60px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover { background: #EEF2FF; color: var(--primary); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #047857; color: #fff; }
.btn-success:disabled {
  background: #D1FAE5;
  color: var(--success);
  cursor: default;
}

.btn-cta {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 1.125rem;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.btn-cta:hover {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn-logout {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-logout:hover { background: #FEE2E2; color: #DC2626; border-color: #DC2626; }

/* --- Course Layout --- */
.course-body { background: var(--bg); }

.course-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  height: var(--header-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
}
.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-user-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s;
}

.course-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #E0E7FF;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 200;
}

.sidebar-top { padding: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
}
.sidebar-logo-icon { font-size: 1.5rem; }

.sidebar-progress { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-progress-label { font-size: 0.8rem; color: #A5B4FC; margin-bottom: 0.4rem; }
.sidebar-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}
.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.5s;
}
.sidebar-progress-percent { font-size: 0.8rem; color: #A5B4FC; margin-top: 0.3rem; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; overflow-y: auto; }

.sidebar-dashboard-link {
  display: block;
  padding: 0.6rem 1.25rem;
  color: #C7D2FE;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.sidebar-dashboard-link:hover { background: rgba(255,255,255,0.08); color: #fff; }

.sidebar-module { border-bottom: 1px solid rgba(255,255,255,0.05); }
.sidebar-module-header {
  display: block;
  padding: 0.65rem 1.25rem;
  color: #C7D2FE;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.sidebar-module-header:hover { background: rgba(255,255,255,0.08); color: #fff; }

.sidebar-lessons { padding-left: 0.5rem; }
.sidebar-lesson {
  display: block;
  padding: 0.45rem 1.25rem 0.45rem 1.75rem;
  color: #A5B4FC;
  font-size: 0.82rem;
  transition: all 0.2s;
  text-decoration: none;
}
.sidebar-lesson:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-lesson.current { background: rgba(79, 70, 229, 0.3); color: #fff; font-weight: 600; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-link { color: #818CF8; font-size: 0.82rem; text-decoration: none; }
.sidebar-link:hover { color: #C7D2FE; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

/* --- Main Content --- */
.course-main {
  flex: 1;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* --- Dashboard --- */
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { margin-bottom: 0.5rem; }
.dashboard-header p { color: var(--text-secondary); font-size: 1.05rem; }

.modules-grid { display: flex; flex-direction: column; gap: 1.25rem; }

.module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}
.module-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.module-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.module-icon { font-size: 2rem; }
.module-card-header h3 { margin-bottom: 0.5rem; }

.module-progress-bar {
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
  max-width: 200px;
}
.module-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.3s;
}
.module-progress-text { font-size: 0.8rem; color: var(--text-secondary); }

.module-lessons-list { display: flex; flex-direction: column; gap: 0.4rem; }
.lesson-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.15s;
  text-decoration: none;
}
.lesson-link:hover { background: #F3F4F6; color: var(--text); }
.lesson-link.completed { color: var(--text-secondary); }

.dashboard-cta { margin-top: 2rem; }

/* --- Lesson Content --- */
.lesson-content { }
.lesson-header { margin-bottom: 2rem; }
.lesson-badge {
  display: inline-block;
  background: #EEF2FF;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  margin-bottom: 0.75rem;
}
.lesson-body { line-height: 1.8; }
.lesson-body p { margin-bottom: 1rem; }
.lesson-body h2 { margin: 2rem 0 1rem; }
.lesson-body h3 { margin: 1.5rem 0 0.75rem; }
.lesson-body ul, .lesson-body ol { margin: 1rem 0; padding-left: 1.5rem; }
.lesson-body li { margin-bottom: 0.4rem; }

/* Lesson navigation */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.mark-complete { min-width: 180px; }

/* --- Tip Boxes --- */
.tip-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
}
.tip-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 0.1rem; }

.tip-box.tip-practical, .tip-box { background: #FFFBEB; border-color: var(--warning); }
.tip-box.tip-warning { background: #FEF2F2; border-color: #EF4444; }
.tip-box.tip-info { background: #EEF2FF; border-color: var(--primary); }
.tip-box.tip-action { background: #ECFDF5; border-color: var(--success); }

/* --- Alias: box-* classes (used by some lesson content) --- */
.box-tip, .box-example, .box-warning, .box-action {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
}
.box-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 0.1rem; }
.box-content { flex: 1; }
.box-content strong { display: block; margin-bottom: 0.25rem; }
.box-tip { background: #FFFBEB; border-color: var(--warning); }
.box-example { background: #EEF2FF; border-color: var(--primary); }
.box-warning { background: #FEF2F2; border-color: #EF4444; }
.box-action { background: #ECFDF5; border-color: var(--success); }

/* --- Checklist (Module 1 Lesson 1) --- */
.checklist { margin: 1.5rem 0; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}
.checklist-item:hover { background: #F3F4F6; }
.checklist-item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
}
.checklist-result {
  margin: 1.5rem 0;
  padding: 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}
.checklist-result.level-0 { background: #FEF2F2; border: 2px solid #EF4444; color: #DC2626; }
.checklist-result.level-1 { background: #FFFBEB; border: 2px solid var(--warning); color: #B45309; }
.checklist-result.level-2 { background: #EEF2FF; border: 2px solid var(--primary); color: var(--primary); }
.checklist-result.level-3 { background: #ECFDF5; border: 2px solid var(--success); color: #047857; }

/* --- Lesson content general --- */
.lesson-content h2 { font-size: 1.4rem; margin: 2rem 0 1rem; color: #111827; }
.lesson-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; color: #374151; }
.lesson-content p { margin-bottom: 1rem; line-height: 1.8; }
.lesson-content ul, .lesson-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.lesson-content li { margin-bottom: 0.4rem; line-height: 1.7; }
.lesson-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.lesson-content th, .lesson-content td { padding: 0.75rem 1rem; border: 1px solid var(--border); text-align: left; }
.lesson-content th { background: #F3F4F6; font-weight: 600; }
.lesson-content .lesson-title { font-size: 1.75rem; margin-bottom: 0.5rem; }
.lesson-content .lesson-subtitle { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 2rem; }

/* --- Bonus Page --- */
.bonus-page h1 { margin-bottom: 0.75rem; }
.bonus-page > p { color: var(--text-secondary); margin-bottom: 2rem; }
.bonus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.bonus-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.bonus-card .bonus-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.bonus-card h3 { margin-bottom: 0.5rem; }
.bonus-card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.75rem; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
}
.badge-coming { background: #FEF3C7; color: var(--warning); }
.badge-available { background: #D1FAE5; color: var(--success); }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.auth-card h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.auth-card .auth-logo {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

.auth-card .btn { width: 100%; margin-top: 0.5rem; }

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-error {
  background: #FEF2F2;
  color: #DC2626;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}

/* ===== LANDING PAGE ===== */
.landing-body { background: #fff; }

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.landing-nav-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary);
}
.landing-nav-links { display: flex; gap: 1.5rem; align-items: center; }
.landing-nav-links a { color: var(--text-secondary); font-weight: 500; font-size: 0.95rem; }
.landing-nav-links a:hover { color: var(--primary); }

.hero {
  background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 50%, #FAF5FF 100%);
  padding: 5rem 2rem;
  text-align: center;
}
.hero-inner { max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 2.75rem; font-weight: 800; margin-bottom: 1.25rem; line-height: 1.15; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-cta { margin-bottom: 0.75rem; }
.hero-sub { font-size: 0.9rem; color: var(--text-secondary); }

.section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}
.section-alt { background: var(--bg); }
.section h2 { text-align: center; font-size: 2rem; margin-bottom: 1rem; }
.section .section-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 2.5rem; font-size: 1.05rem; }

.pain-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.pain-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}
.pain-card .pain-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.pain-card p { color: var(--text-secondary); }

.benefits-list {
  max-width: 600px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}
.benefits-list li {
  padding: 0.75rem 0;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
}
.benefits-list li:last-child { border: none; }

/* Accordion */
.accordion { max-width: 700px; margin: 0 auto; }
.accordion-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: var(--card);
}
.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-heading);
  user-select: none;
}
.accordion-header::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
}
.accordion-item.open .accordion-header::after {
  content: '−';
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-item.open .accordion-body {
  max-height: 500px;
}
.accordion-body-inner {
  padding: 0 1.25rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.accordion-body-inner ul { padding-left: 1.25rem; margin-top: 0.5rem; }
.accordion-body-inner li { margin-bottom: 0.3rem; }

/* Pricing cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  position: relative;
}
.pricing-card.featured { border-color: var(--primary); }
.pricing-card.featured::before {
  content: '⭐ Più popolare';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 1rem;
  border-radius: 2rem;
}
.pricing-card h3 { margin-bottom: 0.5rem; }
.pricing-price {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0.75rem 0;
}
.pricing-price span { font-size: 1rem; color: var(--text-secondary); font-weight: 400; }
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  text-align: left;
}
.pricing-features li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Footer */
.landing-footer {
  background: var(--sidebar-bg);
  color: #A5B4FC;
  padding: 2.5rem 2rem;
  text-align: center;
}
.landing-footer a { color: #C7D2FE; }
.landing-footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem; font-size: 0.85rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    transition: left 0.3s ease;
    z-index: 300;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay.show { display: block; }
  .hamburger { display: flex; }
  .course-main { padding: 1.5rem 1rem; }
}

@media (max-width: 768px) {
  .hero { padding: 3rem 1.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .section { padding: 3rem 1.5rem; }
  .section h2 { font-size: 1.5rem; }
  .pricing-grid { grid-template-columns: 1fr; }
  .lesson-nav { flex-direction: column; gap: 0.75rem; }
  .lesson-nav .btn { width: 100%; }
  .landing-nav { padding: 1rem; }
  .landing-nav-links { gap: 0.75rem; }
  .auth-card { padding: 1.5rem; }
  h1 { font-size: 1.75rem; }
}

/* ===== PRICING PAGE ===== */
.pricing-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 3rem 1.5rem;
}
.pricing-page h1 { text-align: center; margin-bottom: 0.5rem; }
.pricing-page .pricing-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 2.5rem; }
