:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(6,182,212,0.1) 0%, transparent 40%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99,102,241,0.2);
  border: 1px solid rgba(99,102,241,0.4);
  color: #a5b4fc;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  position: relative;
}

.hero h1 span { color: #818cf8; }

.hero-sub {
  color: #94a3b8;
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Main Layout ── */
.main {
  max-width: 1100px;
  margin: -2rem auto 3rem;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}

/* ── Progress ── */
.progress-bar-wrap {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-fill {
  position: absolute;
  top: 18px;
  left: 10%;
  height: 2px;
  background: var(--primary);
  z-index: 1;
  transition: width 0.4s ease;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 2;
  flex: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.3s ease;
}

.progress-step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
}

.progress-step.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
}

.progress-step.active .step-label { color: var(--primary); font-weight: 600; }

/* ── Step Panels ── */
.step-panel {
  display: none;
  padding: 2rem;
  animation: fadeUp 0.4s ease;
}

.step-panel.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.panel-desc {
  color: var(--muted);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

/* ── Category Tabs ── */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.cat-tab {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
}

.cat-tab:hover { border-color: var(--primary); color: var(--primary); }

.cat-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Platform Grid ── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.platform-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: var(--surface2);
  position: relative;
}

.platform-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}

.platform-card.selected {
  border-color: var(--primary);
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.platform-card.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.platform-icon { font-size: 1.75rem; margin-bottom: 0.4rem; }

.platform-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.platform-cat {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ── Custom Text ── */
.custom-section {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

.custom-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-section summary::before { content: '＋'; font-size: 1rem; }
.custom-section[open] summary::before { content: '－'; }

.custom-textarea {
  width: 100%;
  height: 160px;
  margin-top: 1rem;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  background: var(--surface2);
  transition: border-color 0.2s;
}

.custom-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

/* ── Student Info ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── Buttons ── */
.btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

#step4 .report-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 1.5rem;
  padding: 1rem 0 0.25rem;
  background: linear-gradient(to top, var(--surface) 70%, rgba(255, 255, 255, 0.95));
  border-top: 1px solid var(--border);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-analyze {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 1rem;
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}

/* ── Analysis View ── */
.analysis-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.analysis-platform-icon { font-size: 2.5rem; }

.analysis-platform-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.analysis-platform-cat {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Risk Score ── */
.risk-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: center;
}

@media (max-width: 600px) { .risk-section { grid-template-columns: 1fr; } }

.risk-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.risk-gauge {
  width: 160px;
  height: 160px;
  position: relative;
}

.risk-gauge svg { transform: rotate(-90deg); }

.risk-gauge-bg { fill: none; stroke: #e2e8f0; stroke-width: 12; }

.risk-gauge-fill {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease, stroke 0.5s;
}

.risk-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.risk-score-val {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.risk-score-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-verdict {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.risk-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }

.risk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.risk-tag {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-danger { background: #fef2f2; color: #991b1b; }
.tag-warning { background: #fffbeb; color: #92400e; }
.tag-success { background: #f0fdf4; color: #166534; }

/* ── Findings ── */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.finding-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem;
  transition: all 0.2s;
}

.finding-card.found {
  border-color: currentColor;
  background: var(--surface2);
}

.finding-card.not-found { opacity: 0.55; }

.finding-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.finding-icon { font-size: 1.25rem; }

.finding-label {
  font-weight: 700;
  font-size: 0.9rem;
  flex: 1;
}

.finding-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.status-found { background: #dcfce7; color: #166534; }
.status-missing { background: #fee2e2; color: #991b1b; }

.finding-excerpt {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  border-left: 3px solid var(--border);
  padding-left: 0.75rem;
}

.finding-excerpt mark {
  background: #fef08a;
  color: #854d0e;
  padding: 0.1em 0.2em;
  border-radius: 3px;
  font-weight: 600;
}

/* ── Legal Mapping ── */
.legal-section { margin-bottom: 2rem; }

.legal-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.legal-table th {
  background: var(--surface2);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}

.legal-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.law-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}

.law-gdpr { background: #dbeafe; color: #1e40af; }
.law-kvkk { background: #fce7f3; color: #9d174d; }

/* ── Ethics Report Card ── */
.report-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: var(--radius);
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.report-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 70%);
  pointer-events: none;
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  position: relative;
}

.report-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a5b4fc;
  margin-bottom: 0.25rem;
}

.report-card-subtitle {
  font-size: 1.4rem;
  font-weight: 800;
}

.report-score-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 80px;
}

.report-score-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.report-score-sub {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}

@media (max-width: 600px) { .report-meta { grid-template-columns: 1fr; } }

.report-meta-item label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}

.report-meta-item span {
  font-size: 0.9rem;
  font-weight: 600;
}

.report-findings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.report-finding-pill {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.report-finding-pill.danger { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.4); }
.report-finding-pill.safe { background: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.4); }

.report-recommendation {
  background: rgba(255,255,255,0.07);
  border-left: 3px solid #818cf8;
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #cbd5e1;
  position: relative;
}

.report-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #64748b;
  position: relative;
}

/* ── ToS Preview ── */
.tos-preview {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.8;
  max-height: 280px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  margin-bottom: 1.5rem;
  border: 1px solid #334155;
}

.tos-preview mark {
  background: #fef08a;
  color: #1e293b;
  padding: 0.1em 0.25em;
  border-radius: 3px;
  font-weight: 700;
}

/* ── Loading ── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  pointer-events: none;
}

.loading-overlay.active {
  display: flex;
  pointer-events: auto;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(99,102,241,0.2);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.loading-step {
  color: #475569;
  font-size: 0.85rem;
  transition: color 0.3s;
}

.loading-step.active { color: #818cf8; }
.loading-step.done { color: #10b981; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #475569;
  font-size: 0.8rem;
}

.footer a { color: #818cf8; text-decoration: none; }

/* ── Screenshot hint ── */
.screenshot-hint {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* ── Compare mode ── */
.compare-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #3730a3;
}

.compare-count {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-weight: 700;
  font-size: 0.8rem;
}
