/* ── RESET & FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --violet: #525ddc;
  --violet2: #8D4ED8;
  --noir: #0A0909;
  --surface: #111018;
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(141,78,216,0.2);
  --glass-hover: rgba(82,93,220,0.3);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.55);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius-card: 16px;
  --radius-btn: 50px;
  --radius-input: 12px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--noir);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── HEADER ── */
.header {
  position: sticky; top: 0; z-index: 100;
  padding: 14px 20px;
  background: rgba(10,9,9,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
}
.header-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1rem; color: var(--text);
}
.header-brand svg { flex-shrink: 0; }

/* ── MAIN / SCREENS ── */
main { max-width: 680px; margin: 0 auto; padding: 24px 16px 80px; }
.screen { display: none; }
.screen.active { display: block; }

/* ── HERO ── */
.hero { text-align: center; padding: 32px 0 28px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 50px; padding: 6px 16px;
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 20px; backdrop-filter: blur(8px);
}
.hero h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 700; line-height: 1.2; margin-bottom: 14px;
}
.hero h1 span {
  background: linear-gradient(135deg, #00e5ff, #d946ef, #ff1744);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { color: var(--text-muted); font-size: 1rem; max-width: 480px; margin: 0 auto; }

/* ── MODULE CARDS ── */
.modules-grid { display: grid; gap: 16px; margin: 8px 0 24px; }
@media (min-width: 540px) { .modules-grid { grid-template-columns: 1fr 1fr; } }

.module-card {
  display: flex; flex-direction: column;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-card); padding: 22px;
  cursor: pointer; transition: all 0.3s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.module-card:hover { border-color: var(--violet); background: var(--glass-hover); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(82,93,220,0.15); }

.module-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; color: #fff;
}
.module-tag {
  font-size: 0.72rem; font-weight: 600; color: var(--violet);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
}
.module-card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.module-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.module-meta { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }

/* ── CONFIDENTIALITY ── */
.confidentiality {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 14px 16px;
  font-size: 0.82rem; color: var(--text-muted);
  backdrop-filter: blur(8px);
}
.confidentiality svg { flex-shrink: 0; margin-top: 1px; color: var(--violet2); }

/* ── MODULE HEADER ── */
.module-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.module-title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.step-counter {
  font-size: 0.8rem; color: var(--text-muted);
  background: var(--glass); border: 1px solid var(--glass-border);
  padding: 4px 10px; border-radius: 50px;
}
.text-sm { font-size: 0.82rem; }
.text-muted { color: var(--text-muted); }

/* ── BUTTONS ── */
.btn-back, .btn-home {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.btn-back:hover, .btn-home:hover { border-color: var(--violet); background: var(--glass-hover); }

.btn-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; border-radius: var(--radius-btn);
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  color: #fff; font-family: 'Poppins', sans-serif;
  font-size: 0.95rem; font-weight: 600; border: none; cursor: pointer;
  transition: all 0.25s; box-shadow: 0 4px 20px rgba(82,93,220,0.3);
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(82,93,220,0.45); }
.btn-cta:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 20px; border-radius: var(--radius-btn);
  background: transparent; border: 1px solid var(--glass-border);
  color: var(--text); font-family: 'Poppins', sans-serif;
  font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.25s;
}
.btn-secondary:hover { border-color: var(--violet); background: rgba(82,93,220,0.1); }

/* ── PROGRESS BAR ── */
.progress-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 24px; }
.progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--violet), var(--violet2), #d946ef); transition: width 0.4s ease; }

/* ── VERBATIM CARD ── */
.verbatim-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-card); padding: 20px; margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.verbatim-label { font-size: 0.72rem; font-weight: 600; color: var(--violet); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.verbatim-context { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; font-style: italic; }
.verbatim-text { font-size: 0.97rem; line-height: 1.65; font-style: italic; color: var(--text); }

/* ── INTRO INSTRUCTIONS ── */
.intro-instructions {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-card); padding: 20px; margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.intro-instructions-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 12px; }
.intro-instructions-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.intro-instructions-list li { font-size: 0.88rem; color: var(--text-muted); padding-left: 16px; position: relative; line-height: 1.5; }
.intro-instructions-list li::before { content: '→'; position: absolute; left: 0; color: var(--violet); font-weight: 600; }
.intro-instructions-note { font-size: 0.78rem; color: var(--text-muted); padding-top: 10px; border-top: 1px solid var(--glass-border); }

/* ── EXAMPLE BLOCK ── */
.example-block {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-card); padding: 20px; margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.example-block h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; color: var(--text-muted); }
.example-item { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border); }
.example-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.example-item-label { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; }
.example-item-label.error { color: var(--error); }
.example-item-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }

/* ── OSBD CHECKS ── */
.osbd-checks {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-card); padding: 20px; margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.osbd-checks-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 14px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--glass-border); }
.check-row:last-child { border-bottom: none; }
.check-label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.check-letter {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.82rem; flex-shrink: 0;
}
.check-name { font-weight: 500; font-size: 0.92rem; }
.check-input { display: none; }
.check-box {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
  background: transparent;
}
.check-box svg { opacity: 0; transition: opacity 0.15s; }
.check-input:checked + .check-box { background: var(--violet); border-color: var(--violet); }
.check-input:checked + .check-box svg { opacity: 1; }
.check-input:disabled + .check-box { opacity: 0.5; cursor: not-allowed; }
.check-help {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-muted); font-size: 0.72rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.check-help:hover { border-color: var(--violet); color: var(--violet); }

/* ── FEEDBACK CARDS ── */
.feedback-summary {
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px;
}
.summary-row { display: flex; align-items: center; gap: 12px; }
.summary-label { font-size: 0.78rem; color: var(--text-muted); width: 110px; flex-shrink: 0; }
.summary-cells { display: flex; gap: 8px; }
.summary-cell { display: flex; align-items: center; gap: 5px; }
.summary-letter { font-weight: 700; font-size: 0.82rem; }
.summary-icon { width: 18px; height: 18px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.summary-icon.checked { background: rgba(16,185,129,0.2); color: var(--success); }
.summary-icon.unchecked { background: rgba(239,68,68,0.2); color: var(--error); }

.feedback-card {
  background: var(--glass); border-radius: 12px; padding: 16px; margin-bottom: 10px;
  border-left: 3px solid transparent;
}
.feedback-card.success { border-left-color: var(--success); background: rgba(16,185,129,0.06); }
.feedback-card.error { border-left-color: var(--error); background: rgba(239,68,68,0.06); }

.feedback-card-header { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.feedback-icon { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feedback-icon.success { background: rgba(16,185,129,0.2); color: var(--success); }
.feedback-icon.error { background: rgba(239,68,68,0.2); color: var(--error); }
.feedback-letter { font-weight: 700; font-size: 0.88rem; }
.feedback-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }

/* ── AI FEEDBACK CARD ── */
.ai-feedback-card { border-radius: 12px; padding: 16px; margin-bottom: 14px; border: 1px solid; }
.ai-feedback-card.valide { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3); }
.ai-feedback-card.reformuler { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.3); }
.ai-feedback-header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.88rem; margin-bottom: 8px; }
.ai-feedback-header.valide { color: var(--success); }
.ai-feedback-header.reformuler { color: var(--warning); }
.ai-feedback-text { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }
.ai-feedback-question { margin-top: 10px; font-size: 0.88rem; font-style: italic; color: var(--text); padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); }

/* ── POINT CARD ── */
.point-card {
  background: rgba(82,93,220,0.08); border: 1px solid rgba(82,93,220,0.25);
  border-radius: 12px; padding: 16px; margin-bottom: 14px;
}
.point-card-header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.85rem; color: var(--violet); margin-bottom: 8px; }
.point-card-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }

/* ── REFORMULATION CARD ── */
.reformulation-card {
  background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.2);
  border-radius: 12px; padding: 16px; margin-bottom: 20px;
}
.reformulation-label { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--success); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; }
.reformulation-text { font-size: 0.88rem; line-height: 1.65; font-style: italic; color: var(--text-muted); }

/* ── RESULTS ── */
.results-score { text-align: center; padding: 24px 0; }
.score-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  margin: 0 auto 16px; box-shadow: 0 6px 24px rgba(82,93,220,0.4);
}
.score-num { font-size: 2rem; font-weight: 700; line-height: 1; }
.score-total { font-size: 0.75rem; opacity: 0.8; }
.results-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.results-subtitle { font-size: 0.88rem; color: var(--text-muted); max-width: 380px; margin: 0 auto 24px; line-height: 1.5; }
.stat-bars { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.stat-bar-row { display: flex; align-items: center; gap: 10px; }
.stat-bar-label { display: flex; align-items: center; gap: 8px; width: 130px; flex-shrink: 0; }
.stat-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--violet2)); border-radius: 3px; transition: width 0.6s ease; }
.stat-bar-count { font-size: 0.78rem; color: var(--text-muted); width: 36px; text-align: right; flex-shrink: 0; }

/* ── MODULE 2 ── */
.situation-input-area { margin-bottom: 18px; }
.situation-input-area label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }
.situation-textarea, .component-textarea {
  width: 100%; border-radius: var(--radius-input);
  border: 1px solid var(--glass-border); background: var(--glass);
  color: var(--text); font-family: 'Poppins', sans-serif; font-size: 0.9rem;
  padding: 12px 14px; resize: vertical; line-height: 1.55;
  backdrop-filter: blur(8px); transition: border-color 0.2s;
}
.situation-textarea { min-height: 90px; }
.component-textarea { min-height: 70px; }
.situation-textarea:focus, .component-textarea:focus { outline: none; border-color: var(--violet); }
.situation-textarea::placeholder, .component-textarea::placeholder { color: var(--text-muted); opacity: 0.6; }

.divider { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin: 10px 0 16px; position: relative; }
.divider::before, .divider::after { content: ''; display: inline-block; width: 30%; height: 1px; background: var(--glass-border); vertical-align: middle; margin: 0 10px; }

.situations-type-grid { display: grid; gap: 8px; margin-bottom: 20px; }
.situation-type-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: all 0.2s;
}
.situation-type-item:hover { border-color: var(--violet); background: rgba(82,93,220,0.1); }
.situation-type-item.selected { border-color: var(--violet); background: rgba(82,93,220,0.18); box-shadow: 0 0 16px rgba(82,93,220,0.15); }
.situation-type-num {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; flex-shrink: 0;
}
.situation-type-text { font-size: 0.88rem; line-height: 1.4; }

/* ── STEP PILLS ── */
.step-pills { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.step-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 50px; font-size: 0.82rem; font-weight: 500;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-muted); white-space: nowrap; flex-shrink: 0; transition: all 0.2s;
}
.step-pill span { font-weight: 700; color: var(--violet); }
.step-pill.active { background: rgba(82,93,220,0.2); border-color: var(--violet); color: var(--text); }
.step-pill.done { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.35); color: var(--success); }
.step-pill.done span { color: var(--success); }

.component-hint { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* ── HELPER CARDS ── */
.helper-example-card {
  background: rgba(82,93,220,0.08); border: 1px solid rgba(82,93,220,0.2);
  border-radius: 10px; padding: 14px; margin-top: 10px;
}
.helper-label { font-size: 0.75rem; font-weight: 600; color: var(--violet); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
.helper-text { font-size: 0.85rem; color: var(--text-muted); font-style: italic; line-height: 1.5; }
.suggestion-note { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin-top: 6px; }

/* ── ASSEMBLED ── */
.assembled-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-card); padding: 22px; margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.assembled-label { font-size: 0.72rem; font-weight: 600; color: var(--violet); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.assembled-text p { font-size: 0.92rem; line-height: 1.65; color: var(--text-muted); }
.assembled-text strong { color: var(--text); }

/* ── LOADER ── */
.loader { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px; }
.loader-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--glass-border); border-top-color: var(--violet); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 0.85rem; color: var(--text-muted); }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(10,9,9,0.75); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #1a1824; border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 28px; max-width: 420px; width: 100%;
  position: relative; box-shadow: 0 16px 64px rgba(0,0,0,0.6);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { border-color: var(--error); color: var(--error); }
.modal-letter {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; margin-bottom: 12px;
}
.modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }
.modal p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
.modal strong { color: var(--text); }
.modal em { color: var(--text); }
.modal .accent { color: var(--violet); font-weight: 600; }
.modal ul { margin-left: 16px; margin-bottom: 8px; }
.modal li { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 3px; }

/* ── FOOTER ── */
.footer { text-align: center; padding: 20px 16px; font-size: 0.78rem; color: var(--text-muted); border-top: 1px solid var(--glass-border); margin-top: 40px; }
.footer strong { color: var(--violet2); }

.module-card .btn-cta { margin-top: auto; }
