:root {
  --bg: #09111f;
  --bg-soft: rgba(11, 24, 43, 0.78);
  --card: rgba(12, 23, 40, 0.84);
  --line: rgba(150, 198, 255, 0.16);
  --text: #eff6ff;
  --muted: #9fb4cf;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.language-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

.language-toggle:hover {
  background: var(--accent-2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 26%),
    radial-gradient(circle at left center, rgba(94, 234, 212, 0.12), transparent 24%),
    linear-gradient(135deg, #07101c 0%, #0e1728 48%, #111827 100%);
}

.page-shell {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
  pointer-events: none;
}

.layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
  position: relative;
  z-index: 1;
}

.hero,
.scanner-card,
.status-card,
.results {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 28px;
}

.hero {
  padding: 34px;
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 24px;
}

.badge,
.notice,
.severity,
.category,
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.badge {
  padding: 8px 14px;
  background: rgba(94, 234, 212, 0.13);
  color: var(--accent);
  border: 1px solid rgba(94, 234, 212, 0.2);
  font-weight: 700;
}

.hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1.2;
}

.hero p,
.card-head p,
.legal-note,
.meta-grid p,
.finding p,
.next-steps li {
  color: var(--muted);
  line-height: 1.8;
}

.project-meta {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.meta-person {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}

.meta-label {
  display: block;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 6px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-points span,
.meta-grid article,
.finding,
.panel-grid article {
  border: 1px solid var(--line);
}

.hero-points span,
.panel-grid article {
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  border-radius: 18px;
}

.panel-grid {
  display: grid;
  gap: 14px;
}

.panel-grid strong {
  display: block;
  margin-bottom: 8px;
}

.scanner-card,
.status-card,
.results {
  margin-top: 22px;
  padding: 28px;
}

.card-head,
.results-header,
.status-card {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: start;
}

.card-head h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.notice {
  padding: 10px 16px;
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.report-link {
  display: inline-block;
  margin-top: 10px;
  color: #99f6e4;
  text-decoration: none;
  font-weight: 700;
}

.report-link:hover {
  text-decoration: underline;
}

.scan-form {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 14px;
}

.scan-form input,
.scan-form button,
.scan-select {
  min-height: 62px;
  border-radius: 18px;
  font: inherit;
}

.scan-form input {
  border: 1px solid rgba(191, 219, 254, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0 20px;
}

.scan-form input:focus {
  outline: 2px solid rgba(94, 234, 212, 0.35);
  border-color: rgba(94, 234, 212, 0.4);
}

.scan-form button {
  border: 0;
  padding: 0 28px;
  font-weight: 800;
  cursor: pointer;
  color: #082032;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 35px rgba(56, 189, 248, 0.24);
}

.scan-select {
  border: 1px solid rgba(191, 219, 254, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0 16px;
}

.scan-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.legal-note {
  margin: 14px 2px 0;
  font-size: 0.95rem;
}

.progress-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.7s ease;
}

.status-card strong {
  font-size: 1.1rem;
}

.score-pill {
  min-width: 110px;
  min-height: 110px;
  background: radial-gradient(circle at top, rgba(94, 234, 212, 0.2), transparent 50%), rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(94, 234, 212, 0.2);
  font-size: 2rem;
  font-weight: 800;
}

.meta-grid,
.findings-grid {
  display: grid;
  gap: 14px;
}

.meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 18px;
}

.meta-grid article,
.finding {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 18px;
}

.narrative-card,
.strengths-panel {
  margin-bottom: 18px;
}

.strengths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.strength-card {
  border: 1px solid rgba(94, 234, 212, 0.16);
  background: rgba(94, 234, 212, 0.06);
  border-radius: 16px;
  padding: 14px;
}

.strength-card h4 {
  margin: 0 0 8px;
}

.badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.1);
  color: #d5fff8;
  border: 1px solid rgba(94, 234, 212, 0.16);
  font-size: 0.85rem;
}

.table-card {
  overflow: hidden;
  margin-bottom: 20px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.report-table th,
.report-table td {
  text-align: right;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.report-table th {
  color: var(--text);
  font-weight: 700;
}

.severity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 20px;
}

.severity {
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 700;
}

.severity.critical {
  color: #ffe4ea;
  background: rgba(251, 113, 133, 0.18);
}

.severity.high {
  color: #ffedd5;
  background: rgba(245, 158, 11, 0.18);
}

.severity.medium {
  color: #dbeafe;
  background: rgba(56, 189, 248, 0.18);
}

.severity.low {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.18);
}

.severity.info {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.18);
}

.findings-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.finding-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.category {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #dbeafe;
  font-size: 0.85rem;
}

.finding h3,
.meta-grid h3,
.findings-title,
.next-steps-title {
  margin: 0 0 10px;
}

.finding .description {
  white-space: pre-line;
}

.next-steps {
  margin: 18px 0 0;
  padding-inline-start: 20px;
}

.next-steps li {
  margin-bottom: 8px;
}

.hidden,
.sr-only {
  display: none;
}

@media (max-width: 860px) {

  .hero,
  .scan-form,
  .card-head,
  .results-header,
  .status-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .scan-form button {
    width: 100%;
  }
}