/* The styles of the public website of TrustCode. The pages use only these classes: no inline
   style, except the copy of the email box in index.html, which copies the HTML of
   buildEmailBox (sdk/src/email-box.ts). */

:root {
  --blue: #405189;
  --blue-dark: #2c3a66;
  --blue-light: #e2e5ed;
  --navy: #1b2340;
  --text: #212529;
  --text-muted: #495057;
  --text-soft: #5f6368;
  --border: #e9ebec;
  --border-strong: #ced4da;
  --background: #f3f3f9;
  --surface: #ffffff;
  --green: #0ab39c;
  --green-dark: #077c6c;
  --green-light: #daf4f0;
  --red-dark: #b5412a;
  --red-light: #fde8e4;
  --on-blue: #dfe4f5;
  --on-navy: #c3cae0;
  --focus: #f7b84b;
  --font-text: Inter, system-ui, sans-serif;
  --font-title: 'Space Grotesk', Inter, system-ui, sans-serif;
  --font-code: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 12px;
  --radius-large: 16px;
}

/* --- Base ------------------------------------------------------------------------------- */

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

html {
  scroll-padding-top: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-text);
  line-height: 1.5;
}

a {
  color: var(--blue);
}

a:hover {
  color: var(--blue-dark);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-title);
  color: var(--navy);
  letter-spacing: -0.5px;
}

h3 {
  font-size: 19px;
}

ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

svg {
  flex: none;
}

/* A visible focus on every interactive element, also on the dark sections. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: #ffffff;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.muted {
  color: var(--text-muted);
}

.code {
  font-family: var(--font-code);
  color: var(--text);
}

.nowrap {
  white-space: nowrap;
}

/* --- Header ------------------------------------------------------------------------------ */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.2px;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
  font-size: 15px;
  font-weight: 500;
}

.nav a {
  display: inline-block;
  padding: 12px 0;
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--blue);
}

.nav a[aria-current='page'] {
  color: var(--blue);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--blue);
}

/* --- Sections and titles ----------------------------------------------------------------- */

.band {
  background: var(--surface);
}

.band-bordered {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section {
  padding-top: 88px;
  padding-bottom: 88px;
}

.section-top {
  padding-top: 88px;
  padding-bottom: 40px;
}

.section-middle {
  padding-top: 48px;
  padding-bottom: 48px;
}

.section-title {
  font-size: clamp(28px, 4vw, 36px);
}

.section-lead {
  margin-top: 12px;
  max-width: 680px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
}

.section-title + .grid,
.section-lead + .grid {
  margin-top: 36px;
}

.badge {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.eyebrow {
  color: var(--on-navy);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Hero -------------------------------------------------------------------------------- */

.hero .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
  padding-top: 72px;
  padding-bottom: 80px;
}

.hero-short .container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 64px;
  padding-bottom: 56px;
}

.hero-text {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-title {
  font-size: clamp(34px, 5.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -1px;
}

.hero-title-small {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -1px;
}

.hero-lead {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-muted);
}

.hero-lead strong {
  color: var(--text);
}

.hero-note {
  font-size: 14px;
  color: var(--text-soft);
}

/* --- Buttons ----------------------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--blue);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--blue-dark);
  color: #ffffff;
}

.button-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button-secondary {
  border-color: var(--border-strong);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.button-light {
  background: #ffffff;
  color: var(--blue);
}

.button-outline-light {
  border-color: #aab4da;
  color: #ffffff;
}

.button-outline-light:hover {
  border-color: #ffffff;
  color: #ffffff;
}

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

/* --- Grids and cards --------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid-narrow {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card-plain {
  gap: 8px;
  padding: 24px;
}

.card-plain h3 {
  font-size: 17px;
}

.card p,
.point p {
  color: var(--text-muted);
  line-height: 1.6;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 700;
  font-size: 18px;
}

.point {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.point h3 {
  font-size: 17px;
}

/* --- Home: chat example ------------------------------------------------------------------ */

.chat {
  flex: 1 1 380px;
  min-width: 0;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--blue-light);
  border-radius: 20px;
  background: #eef0f5;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dde1ea;
}

.chat-contact {
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

.chat-contact span {
  font-size: 12px;
  color: var(--text-soft);
}

.bubble-sent {
  align-self: flex-end;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  background: var(--blue);
  color: #ffffff;
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 3px;
}

.bubble-received {
  align-self: flex-start;
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(27, 35, 64, 0.08);
  font-size: 14px;
  line-height: 1.55;
}

.bubble-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.bubble-line svg {
  margin-top: 2px;
}

.bubble-details {
  margin: 8px 0 0 26px;
  color: var(--text-muted);
}

ul.bubble-details li::before {
  content: '• ';
}

ul.bubble-details + .bubble-details {
  margin-top: 0;
}

.bubble-warning {
  margin: 8px 0 0 26px;
  font-weight: 600;
  color: var(--green-dark);
}

.chat figcaption {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
}

/* --- Home: email box, outcomes, official number ------------------------------------------ */

.email-box {
  margin-top: 20px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
}

.email-box-text {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-box-sample {
  flex: 0 1 340px;
  min-width: 0;
}

.outcome {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  border-radius: var(--radius);
}

.outcome p {
  line-height: 1.6;
}

.outcome-valid {
  background: var(--green-light);
}

.outcome-valid h3 {
  color: var(--green-dark);
}

.outcome-valid p {
  color: #1f3d38;
}

.outcome-invalid {
  background: var(--red-light);
}

.outcome-invalid h3 {
  color: var(--red-dark);
}

.outcome-invalid p {
  color: #4a2219;
}

.number-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding: clamp(28px, 5vw, 44px);
  border-radius: var(--radius-large);
  background: var(--blue);
  color: #ffffff;
}

.number-panel h2 {
  color: #ffffff;
  font-size: clamp(28px, 4vw, 34px);
}

.number-text {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.number-text p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--on-blue);
}

.number-panel .number-value {
  margin-top: 6px;
  color: #ffffff;
  font-family: var(--font-code);
  font-size: clamp(22px, 4vw, 26px);
  font-weight: 700;
  letter-spacing: 1px;
}

.number-panel .actions {
  margin-top: 8px;
}

.qr {
  flex: 0 0 auto;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
}

.qr-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 168px;
  padding: 12px;
  border: 2px dashed #aab4da;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

.qr figcaption {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Home: companies --------------------------------------------------------------------- */

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.split-text {
  flex: 1 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.split-text p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

.split-text .button {
  margin-top: 8px;
}

.split-grid {
  flex: 2 1 560px;
  min-width: 0;
}

.split-grid .card {
  background: transparent;
}

.privacy-more {
  margin-top: 32px;
  font-weight: 600;
}

/* --- About: tiles, benefits, lab51 ------------------------------------------------------- */

.tiles {
  flex: 1 1 340px;
  min-width: 0;
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--background);
}

.tile h2 {
  font-size: 20px;
  color: var(--blue);
  letter-spacing: 0;
}

.tile p {
  font-size: 14px;
  color: var(--text-muted);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
}

.panel-header h2 {
  font-size: clamp(26px, 4vw, 32px);
}

.panel-header p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 32px 40px;
}

.benefit {
  display: flex;
  gap: 16px;
}

.benefit div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.benefit h3 {
  font-size: 18px;
}

.benefit p {
  color: var(--text-muted);
  line-height: 1.6;
}

.company {
  background: var(--blue);
  color: #ffffff;
}

.company .container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 56px;
}

.company-text {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.company-text h2 {
  color: #ffffff;
  font-size: clamp(30px, 4.5vw, 38px);
}

.company-text p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--on-blue);
}

.company-text .button {
  margin-top: 10px;
}

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

.values li {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
}

.facts {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.facts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.fact {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.fact dt {
  color: var(--on-navy);
}

.fact dd {
  font-weight: 700;
  text-align: right;
}

.fact-number {
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 22px;
}

.fact-number dd {
  font-family: var(--font-title);
  font-size: 32px;
  text-align: left;
}

.fact-number dt {
  font-size: 14px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
}

.cta-text {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-text h2 {
  font-size: clamp(24px, 3.5vw, 30px);
}

.cta-text p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Contacts: form and side card -------------------------------------------------------- */

.contact-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px;
  padding-top: 56px;
  padding-bottom: 88px;
}

.form-card {
  flex: 2 1 560px;
  min-width: 0;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
}

.form-card h2,
.side-card h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 18px;
  /* A label on two lines must not move its control: the controls of a row stay aligned. */
  align-items: end;
}

.form-note {
  font-size: 14px;
  color: var(--text-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.field label span {
  font-weight: 400;
  color: var(--text-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
}

.field input:user-invalid,
.field select:user-invalid {
  border-color: var(--red-dark);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* The trap field for bots: out of the screen, and hidden from assistive technologies. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sent {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 0;
}

.sent p {
  color: var(--text-muted);
  line-height: 1.6;
}

form.done .sent {
  display: flex;
}

form.done .fields {
  display: none;
}

.side-card {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  font-style: normal;
}

.side-card address {
  font-style: normal;
}

.side-card ul {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.side-card li svg {
  margin-top: 2px;
}

.side-card .more {
  font-weight: 600;
}

/* --- Footer ------------------------------------------------------------------------------ */

.site-footer {
  background: var(--navy);
  color: var(--on-navy);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.footer-column {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-column-wide {
  flex: 1 1 320px;
  gap: 10px;
}

.footer-brand {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 20px;
  color: #ffffff;
}

.footer-title {
  font-family: var(--font-text);
  font-size: 16px;
  letter-spacing: 0;
  color: #ffffff;
}

.site-footer p {
  line-height: 1.6;
}

.site-footer strong {
  color: #ffffff;
}

.site-footer ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer a {
  color: var(--on-navy);
}

.site-footer a:hover {
  color: #ffffff;
}
