/* Questionário de seleção de lente — Clínica Dr. Reinaldo Sieiro */

.ql-page {
  min-height: 100vh;
  background: var(--c-bg-2);
  color: var(--c-text);
}

.ql-page .a11y-fab { z-index: 1400; }

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

.ql-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--grad-brand-deep);
  color: var(--c-white);
}

.ql-topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ql-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: var(--c-white);
  min-width: 0;
}

.ql-logo {
  height: 42px;
  width: auto;
  filter: brightness(0) invert(1);
}

.ql-brand-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.ql-brand-text strong {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.ql-brand-text span {
  font-size: .74rem;
  opacity: .8;
}

.ql-home-link {
  color: rgba(255,255,255,.9);
  font-size: .9rem;
  font-weight: 600;
  padding: .4rem .7rem;
  border-radius: 8px;
  transition: background var(--t-fast) var(--ease);
}

.ql-home-link:hover,
.ql-home-link:focus-visible {
  background: rgba(255,255,255,.1);
  outline: none;
}

.ql-progress-meta {
  font-size: .85rem;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}

.ql-progress-track {
  height: 3px;
  background: rgba(255,255,255,.15);
}

.ql-progress-bar {
  height: 100%;
  width: 0;
  background: var(--c-secondary);
  transition: width var(--t-med) var(--ease);
}

.ql-main {
  padding: 2rem 1.25rem 3rem;
}

.ql-shell {
  max-width: 720px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 2.25rem 1.75rem 2rem;
  position: relative;
  overflow: hidden;
}

.ql-shell::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad-brand-deep);
}

.ql-step[hidden] { display: none !important; }

.ql-step.is-active {
  animation: ql-step-in .38s var(--ease) both;
}

@keyframes ql-step-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ql-step.is-active { animation: none; }
}

.ql-intro-icon {
  width: 56px; height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad-icon);
  color: var(--c-primary);
  border: 1px solid rgba(43, 70, 192, 0.16);
}

.ql-title {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.2;
  color: var(--c-primary);
  text-align: center;
  margin-bottom: 1rem;
}

.ql-title em {
  font-style: normal;
  color: var(--c-blue);
}

.ql-title-sm {
  font-size: clamp(1.45rem, 3.4vw, 1.95rem);
  text-align: left;
  margin-bottom: .65rem;
}

.ql-lead {
  text-align: center;
  color: var(--c-text-muted);
  max-width: 38rem;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.ql-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
  margin-bottom: 2rem;
}

.ql-badges li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: .4rem .85rem .4rem .7rem;
}

.ql-badges li svg { flex-shrink: 0; opacity: .8; }

.ql-intro-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: 26rem;
  margin: 0 auto;
}

.ql-field {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.ql-field > span,
.ql-field legend {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.ql-field input,
.ql-field select,
.ql-number-input {
  width: 100%;
  border: 1px solid rgba(39, 25, 109, 0.14);
  border-radius: 12px;
  padding: .85rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--c-primary);
  background: var(--c-surface);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.ql-field input[type="date"] {
  color-scheme: light;
}

html.a11y-dark .ql-field input[type="date"] {
  color-scheme: dark;
}

.ql-field input:focus-visible,
.ql-field select:focus-visible,
.ql-number-input:focus-visible,
.ql-option:focus-visible,
.ql-freq-btn:focus-visible,
.ql-btn:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

.ql-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  padding: .85rem 1.25rem;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.ql-btn svg { flex-shrink: 0; }

.ql-btn:hover { transform: translateY(-1px); }
.ql-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.ql-btn-primary {
  background: var(--grad-brand);
  color: var(--c-white);
}

.ql-btn-primary:hover { background: var(--grad-brand-deep); }

.ql-btn-ghost {
  background: var(--c-surface);
  color: var(--c-primary);
  border: 1px solid rgba(39, 25, 109, 0.16);
}

.ql-btn-whatsapp {
  background: var(--c-green);
  color: var(--c-white);
}

.ql-btn-wide { width: 100%; }
.ql-btn-sm {
  padding: .5rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  margin-top: .65rem;
  align-self: flex-end;
}

.ql-step-kicker {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-blue);
  margin-bottom: .75rem;
}

.ql-hint {
  color: var(--c-text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.ql-nav {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-border);
}

.ql-options {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ql-option {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  text-align: left;
  width: 100%;
  padding: 1.05rem 1.15rem;
  border-radius: 16px;
  border: 1.5px solid rgba(39, 25, 109, 0.12);
  background: var(--c-surface);
  color: var(--c-primary);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.ql-option:hover { border-color: rgba(39, 25, 109, 0.3); }

.ql-option .ql-radio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(39, 25, 109, 0.28);
  flex-shrink: 0;
  margin-top: .1rem;
  display: grid;
  place-items: center;
  color: transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.ql-option .ql-radio svg { opacity: 0; transition: opacity var(--t-fast) var(--ease); }

.ql-option strong {
  display: block;
  font-size: 1.02rem;
  margin-bottom: .2rem;
}

.ql-option small {
  display: block;
  color: var(--c-text-muted);
  font-size: .9rem;
  line-height: 1.45;
}

.ql-option.is-selected {
  background: var(--grad-brand);
  border-color: transparent;
  color: var(--c-white);
}

.ql-option.is-selected small { color: rgba(255,255,255,.78); }
.ql-option.is-selected .ql-radio {
  border-color: var(--c-secondary);
  background: var(--c-secondary);
  color: var(--c-primary-dark);
}
.ql-option.is-selected .ql-radio svg { opacity: 1; }

.ql-slider-wrap { padding: .5rem 0 1rem; }

.ql-slider-value {
  text-align: center;
  margin-bottom: 1.25rem;
}

.ql-slider-value strong {
  display: block;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--c-blue);
  font-weight: 800;
}

.ql-slider-value span {
  display: block;
  margin-top: .35rem;
  color: var(--c-text-muted);
  font-weight: 600;
}

.ql-slider {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(39, 25, 109, 0.12);
  outline: none;
}

.ql-slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-primary-dark);
  border: 3px solid var(--c-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  margin-top: -1px;
}

.ql-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-primary-dark);
  border: 3px solid var(--c-secondary);
  cursor: pointer;
}

.ql-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--c-text-muted);
}

.ql-freq-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ql-freq-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: .85rem;
  align-items: center;
  padding: .95rem 0;
  border-bottom: 1px solid var(--c-border);
}

.ql-freq-row:last-child { border-bottom: none; }

.ql-freq-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  color: var(--c-primary);
}

.ql-freq-label svg { flex-shrink: 0; opacity: .75; color: var(--c-blue); }

.ql-freq-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
}

.ql-freq-btn {
  border: 1px solid rgba(39, 25, 109, 0.14);
  background: var(--c-surface);
  color: var(--c-text);
  border-radius: 10px;
  padding: .55rem .35rem;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.ql-freq-btn.is-selected {
  background: var(--grad-brand);
  border-color: transparent;
  color: var(--c-white);
}

.ql-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ql-numbers .ql-field span { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--c-primary); font-weight: 600; }

/* Result */
.ql-result-hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.ql-result-kicker {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-blue);
  margin-bottom: .5rem;
}

.ql-result-hero h2 {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: clamp(2rem, 5vw, 2.7rem);
  color: var(--c-primary);
  margin-bottom: .4rem;
}

.ql-result-hero .ql-result-sub {
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: .75rem;
}

.ql-result-hero p { color: var(--c-text-muted); line-height: 1.65; }

/* Gauge rows — leitura do perfil */
.ql-gauges {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 1.5rem 0 1.75rem;
  padding: 1.25rem 1.35rem;
  background: var(--c-bg-2);
  border-radius: 16px;
}

.ql-gauges-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: .35rem;
}

.ql-gauge-row + .ql-gauge-row { margin-top: 0; }

.ql-gauge-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .4rem;
}

.ql-gauge-label {
  font-weight: 700;
  color: var(--c-primary);
  font-size: .92rem;
}

.ql-gauge-label small {
  font-weight: 600;
  color: var(--c-text-muted);
  margin-left: .25rem;
}

.ql-gauge-tag {
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.ql-gauge-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(39, 25, 109, 0.1);
  overflow: hidden;
}

html.a11y-dark .ql-gauge-track { background: rgba(255,255,255,.12); }

.ql-gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width var(--t-med) var(--ease);
}

.ql-note {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  background: #fff8e8;
  border: 1px solid rgba(180, 140, 40, 0.25);
  color: #5c4a12;
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: .9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

html.a11y-dark .ql-note {
  background: rgba(255, 200, 80, 0.12);
  border-color: rgba(255, 200, 80, 0.25);
  color: #f0dfb0;
}

.ql-sim-card {
  border: 1px solid var(--c-border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.ql-sim-head {
  background: var(--grad-brand-deep);
  color: var(--c-white);
  padding: .85rem 1.15rem;
  font-weight: 700;
  font-size: .92rem;
}

.ql-sim-body {
  padding: 1.15rem;
  background: var(--c-bg-3);
}

.ql-sim-body h4 {
  font-size: .72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin: 1.1rem 0 .55rem;
}

.ql-sim-body h4:first-child { margin-top: 0; }

.ql-spec-rows {
  display: flex;
  flex-direction: column;
}

.ql-spec-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--c-border);
  font-size: .9rem;
}

.ql-spec-row:last-child { border-bottom: none; }

.ql-spec-row dt {
  color: var(--c-text-muted);
  flex-shrink: 0;
}

.ql-spec-row dd {
  text-align: right;
  font-weight: 600;
  color: var(--c-primary);
}

.ql-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.ql-pills span {
  background: rgba(43, 70, 192, 0.1);
  color: var(--c-primary);
  border-radius: 999px;
  padding: .4rem .8rem;
  font-size: .82rem;
  font-weight: 600;
}

.ql-priority {
  color: #15803d;
  font-weight: 700;
  font-size: 1.02rem;
}

html.a11y-dark .ql-priority { color: #4ade80; }

.ql-defocus {
  display: grid;
  gap: .35rem;
  font-size: .92rem;
}

.ql-defocus strong { color: var(--c-primary); }

.ql-lenses-copy,
.ql-disclaimer {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--c-text);
}

.ql-conflicts {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin: 1rem 0;
}

.ql-conflict {
  background: #fff8e8;
  border: 1px solid rgba(180, 140, 40, 0.22);
  border-radius: 12px;
  padding: .8rem 1rem;
  font-size: .88rem;
  color: #5c4a12;
  line-height: 1.5;
}

html.a11y-dark .ql-conflict {
  background: rgba(255, 200, 80, 0.1);
  color: #f0dfb0;
  border-color: rgba(255, 200, 80, 0.22);
}

.ql-disclaimer {
  background: var(--c-bg-2);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  color: var(--c-text-muted);
  margin: 1.25rem 0;
}

.ql-sign-block {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}

.ql-sign-block h3 {
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: .45rem;
}

.ql-sign-block > p {
  font-size: .9rem;
  color: var(--c-text-muted);
  margin-bottom: .85rem;
}

.ql-sign-pad-wrap {
  position: relative;
  border: 1.5px dashed rgba(39, 25, 109, 0.2);
  border-radius: 16px;
  background: var(--c-surface);
  overflow: hidden;
}

#ql-signature {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  cursor: crosshair;
}

.ql-sign-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: rgba(39, 25, 109, 0.4);
  pointer-events: none;
  font-size: 1rem;
  font-weight: 600;
}

.ql-sign-placeholder.is-hidden { opacity: 0; }

.ql-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
  padding: .75rem 1rem;
  background: var(--c-bg-2);
  border-radius: 12px;
  font-size: .88rem;
  color: var(--c-text);
}

.ql-result-meta .ql-version {
  color: var(--c-text-muted);
  font-size: .8rem;
}

.ql-result-actions {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.ql-footer {
  text-align: center;
  padding: 0 1.25rem 2.5rem;
  color: var(--c-text-muted);
  font-size: .85rem;
}

.ql-footer a {
  color: var(--c-primary);
  font-weight: 600;
}

.ql-error {
  color: #b42318;
  font-size: .85rem;
  margin-top: -.35rem;
}

/* Modo escuro — bordas e traços que usavam o azul-marca precisam de mais contraste */
html.a11y-dark .ql-field input,
html.a11y-dark .ql-field select,
html.a11y-dark .ql-number-input,
html.a11y-dark .ql-option,
html.a11y-dark .ql-freq-btn,
html.a11y-dark .ql-btn-ghost {
  border-color: rgba(255, 255, 255, 0.18);
}

html.a11y-dark .ql-option:hover { border-color: rgba(255, 255, 255, 0.34); }
html.a11y-dark .ql-option .ql-radio { border-color: rgba(255, 255, 255, 0.32); }
html.a11y-dark .ql-slider { background: rgba(255, 255, 255, 0.16); }
html.a11y-dark .ql-sign-pad-wrap { border-color: rgba(255, 255, 255, 0.22); }
html.a11y-dark .ql-sign-placeholder { color: rgba(255, 255, 255, 0.38); }

@media (max-width: 640px) {
  .ql-shell { padding: 1.5rem 1.1rem 1.35rem; border-radius: 18px; }
  .ql-brand-text { display: none; }
  .ql-logo { height: 36px; }
  .ql-numbers { grid-template-columns: 1fr; }
  .ql-freq-row {
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  .ql-spec-row {
    flex-direction: column;
    gap: .2rem;
  }
  .ql-spec-row dd { text-align: left; }
  .ql-nav { flex-direction: column-reverse; }
  .ql-nav .ql-btn { width: 100%; }
}

@media print {
  .a11y-fab, .a11y-panel, .ql-footer, .ql-result-actions, .ql-home-link, #ql-clear-sign {
    display: none !important;
  }
  .ql-page, .ql-main { background: #fff !important; padding: 0 !important; }
  .ql-topbar { position: static; }
  .ql-shell {
    box-shadow: none;
    border: none;
    max-width: none;
    padding: 0;
  }
  .ql-shell::before { display: none; }
  .ql-sign-pad-wrap { border-style: solid; }
}
