:root {
  color-scheme: light;
  --navy: #132338;
  --blue: #1b4fa8;
  --blue-dark: #123a7f;
  --blue-bright: #2563eb;
  --orange: #f5820a;
  --teal: #0f766e;
  --muted: rgba(26, 46, 68, 0.52);
  --muted-s: rgba(26, 46, 68, 0.74);
  --gb: rgba(27, 79, 168, 0.13);
  --line: rgba(19, 35, 56, 0.1);
  --line-m: rgba(19, 35, 56, 0.18);
  --surface: rgba(255, 255, 255, 0.94);
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(19, 35, 56, 0.09);
}

* {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  margin: 0;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 72px;
  overflow-x: hidden;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.58;
  color: var(--navy);
  background: #f3f6fa;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(27, 79, 168, 0.055) 0 1px, transparent 1px 100%),
    radial-gradient(ellipse 78% 38% at 50% -8%, rgba(27, 79, 168, 0.11) 0%, transparent 62%),
    radial-gradient(ellipse 45% 34% at 96% 18%, rgba(245, 130, 10, 0.08) 0%, transparent 58%);
  background-size: 32px 32px, auto, auto;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 4px solid rgba(37, 99, 235, 0.22);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

nav,
main,
section {
  position: relative;
  z-index: 1;
}

nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(19, 35, 56, 0.11);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-text {
  color: var(--navy);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.logo-sub {
  margin-top: 1px;
  color: var(--orange);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-control span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.language-control select {
  min-height: 42px;
  border: 1px solid var(--line-m);
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
  padding: 8px 34px 8px 11px;
  font-size: 0.8rem;
  font-weight: 900;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 18px;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 24px rgba(27, 79, 168, 0.18);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.contact-button:hover {
  background: var(--blue-dark);
}

.session-active .contact-button {
  background: #ce2029;
  box-shadow: 0 12px 24px rgba(206, 32, 41, 0.18);
}

.session-active .contact-button:hover {
  background: #a9151d;
}

.app-shell {
  max-width: 1260px;
  margin: 0 auto;
  padding: 24px 5vw 56px;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.hero-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
  min-width: 0;
}

.module-header {
  min-height: 100%;
  margin-bottom: 0;
  padding: clamp(1.1rem, 2.1vw, 1.55rem);
  border: 1px solid var(--gb);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.session-active .module-header {
  padding-block: clamp(1rem, 2vw, 1.4rem);
}

.module-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 0% 0%, rgba(27, 79, 168, 0.07), transparent 70%),
    linear-gradient(90deg, rgba(19, 35, 56, 0.04) 0 1px, transparent 1px 100%);
  background-size: auto, 28px 28px;
}

.module-header > * {
  position: relative;
}

.module-copy {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  min-height: 100%;
}

.section-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.72rem;
  color: var(--orange);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.section-tag::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--orange);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.65rem;
  color: var(--navy);
  font-size: clamp(3.35rem, 8vw, 7.4rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 em {
  color: var(--blue);
  font-style: normal;
}

.brand-question {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.18em;
  max-width: 100%;
}

.brand-question.is-stacked {
  flex-direction: column;
  align-items: center;
  gap: 0.03em;
  font-size: clamp(2.65rem, 5.8vw, 5.5rem);
  line-height: 0.82;
}

.brand-question.is-stacked .left-word,
.brand-question.is-stacked .right-cluster {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.brand-question.is-stacked .or-word {
  font-size: 0.26em;
  line-height: 1;
}

.right-cluster {
  display: inline-flex;
  align-items: baseline;
}

.or-word,
.question-mark {
  color: var(--navy);
}

.or-word {
  font-size: 0.38em;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.left-word {
  color: var(--orange);
}

.right-word {
  color: var(--blue);
}

h2 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-desc {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--muted-s);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  font-weight: 400;
  line-height: 1.55;
}

.session-active #moduleTag,
.session-active #moduleDescription {
  display: none;
}

.session-active h1 {
  margin-bottom: 0;
  justify-content: center;
  text-align: center;
}

.metric-grid span,
.field span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.setup-panel,
.task-panel,
.results-panel {
  border: 1px solid var(--gb);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.setup-panel,
.results-panel {
  padding: clamp(18px, 3vw, 28px);
}

.setup-panel {
  display: grid;
  gap: 20px;
  align-items: start;
}

.setup-copy,
.setup-grid {
  min-width: 0;
}

.setup-copy p {
  max-width: 60ch;
  color: var(--muted-s);
  font-size: 1.06rem;
  line-height: 1.55;
}

.setup-grid {
  display: block;
}

.launch-panel {
  display: flex;
  justify-content: center;
  margin: 0;
}

.instructions {
  max-width: none;
  padding: 2px 0 4px;
}

.instructions h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.instructions ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted-s);
  font-size: 1.04rem;
}

.instructions li::marker {
  color: var(--orange);
  font-weight: 900;
}

.field {
  display: grid;
  gap: 8px;
}

.field select {
  min-height: 48px;
  border: 1px solid var(--line-m);
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
  padding: 10px 12px;
  font-weight: 800;
}

.slider-control {
  max-width: none;
  margin-top: 22px;
}

.slider-value {
  margin: 8px 0 14px;
  color: var(--muted-s);
  font-size: 1.02rem;
}

.slider-value strong {
  color: var(--blue);
  font-size: 1.55rem;
  font-weight: 900;
}

#trialCount {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

#trialCount::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(27, 79, 168, 0.2), rgba(245, 130, 10, 0.28));
}

#trialCount::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(19, 35, 56, 0.22);
  -webkit-appearance: none;
}

#trialCount::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(27, 79, 168, 0.2), rgba(245, 130, 10, 0.28));
}

#trialCount::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(19, 35, 56, 0.22);
}

.slider-stops {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.slider-stops span {
  text-align: center;
}

.slider-stops span:first-child {
  text-align: left;
}

.slider-stops span:last-child {
  text-align: right;
}

.session-settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  margin-top: 20px;
}

.ai-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line-m);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.64);
  cursor: pointer;
}

.ai-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}

.ai-toggle strong,
.ai-toggle small {
  display: block;
}

.ai-toggle strong {
  color: var(--navy);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-toggle small {
  color: var(--muted-s);
  line-height: 1.35;
}

.load-summary {
  min-height: 48px;
  margin: 12px 0 22px;
  padding: 14px 16px;
  border-left: 5px solid var(--blue);
  background: rgba(27, 79, 168, 0.08);
  color: var(--muted-s);
  line-height: 1.45;
}

.load-summary.ready {
  border-left-color: var(--blue);
  background: rgba(27, 79, 168, 0.09);
  color: var(--blue-dark);
}

.load-summary.warning {
  border-left-color: var(--danger);
  background: rgba(159, 47, 40, 0.08);
  color: var(--danger);
}

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

.primary-button,
.secondary-button,
.answer-button {
  min-height: 54px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setup-actions {
  justify-content: start;
}

.launch-panel .primary-button {
  min-width: min(100%, 340px);
  min-height: 76px;
  font-size: 0.95rem;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 24px rgba(27, 79, 168, 0.18);
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
}

.secondary-button {
  background: #ffffff;
  color: var(--navy);
  border-color: var(--line-m);
}

.secondary-button:hover {
  border-color: rgba(23, 35, 31, 0.34);
}

.task-panel {
  overflow: hidden;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-timer {
  color: var(--navy);
  font-family: "DM Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.task-timer strong {
  margin-left: 6px;
  color: var(--blue);
  font-size: 1.15rem;
}

#scoreText {
  text-align: right;
}

.image-stage {
  display: grid;
  place-items: center;
  min-height: min(58vh, 560px);
  padding: clamp(14px, 3vw, 26px);
  background:
    linear-gradient(90deg, rgba(23, 35, 31, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(23, 35, 31, 0.045) 1px, transparent 1px),
    #f7f9fc;
  background-size: 32px 32px;
}

.image-stage img {
  display: block;
  max-width: 100%;
  max-height: min(52vh, 500px);
  object-fit: contain;
}

.demo-hand {
  width: min(52vw, 320px);
  aspect-ratio: 0.76;
  background: #f2c3a7;
  border: 7px solid #63392b;
  border-radius: 44% 42% 28% 28%;
  box-shadow: inset 14px -20px 0 rgba(255, 255, 255, 0.18);
  position: relative;
}

.demo-hand::before,
.demo-hand::after {
  content: "";
  position: absolute;
  background: #f2c3a7;
  border: 7px solid #63392b;
}

.demo-hand::before {
  width: 42%;
  height: 27%;
  left: -26%;
  top: 42%;
  border-radius: 28px 0 0 44px;
  transform: rotate(-22deg);
}

.demo-hand::after {
  width: 16%;
  height: 34%;
  left: 11%;
  top: -26%;
  border-radius: 18px 18px 8px 8px;
  box-shadow:
    48px -2px 0 -7px #f2c3a7,
    48px -2px 0 0 #63392b,
    96px 8px 0 -7px #f2c3a7,
    96px 8px 0 0 #63392b,
    140px 28px 0 -7px #f2c3a7,
    140px 28px 0 0 #63392b;
}

.demo-hand.right {
  transform: scaleX(-1);
}

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

.answer-button {
  min-width: 0;
  min-height: 96px;
  color: #fff;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: 0;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: center;
}

body[data-language="es"] .answer-button {
  font-size: clamp(1.15rem, 3.2vw, 1.9rem);
}

.left-choice {
  background: var(--orange);
}

.left-choice:hover {
  background: #c96a06;
}

.right-choice {
  background: var(--blue);
}

.right-choice:hover {
  background: var(--blue-dark);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.metric-grid div {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line-m);
  border-radius: 8px;
  background: #fff;
}

.metric-grid strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.missed-list {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.5;
}

.missed-empty,
.missed-details {
  border: 1px solid var(--line-m);
  border-radius: 8px;
  background: #fff;
}

.missed-empty {
  padding: 14px 16px;
  color: var(--navy);
  font-weight: 900;
}

.missed-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.missed-details summary::marker {
  color: var(--blue);
}

.missed-details summary strong {
  color: var(--blue);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.missed-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.missed-photo {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.missed-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
}

.missed-photo figcaption {
  padding: 9px 10px;
  color: var(--muted-s);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.soap-panel {
  margin: 22px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-m);
}

.soap-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.soap-option {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-m);
  border-radius: 8px;
  background: #fff;
}

.soap-option p {
  color: var(--muted-s);
  line-height: 1.55;
}

.copy-soap-button {
  justify-self: start;
  min-height: 40px;
  border: 1px solid var(--line-m);
  border-radius: 7px;
  background: rgba(27, 79, 168, 0.08);
  color: var(--blue);
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.copy-soap-button:hover {
  border-color: rgba(27, 79, 168, 0.42);
  background: rgba(27, 79, 168, 0.13);
}

@media (max-width: 760px) {
  .home-layout,
  .module-header,
  .setup-panel,
  .setup-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero-column {
    display: grid;
    gap: 14px;
  }

  .app-shell {
    padding: 18px 4vw 44px;
  }

  .module-header,
  .setup-panel,
  .results-panel {
    border-radius: 10px;
  }

  .module-header {
    padding: 1rem;
  }

  .section-tag {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    text-align: center;
    line-height: 1.25;
  }

  nav {
    padding: 0 6vw;
  }

  .nav-logo {
    gap: 8px;
  }

  .logo-img {
    width: 38px;
    height: 38px;
  }

  .logo-text {
    font-size: 17px;
  }

  .logo-sub {
    font-size: 6.5px;
  }

  .nav-actions {
    gap: 7px;
  }

  .language-control span {
    display: none;
  }

  .language-control select {
    width: 72px;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .contact-button {
    padding-inline: 14px;
    font-size: 11px;
  }

  h1 {
    font-size: clamp(4rem, 16vw, 5.8rem);
    line-height: 0.86;
  }

  .brand-question {
    gap: 0.14em;
  }

  .brand-question.is-stacked {
    font-size: clamp(2.2rem, 11.2vw, 3.8rem);
    line-height: 0.9;
  }

  .launch-panel .primary-button {
    width: 100%;
  }

  .session-settings {
    grid-template-columns: 1fr;
  }

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

  .task-timer {
    order: 3;
    grid-column: 1 / -1;
    text-align: center;
  }

  .answer-row {
    gap: 10px;
    padding: 14px;
  }

  .answer-button {
    min-height: 86px;
    padding-inline: 10px;
    font-size: clamp(1.3rem, 6.2vw, 1.8rem);
  }

  body[data-language="es"] .answer-button {
    font-size: clamp(1rem, 5.1vw, 1.32rem);
  }
}

@media (max-width: 430px) {
  nav {
    padding: 0 12px;
  }

  .nav-logo {
    gap: 7px;
  }

  .logo-img {
    width: 34px;
    height: 34px;
  }

  .logo-text {
    font-size: 15px;
    letter-spacing: 0.07em;
  }

  .logo-sub {
    display: none;
  }

  .nav-actions {
    gap: 6px;
  }

  .language-control select {
    width: 62px;
    min-height: 38px;
    padding-inline: 6px;
    font-size: 0.68rem;
  }

  .contact-button {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 10px;
  }

  .brand-question.is-stacked {
    font-size: clamp(2.05rem, 10.8vw, 3rem);
    line-height: 0.92;
  }

  body[data-language="es"] .answer-button {
    font-size: clamp(0.92rem, 4.7vw, 1.18rem);
  }

  .hero-desc {
    font-size: 0.98rem;
  }
}

@media (max-width: 360px) {
  .logo-img {
    display: none;
  }

  .language-control select {
    width: 58px;
  }

  .contact-button {
    padding-inline: 8px;
  }

  .brand-question.is-stacked {
    font-size: clamp(1.88rem, 10.2vw, 2.45rem);
  }

  .answer-row {
    gap: 8px;
    padding: 12px;
  }

  .answer-button {
    min-height: 78px;
    padding-inline: 7px;
  }

  body[data-language="es"] .answer-button {
    font-size: 0.86rem;
  }
}
