@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-2: #0c1b2b;
  --panel: rgba(17, 32, 50, 0.78);
  --panel-strong: rgba(21, 39, 60, 0.9);
  --line: rgba(217, 227, 238, 0.16);
  --line-strong: rgba(244, 193, 93, 0.4);
  --text: #eef5fb;
  --muted: #aab7c5;
  --metal: #d9e3ee;
  --orange: #e26f24;
  --gold: #f0b14b;
  --green: #2dd4bf;
  --success: #57d68d;
  --warning: #f5c96f;
  --danger: #ff7a7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Tajawal", Tahoma, Arial, sans-serif;
  background:
    linear-gradient(rgba(7, 17, 31, 0.88), rgba(7, 17, 31, 0.96)),
    url("../assets/images/blueprint-grid.svg") center top / cover fixed,
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(226, 111, 36, 0.1), transparent 32%),
    linear-gradient(240deg, rgba(45, 212, 191, 0.1), transparent 34%);
  z-index: -2;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: #ffd98c;
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.page-watermark {
  position: fixed;
  inset-inline-start: 4vw;
  inset-block-start: 42vh;
  z-index: -1;
  color: rgba(255, 255, 255, 0.035);
  font-size: 72px;
  font-weight: 800;
  transform: rotate(-18deg);
  user-select: none;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px min(5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  min-width: 220px;
}

.brand img,
.panel-heading img,
.btn img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: var(--radius);
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  position: relative;
  min-height: 64vh;
  display: grid;
  grid-template-columns: minmax(0, 760px);
  align-items: center;
  justify-content: start;
  padding: clamp(56px, 8vw, 104px) min(5vw, 64px) 48px;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.25), rgba(7, 17, 31, 0.78)),
    url("../assets/images/blueprint-grid.svg") center / cover;
  opacity: 0.56;
  z-index: -1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: 72px;
  line-height: 1.05;
}

.hero-copy {
  max-width: 680px;
  margin: 18px 0 0;
  color: #d7e2ed;
  font-size: 20px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.hero-note {
  color: var(--muted);
  border-inline-start: 3px solid var(--gold);
  padding-inline-start: 12px;
}

.glass-panel,
.panel,
.metric-card,
.stat-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
}

.panel-heading,
.form-toolbar,
.action-row,
.report-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stat-card strong,
.metric-card strong {
  display: block;
  color: var(--text);
  font-size: 30px;
  line-height: 1.25;
}

.stat-card span,
.metric-card span,
.metric-card small,
.muted {
  color: var(--muted);
}

.notice-band,
.stats-strip,
.app-shell,
.results-shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.notice-band {
  margin-top: -8px;
  padding: 16px 18px;
  border: 1px solid rgba(240, 177, 75, 0.45);
  background: rgba(240, 177, 75, 0.12);
  color: #ffe4ae;
  border-radius: var(--radius);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  padding: 18px;
  min-height: 112px;
}

.stat-card strong {
  margin-top: 8px;
  color: var(--green);
  font-size: 36px;
}

.app-shell,
.results-shell {
  padding-block: 58px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2,
.panel h3 {
  margin: 0;
}

.section-heading h2 {
  font-size: 32px;
}

.project-form,
.panel {
  padding: 22px;
}

.form-toolbar {
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  margin-inline-end: 6px;
  border-radius: var(--radius);
  background: rgba(45, 212, 191, 0.12);
  color: #a8fff0;
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-weight: 700;
}

.muted-pill {
  background: rgba(217, 227, 238, 0.08);
  color: var(--metal);
  border-color: var(--line);
}

.status {
  margin: 0;
  color: var(--muted);
}

.status[data-type="success"] {
  color: var(--success);
}

.status[data-type="warning"] {
  color: var(--warning);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.compact {
  grid-template-columns: minmax(240px, 420px);
  margin-top: 14px;
}

label span,
legend {
  display: block;
  margin-bottom: 7px;
  color: #dce8f4;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 17, 31, 0.72);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 177, 75, 0.14);
}

.toggle-grid,
.choice-grid {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.design-toggle-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.design-style-grid {
  max-width: 480px;
}

.toggle-grid legend,
.choice-grid legend {
  grid-column: 1 / -1;
}

.switch-card,
.choice-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.switch-card input,
.choice-grid input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--orange);
}

.switch-card span,
.choice-grid span {
  margin: 0;
  color: var(--text);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.demo-warning {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(240, 177, 75, 0.38);
  border-radius: var(--radius);
  background: rgba(240, 177, 75, 0.1);
  color: #ffe7b8;
}

.action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn.primary {
  background: linear-gradient(135deg, var(--orange), var(--gold));
  color: #171009;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn.secondary {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.34);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  min-height: 138px;
}

.metric-card.primary {
  border-color: var(--line-strong);
  background: rgba(226, 111, 36, 0.16);
}

.metric-card.success {
  border-color: rgba(87, 214, 141, 0.38);
}

.metric-card.warning {
  border-color: rgba(245, 201, 111, 0.48);
}

.metric-card.danger {
  border-color: rgba(255, 122, 122, 0.48);
}

.metric-card span {
  font-weight: 700;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}

.result-warnings {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.result-warnings p {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(240, 177, 75, 0.35);
  border-radius: var(--radius);
  background: rgba(240, 177, 75, 0.09);
  color: #ffe7b8;
}

.panel {
  margin-top: 18px;
}

.panel-heading {
  align-items: flex-start;
  margin-bottom: 14px;
}

.panel-heading img {
  width: 42px;
  height: 42px;
}

.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.top-list li {
  min-height: 78px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.top-list span,
.top-list strong {
  display: block;
}

.top-list span {
  color: var(--muted);
  margin-bottom: 8px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: #fff7df;
  font-size: 14px;
  background: rgba(240, 177, 75, 0.12);
}

td {
  color: #dbe6f1;
}

.cell-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.code-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.code-title h3,
.code-title p {
  margin: 0;
}

.code-title p {
  color: var(--muted);
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.icon-badge img {
  width: 36px;
  height: 36px;
}

.details-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.details-list div {
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.details-list dt {
  color: var(--muted);
  margin-bottom: 4px;
}

.details-list dd {
  margin: 0;
  color: var(--text);
}

.source-link {
  margin-top: 12px;
}

.official-source-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.official-source-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.official-source-card strong,
.official-source-card span {
  display: block;
}

.official-source-card span {
  color: var(--muted);
  margin-top: 5px;
}

.report-panel {
  margin-bottom: 20px;
}

.design-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.design-output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.design-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.design-output-header span {
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.plan-canvas {
  background: #07111f;
}

.plan-canvas svg,
.plan-canvas img {
  display: block;
  width: 100%;
  height: auto;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  padding: 24px min(5vw, 64px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.82);
}

.site-footer strong {
  color: var(--gold);
}

noscript {
  display: block;
  padding: 16px;
  background: #4a1d1d;
  color: #fff;
  text-align: center;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 60px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toggle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .hero {
    padding-top: 44px;
  }

  .form-grid,
  .summary-grid,
  .stats-strip,
  .design-output-grid,
  .dual-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid,
  .toggle-grid,
  .top-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .details-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .notice-band,
  .app-shell,
  .results-shell {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    padding-inline: 16px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-copy {
    font-size: 18px;
  }

  .choice-grid,
  .toggle-grid,
  .top-list {
    grid-template-columns: 1fr;
  }

  .project-form,
  .panel {
    padding: 16px;
  }

  .report-panel,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-watermark {
    font-size: 44px;
  }
}
