:root {
  --ink: #10241d;
  --muted: #617069;
  --paper: #f5f3ec;
  --surface: #fffefa;
  --line: #dfe3dc;
  --green: #0b5e43;
  --green-deep: #071f17;
  --green-soft: #dceee5;
  --gold: #b18a42;
  --danger: #a23030;
  --shadow: 0 24px 64px rgba(7, 31, 23, 0.1);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(177, 138, 66, 0.12), transparent 26rem),
    var(--paper);
  font-family: "Tajawal", sans-serif;
  line-height: 1.75;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header,
.site-footer,
.hero,
.progress-panel,
.result-shell {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-header a:hover,
.site-footer a:hover {
  color: var(--green);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 700;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green-deep);
  border-radius: 12px;
}

.hero {
  min-height: 610px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(42px, 7vw, 90px);
  align-items: center;
  padding-block: 72px 92px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  font-family: "Noto Kufi Arabic", sans-serif;
  line-height: 1.45;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  letter-spacing: -0.04em;
}

.hero-lead {
  max-width: 620px;
  margin: 24px 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.trust-list li::before {
  content: "✓";
  margin-left: 8px;
  color: var(--green);
  font-weight: 700;
}

.tool-card,
.progress-panel,
.result-shell {
  background: var(--surface);
  border: 1px solid rgba(11, 94, 67, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-card {
  padding: clamp(26px, 4vw, 42px);
}

.tool-column {
  display: grid;
  gap: 18px;
}

.result-preview {
  padding: 22px;
  color: #fff;
  background: var(--green-deep);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.preview-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.preview-heading .eyebrow {
  color: #d6bd84;
}

.preview-badge {
  flex: none;
  padding: 5px 9px;
  color: #f1e4c6;
  background: rgba(177, 138, 66, 0.18);
  border: 1px solid rgba(214, 189, 132, 0.28);
  border-radius: 999px;
  font-size: 0.7rem;
}

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

.preview-card {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.preview-card span {
  color: #d6bd84;
  font-size: 0.72rem;
  font-weight: 700;
}

.preview-card h3 {
  margin: 6px 0 4px;
  font-size: 0.78rem;
}

.preview-card p,
.preview-footnote {
  margin: 0;
  color: #cbd8d2;
  font-size: 0.74rem;
  line-height: 1.6;
}

.preview-footnote {
  margin-top: 12px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  min-width: 0;
  min-height: 58px;
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(11, 94, 67, 0.1);
}

.primary-button,
.secondary-button,
.whatsapp-button,
.text-button {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 13px;
  border: 0;
  font-weight: 700;
}

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

.primary-button:hover,
.whatsapp-button:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.submit-guidance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px 14px;
  color: var(--green-deep);
  background: var(--green-soft);
  border: 1px solid rgba(11, 94, 67, 0.16);
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.submit-guidance::before {
  content: "↓";
  flex: none;
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 700;
}

.submit-guidance strong,
.submit-guidance span {
  display: block;
}

.submit-guidance[hidden] {
  display: none;
}

.secondary-button,
.text-button {
  color: var(--green);
  background: var(--green-soft);
}

.field-help,
.form-error,
.candidate-list {
  margin: 10px 2px 0;
  font-size: 0.9rem;
}

.field-help,
.muted {
  color: var(--muted);
}

.form-error {
  color: var(--danger);
}

.candidate-list {
  padding: 16px;
  background: #f7f5ed;
  border-radius: 14px;
}

.candidate-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.candidate-buttons button {
  padding: 8px 12px;
  color: var(--green);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.progress-panel {
  margin-bottom: 72px;
  padding: clamp(26px, 5vw, 48px);
}

.progress-heading,
.result-header,
.qualified-action,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.progress-heading h2,
.result-header h2 {
  margin: 0;
}

.progress-percent {
  color: var(--gold);
  font-size: 1.6rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  margin: 28px 0;
  overflow: hidden;
  background: var(--green-soft);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: transform 0.35s ease;
  transform-origin: right;
}

.stage-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.stage-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.stage-list li.is-active,
.stage-list li.is-done {
  color: var(--green);
  background: var(--green-soft);
  border-color: transparent;
}

.result-shell {
  margin-bottom: 92px;
  padding: clamp(24px, 5vw, 54px);
}

.result-header {
  margin-bottom: 32px;
}

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

.result-card,
.sources-panel {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.result-card--identity {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--green-deep);
  border-color: transparent;
}

.result-card h3,
.sources-panel h3,
.qualified-action h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.result-card p,
.result-card ul {
  margin: 0;
}

.result-card ul {
  padding-right: 20px;
}

.period-switcher {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.period-button {
  min-width: 92px;
  padding: 9px 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
}

.period-button.is-active {
  color: #fff;
  background: var(--green);
}

.period-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.technical-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.technical-summary article {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.technical-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.technical-summary strong {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 1.05rem;
}

.technical-chart-card {
  margin-bottom: 14px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.technical-chart-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.technical-chart-card h3,
.technical-chart-card p {
  margin: 0;
}

.technical-chart-card p {
  color: var(--muted);
  font-size: 0.86rem;
}

.technical-chart {
  width: 100%;
  height: auto;
  min-height: 240px;
  margin-top: 20px;
  background:
    linear-gradient(to bottom, transparent 24%, var(--line) 25%, transparent 26%),
    linear-gradient(to bottom, transparent 49%, var(--line) 50%, transparent 51%),
    linear-gradient(to bottom, transparent 74%, var(--line) 75%, transparent 76%),
    #fffefa;
  border-radius: 12px;
}

.technical-chart .candle-up {
  fill: #168665;
  stroke: #0b5e43;
}

.technical-chart .candle-down {
  fill: #b7554d;
  stroke: #8e342f;
}

.technical-chart .volume-up {
  fill: rgba(22, 134, 101, 0.28);
}

.technical-chart .volume-down {
  fill: rgba(183, 85, 77, 0.25);
}

.technical-grid dl,
.technical-grid ul {
  margin: 0;
}

.technical-grid dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
}

.technical-grid dt {
  color: var(--muted);
}

.technical-grid dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.sources-panel {
  margin-top: 14px;
}

.source-list {
  padding-right: 22px;
}

.source-list a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.limitations {
  padding: 18px;
  color: var(--muted);
  background: #f3f1e9;
  border-radius: 12px;
}

.qualified-action {
  margin: 0 0 14px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #143d30, var(--green-deep));
  border-radius: 16px;
}

.qualified-action p {
  margin: 4px 0 0;
  color: #d1ddd7;
}

.whatsapp-button {
  flex: none;
  color: var(--green-deep);
  background: #82e7ad;
}

.whatsapp-floating-action {
  position: fixed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  right: clamp(16px, 4vw, 32px);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  min-height: 52px;
  padding: 0 22px;
  color: var(--green-deep);
  font-weight: 700;
  background: #82e7ad;
  border: 1px solid rgba(7, 31, 23, 0.18);
  border-radius: 999px;
  box-shadow: 0 16px 36px rgba(7, 31, 23, 0.24);
  transition: transform 160ms ease, opacity 160ms ease;
}

.whatsapp-floating-action:hover {
  transform: translateY(-2px);
}

.whatsapp-button:disabled,
.whatsapp-floating-action:disabled {
  color: #58655f;
  cursor: not-allowed;
  background: #d8dfdb;
  border-color: rgba(7, 31, 23, 0.1);
  box-shadow: none;
  opacity: 0.92;
}

.whatsapp-floating-action:disabled:hover {
  transform: none;
}

.site-footer {
  min-height: 110px;
  padding-block: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.consent-banner {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 18px;
  left: 18px;
  max-width: 640px;
  margin-right: auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  background: var(--green-deep);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.consent-banner h2,
.consent-banner p {
  margin: 0;
}

.consent-banner h2 {
  font-size: 0.9rem;
}

.consent-banner p {
  color: #cbd8d2;
  font-size: 0.8rem;
  line-height: 1.55;
}

.consent-actions {
  display: flex;
  gap: 8px;
}

.consent-actions button {
  flex: 1;
  min-height: 42px;
  padding-inline: 10px;
  font-size: 0.82rem;
}

[hidden] {
  display: none !important;
}

.doc-main {
  width: min(780px, calc(100% - 36px));
  min-height: calc(100vh - 188px);
  margin: 0 auto;
  padding: 64px 0 92px;
}

.doc-main h1 {
  max-width: none;
  margin-bottom: 30px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.doc-section {
  margin: 26px 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.doc-section h2 {
  margin-top: 0;
  font-size: 1.12rem;
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 52px 70px;
  }

  h1 {
    max-width: none;
  }

  .result-grid,
  .technical-summary {
    grid-template-columns: 1fr;
  }

  .technical-chart-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-card--identity {
    grid-column: auto;
  }

  .qualified-action,
  .consent-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-badge {
    align-self: flex-start;
  }
}

@media (max-width: 600px) {
  .whatsapp-floating-action {
    right: 16px;
    left: 16px;
    width: calc(100% - 32px);
  }

  .site-header {
    min-height: 68px;
  }

  .site-header nav {
    display: none;
  }

  .site-header,
  .site-footer,
  .hero,
  .progress-panel,
  .result-shell {
    width: min(100% - 24px, 1160px);
  }

  .input-row {
    grid-template-columns: 1fr;
  }

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

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .progress-heading,
  .result-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
