@font-face {
  font-family: Vazirmatn;
  src: url("/assets/Vazirmatn-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #123e5a;
  --navy-deep: #0b2c40;
  --teal: #2798a5;
  --teal-dark: #1b7b88;
  --teal-soft: #dff2f3;
  --cream: #f8f5e9;
  --paper: #fffefa;
  --ink: #171b1c;
  --muted: #66747b;
  --line: #d5dee3;
  --line-strong: #b9c9d0;
  --danger: #b42318;
  --success: #11734b;
  --warning: #8a5b00;
  --shadow: 0 22px 60px rgba(11, 44, 64, 0.11);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(39, 152, 165, 0.18), transparent 34rem),
    radial-gradient(circle at 100% 35%, rgba(18, 62, 90, 0.08), transparent 38rem),
    linear-gradient(150deg, #fbfaf4 0%, #edf5f5 100%);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  line-height: 1.75;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  margin-bottom: 28px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker,
.finding-number {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.eyebrow::before {
  width: 30px;
  height: 3px;
  background: var(--teal);
  border-radius: 99px;
  content: "";
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.65rem, 7vw, 5.4rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

h1 span {
  color: var(--teal-dark);
}

h2,
h3 {
  margin: 0;
  color: var(--navy);
  line-height: 1.35;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  font-size: 1.08rem;
}

.lede {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.trust-row span {
  padding: 6px 11px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(185, 201, 208, 0.8);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.local-mark {
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  color: white;
  background: var(--navy);
  border: 8px solid rgba(255, 255, 255, 0.62);
  border-radius: 36px 10px 36px 10px;
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
}

.local-mark strong {
  align-self: end;
  font-size: 2.25rem;
  line-height: 1;
}

.local-mark span {
  align-self: start;
  color: #9fe2e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.privacy-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px;
  margin-bottom: 22px;
  color: white;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 14px 35px rgba(11, 44, 64, 0.15);
}

.privacy-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--navy);
  background: #a9e5e9;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 900;
}

.privacy-banner h2 {
  color: white;
  font-size: 1rem;
}

.privacy-banner p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
}

.tabs {
  display: flex;
  gap: 6px;
  width: fit-content;
  padding: 5px;
  margin-bottom: 14px;
  background: rgba(18, 62, 90, 0.08);
  border: 1px solid rgba(18, 62, 90, 0.06);
  border-radius: 15px;
}

.tab {
  min-height: 43px;
  padding: 9px 18px;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
}

.tab[aria-selected="true"] {
  color: white;
  background: var(--navy);
  box-shadow: 0 6px 16px rgba(18, 62, 90, 0.2);
}

.tab:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(39, 152, 165, 0.3);
  outline-offset: 2px;
}

.panel {
  padding: clamp(22px, 4vw, 38px);
  background: var(--paper);
  border: 1px solid rgba(213, 222, 227, 0.94);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.panel-head,
.ai-settings-head,
.subsection-head,
.finding-head,
.actions,
.connection-actions {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-head {
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.panel-head > div {
  max-width: 730px;
}

.panel-head p:not(.section-kicker),
.action-note,
.connection-actions p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.badge {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.badge-local {
  color: var(--success);
  background: #e5f6ee;
}

.badge-ai {
  color: #175cd3;
  background: #eaf2ff;
}

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

.compact-grid {
  gap: 13px;
}

.full {
  grid-column: 1 / -1;
}

label,
legend {
  color: var(--navy-deep);
  font-size: 0.88rem;
  font-weight: 800;
}

label > span {
  display: block;
  margin-bottom: 7px;
}

small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input,
select {
  min-height: 48px;
  padding: 10px 12px;
}

textarea {
  min-height: 160px;
  padding: 13px 14px;
  resize: vertical;
}

.compact-grid textarea {
  min-height: 100px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(39, 152, 165, 0.11);
}

input[type="file"] {
  padding: 7px;
  background: var(--cream);
}

input[type="radio"] {
  width: 17px;
  min-height: 17px;
  padding: 0;
  accent-color: var(--teal);
}

fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

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

.choice {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 11px;
  color: var(--navy);
  background: #f5f8f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 750;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.choice:has(input:checked) {
  background: var(--teal-soft);
  border-color: rgba(39, 152, 165, 0.55);
}

.choice span {
  margin: 0;
}

.ai-settings {
  padding: 20px;
  margin-top: 24px;
  background:
    linear-gradient(135deg, rgba(234, 242, 255, 0.78), rgba(223, 242, 243, 0.58));
  border: 1px solid #bfd4e6;
  border-radius: 18px;
}

.ai-settings-head {
  margin-bottom: 16px;
}

.connection-actions {
  align-items: center;
  margin-top: 14px;
}

.connection-actions p {
  max-width: 520px;
  text-align: left;
}

.actions {
  align-items: center;
  padding-top: 24px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.action-note {
  max-width: 620px;
}

.primary,
.secondary,
.danger-button,
.primary-link {
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  box-shadow: 0 9px 20px rgba(39, 152, 165, 0.22);
}

.primary:hover {
  filter: brightness(0.96);
}

.primary:disabled,
.secondary:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary {
  color: var(--navy);
  background: var(--teal-soft);
}

.danger-button {
  min-height: 38px;
  padding: 7px 11px;
  color: var(--danger);
  background: #fff0ee;
}

.status {
  display: none;
  width: 100%;
  padding: 14px 16px;
  margin-top: 17px;
  border-radius: 12px;
  font-size: 0.86rem;
  white-space: pre-line;
}

.status.visible {
  display: block;
}

.status.loading {
  color: var(--navy);
  background: var(--teal-soft);
  border: 1px solid rgba(39, 152, 165, 0.2);
}

.status.loading::before {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 9px;
  vertical-align: -2px;
  border: 2px solid rgba(18, 62, 90, 0.2);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.72s linear infinite;
  content: "";
}

.status.success {
  color: var(--success);
  background: #e6f6ef;
  border: 1px solid #bde7d4;
}

.status.error {
  color: var(--danger);
  background: #fff0ee;
  border: 1px solid #f6c8c3;
}

.status.warning {
  color: var(--warning);
  background: #fff8e5;
  border: 1px solid #efdba2;
}

.subsection-head {
  align-items: center;
  padding: 22px 0 14px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.finding-list {
  display: grid;
  gap: 14px;
}

.finding {
  padding: 18px;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 17px;
}

.finding-head {
  align-items: center;
  margin-bottom: 16px;
}

.finding-number {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.65rem;
}

.grid-spacer {
  min-height: 1px;
}

.conclusion-grid {
  margin-top: 18px;
}

.architecture {
  padding: 30px;
  margin-top: 24px;
  background: rgba(255, 254, 250, 0.72);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.architecture-head {
  margin-bottom: 20px;
}

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

.architecture-grid article {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.architecture-grid article > span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 900;
}

.architecture-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer {
  padding: 24px 6px 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

.error-page {
  display: grid;
  place-items: center;
}

.error-card {
  width: min(520px, calc(100% - 32px));
  padding: 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.error-card h1 {
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.primary-link {
  display: inline-grid;
  place-items: center;
  color: white;
  background: var(--teal-dark);
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 28px;
  }

  .hero,
  .form-grid,
  .architecture-grid {
    grid-template-columns: 1fr;
  }

  .local-mark {
    display: none;
  }

  .privacy-banner {
    grid-template-columns: 1fr;
  }

  .panel {
    border-radius: 20px;
  }

  .panel-head,
  .actions,
  .connection-actions {
    flex-direction: column;
  }

  .panel-head .badge {
    align-self: flex-start;
  }

  .primary,
  .secondary {
    width: 100%;
  }

  .connection-actions p {
    text-align: right;
  }

  .grid-spacer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
