/* ============================================================
   MORAD.IA — Diagnostic Interface Stylesheet
   Extends app.css with diagnostic-specific components
   ============================================================ */

/* ── Page Shell ─────────────────────────────────────────────── */
.diagnostic-page {
  min-height: 100vh;
  background: #F0F6FF;
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(0,119,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 90%, rgba(13,26,140,0.05) 0%, transparent 55%);
  padding: 3rem 0 6rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.diag-header {
  text-align: center;
  margin-bottom: 3rem;
}

.diag-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,119,255,0.1);
  border: 1px solid rgba(0,119,255,0.25);
  color: #0044CC;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.diag-header__badge-dot {
  width: 6px;
  height: 6px;
  background: #0077FF;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.diag-header__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  color: #0A1240;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.diag-header__sub {
  color: #4A5980;
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Progress Tracker ───────────────────────────────────────── */
.diag-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.diag-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  flex: 1;
}

.diag-progress__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: #C8DDF5;
  transition: background 0.5s ease;
  z-index: 0;
}

.diag-progress__step.is-done:not(:last-child)::after {
  background: #0D1A8C;
}

.diag-progress__bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #F0F6FF;
  border: 2px solid #C8DDF5;
  color: #4A5980;
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  z-index: 1;
}

.diag-progress__step.is-active .diag-progress__bubble {
  background: #0077FF;
  border-color: #0077FF;
  color: white;
  box-shadow: 0 0 0 5px rgba(0,119,255,0.2);
  transform: scale(1.1);
}

.diag-progress__step.is-done .diag-progress__bubble {
  background: #0D1A8C;
  border-color: #0D1A8C;
  color: white;
}

.diag-progress__step.is-done .diag-progress__bubble::after {
  content: '✓';
  font-size: 0.875rem;
}

.diag-progress__step.is-done .diag-progress__num {
  display: none;
}

.diag-progress__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #B4B2A9;
  transition: color 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.diag-progress__step.is-active .diag-progress__label {
  color: #0077FF;
}

.diag-progress__step.is-done .diag-progress__label {
  color: #0D1A8C;
}

/* ── Card ───────────────────────────────────────────────────── */
.diag-card {
  background: #FAFCFF;
  border: 1px solid #C8DDF5;
  border-radius: 20px;
  max-width: 740px;
  margin: 0 auto;
  box-shadow:
    0 1px 2px rgba(10,18,64,0.04),
    0 8px 32px rgba(10,18,64,0.08),
    0 2px 0 0 rgba(0,119,255,0.18) inset;
  /* overflow:hidden removido — impedia exibição de conteúdo dinâmico em mobile */
}

.diag-card__inner {
  padding: 2.5rem 2.75rem 2rem;
}

.diag-card__footer {
  padding: 1.25rem 2.75rem;
  background: rgba(240,246,255,0.8);
  border-top: 1px solid #E0EEFF;
  border-radius: 0 0 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ── Steps ──────────────────────────────────────────────────── */
.diag-step {
  display: none;
  animation: step-in 0.35s cubic-bezier(0.16,1,0.3,1);
}

.diag-step.is-active {
  display: block;
}

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

/* ── Step Headings ──────────────────────────────────────────── */
.diag-step__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: #0A1240;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.diag-step__sub {
  font-size: 0.9rem;
  color: #4A5980;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

/* ── Question Blocks ────────────────────────────────────────── */
.diag-question {
  margin-bottom: 2rem;
}

.diag-question:last-child {
  margin-bottom: 0;
}

.diag-question__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0A1240;
  margin-bottom: 0.875rem;
  display: block;
  line-height: 1.5;
}

.diag-question__label strong {
  font-weight: 700;
  display: inline;
}

.diag-question__label span {
  display: inline;
}

.diag-question__hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E8F4FF;
  color: #4A5980;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  margin-left: 4px;
  position: relative;
  top: -1px;
  transition: background 0.15s;
}

.diag-question__hint:hover {
  background: #0077FF;
  color: white;
}

/* ── Option Cards (type selector) ───────────────────────────── */
.option-grid {
  display: grid;
  gap: 0.75rem;
}

.option-grid--2 { grid-template-columns: 1fr 1fr; }
.option-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.option-grid--yesno { grid-template-columns: 1fr 1fr 1fr; }

/* Terceiro card (Não sei) ocupa linha inteira em mobile */
@media (max-width: 600px) {
  .option-grid--yesno { grid-template-columns: 1fr 1fr; }
  .option-grid--yesno .yesno-card:nth-child(3) { grid-column: 1 / -1; }
}

.option-card {
  position: relative;
  padding: 1rem 1.125rem;
  border: 2px solid #E8E0D0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
  background: white;
  user-select: none;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  -webkit-tap-highlight-color: transparent;
}

.option-card:hover {
  border-color: #00AAFF;
  background: #F0F6FF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,119,255,0.1);
}

.option-card.is-selected {
  border-color: #0077FF;
  background: rgba(0,119,255,0.04);
  box-shadow: 0 0 0 4px rgba(0,119,255,0.12);
  transform: translateY(-1px);
}

.option-card.is-selected .option-card__check {
  opacity: 1;
  transform: scale(1);
}

.option-card__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.option-card__body {
  flex: 1;
  min-width: 0;
}

.option-card__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0A1240;
  line-height: 1.3;
}

.option-card__desc {
  font-size: 0.8125rem;
  color: #4A5980;
  margin-top: 0.2rem;
  line-height: 1.4;
}

.option-card__check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0077FF;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
  flex-shrink: 0;
}

.option-card__check::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

/* ── Yes/No compact cards ───────────────────────────────────── */
.yesno-card {
  padding: 0.875rem 1rem;
  border: 2px solid #E8E0D0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  background: white;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.yesno-card:hover {
  border-color: #C8A882;
}

.yesno-card.is-selected {
  border-color: #0077FF;
  background: rgba(0,119,255,0.05);
  box-shadow: 0 0 0 3px rgba(0,119,255,0.12);
}

.yesno-card--yes.is-selected {
  border-color: #0D1A8C;
  background: rgba(13,26,140,0.05);
  box-shadow: 0 0 0 3px rgba(13,26,140,0.12);
}

.yesno-card--no.is-selected {
  border-color: #8B1A1A;
  background: rgba(139,26,26,0.05);
  box-shadow: 0 0 0 3px rgba(139,26,26,0.1);
}

.yesno-card__emoji {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 0.3rem;
}

.yesno-card__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0A1240;
}

/* ── Conditional reveal ─────────────────────────────────────── */
.diag-conditional {
  display: none;
}

.diag-conditional.is-visible {
  display: block;
}

/* ── Divider ────────────────────────────────────────────────── */
.diag-divider {
  height: 1px;
  background: #C8DDF5;
  margin: 1.75rem 0;
}

/* ── Lead Capture Form ──────────────────────────────────────── */
.lead-capture {
  text-align: center;
  padding: 0.5rem 0;
}

.lead-capture__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,119,255,0.12), rgba(13,26,140,0.08));
  border: 2px solid rgba(0,119,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
}

.lead-capture__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0A1240;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.lead-capture__sub {
  color: #4A5980;
  font-size: 0.9375rem;
  margin-bottom: 2rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.lead-form {
  text-align: left;
  margin-top: 1.5rem;
}

.lead-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}

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

.lead-form__group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.lead-form__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1E2E5C;
  letter-spacing: 0.01em;
}

.lead-form__input,
.lead-form__select {
  padding: 0.75rem 1rem;
  border: 1.5px solid #C8DDF5;
  border-radius: 10px;
  background: white;
  font-size: 0.9375rem;
  color: #0A1240;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.lead-form__input:focus,
.lead-form__select:focus {
  border-color: #0077FF;
  box-shadow: 0 0 0 3px rgba(0,119,255,0.15);
}

.lead-form__input::placeholder { color: #B4B2A9; }

.lead-form__input.has-error {
  border-color: #C0001A;
  box-shadow: 0 0 0 3px rgba(192,0,26,0.1);
}

.lead-form__error {
  font-size: 0.8125rem;
  color: #C0001A;
  margin-top: 0.25rem;
  display: none;
}

.lead-form__error.is-visible { display: block; }

.lead-form__lgpd {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(232,244,255,0.8);
  border: 1px solid #C8DDF5;
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.lead-form__lgpd-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.lead-form__lgpd-text {
  font-size: 0.8rem;
  color: #4A5980;
  line-height: 1.5;
}

/* ── Buttons ────────────────────────────────────────────────── */
.diag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.diag-btn--primary {
  background: linear-gradient(135deg, #00AAFF, #0077FF);
  color: white;
  border-color: #0077FF;
}

.diag-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0077FF, #0044CC);
  border-color: #0044CC;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,119,255,0.4);
}

.diag-btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.diag-btn--ghost {
  background: transparent;
  color: #4A5980;
  border-color: #C8DDF5;
}

.diag-btn--ghost:hover {
  border-color: #B4B2A9;
  color: #1E2E5C;
  background: rgba(244,240,232,0.8);
}

.diag-btn--submit {
  background: linear-gradient(135deg, #00AAFF, #0077FF);
  color: white;
  border-color: #0077FF;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border-radius: 12px;
}

.diag-btn--submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0077FF, #0044CC);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,119,255,0.4);
}

.diag-btn--submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.diag-btn__arrow {
  transition: transform 0.2s ease;
}

.diag-btn--primary:hover:not(:disabled) .diag-btn__arrow {
  transform: translateX(3px);
}

/* ── Spinner ────────────────────────────────────────────────── */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}

.is-loading .btn-spinner { display: block; }
.is-loading .btn-text    { display: none; }

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

/* ── Tooltip ────────────────────────────────────────────────── */
.diag-tooltip {
  position: fixed;
  background: #0A1240;
  color: white;
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  max-width: 260px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.diag-tooltip.is-visible { opacity: 1; }

.diag-tooltip::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 12px;
  width: 10px;
  height: 10px;
  background: #0A1240;
  transform: rotate(45deg);
}

/* ── Error Alert ────────────────────────────────────────────── */
.diag-alert {
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(139,26,26,0.06);
  border: 1px solid rgba(139,26,26,0.2);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #8B1A1A;
}

.diag-alert.is-visible { display: flex; }

/* ── Loading Overlay ────────────────────────────────────────── */
.diag-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,18,64,0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
}

.diag-overlay.is-active { display: flex; }

.diag-overlay__card {
  background: #FAFCFF;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 360px;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}

.diag-overlay__spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(0,119,255,0.15);
  border-top-color: #0077FF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

.diag-overlay__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0A1240;
  margin-bottom: 0.5rem;
}

.diag-overlay__sub {
  font-size: 0.875rem;
  color: #4A5980;
  line-height: 1.5;
}

.diag-overlay__steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
  text-align: left;
}

.diag-overlay__step-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: #B4B2A9;
  transition: color 0.3s;
}

.diag-overlay__step-item.is-active { color: #0A1240; font-weight: 500; }
.diag-overlay__step-item.is-done   { color: #0D1A8C; }

.diag-overlay__step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C8DDF5;
  flex-shrink: 0;
  transition: background 0.3s;
}

.diag-overlay__step-item.is-active .diag-overlay__step-dot {
  background: #0077FF;
  box-shadow: 0 0 0 3px rgba(0,119,255,0.2);
}

.diag-overlay__step-item.is-done .diag-overlay__step-dot {
  background: #0D1A8C;
}

/* ── Trust Bar ──────────────────────────────────────────────── */
.diag-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 0 1rem;
}

.diag-trust__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: #B4B2A9;
  font-weight: 500;
}

.diag-trust__item::before {
  content: '✓';
  color: #0D1A8C;
  font-weight: 700;
  font-size: 0.75rem;
}

/* ── Step counter pill ──────────────────────────────────────── */
.diag-step-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(0,119,255,0.08);
  color: #0044CC;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  margin-bottom: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Responsive ─────────────────────────────────────────────── */
/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
  .diag-progress__bubble { width: 32px; height: 32px; font-size: 0.75rem; }
  .diag-progress__label  { font-size: 0.6875rem; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
  .diag-progress__step:not(:last-child)::after { top: 16px; left: calc(50% + 16px); width: calc(100% - 32px); }
}

/* Mobile */
@media (max-width: 600px) {
  .diagnostic-page { padding: 1.25rem 0 4rem; }

  /* Progress bar — só bubbles, sem labels */
  .diag-progress { max-width: 100%; padding: 0 1rem; }
  .diag-progress__label { display: none; }
  .diag-progress__bubble { width: 28px; height: 28px; font-size: 0.6875rem; }
  .diag-progress__step:not(:last-child)::after { top: 14px; left: calc(50% + 14px); width: calc(100% - 28px); }

  /* Card */
  .diag-card__inner  { padding: 1.25rem 1rem; }
  .diag-card__footer { padding: 0.875rem 1rem; gap: 0.5rem; flex-wrap: wrap; }

  /* Títulos dos steps */
  .diag-step__title { font-size: 1.1rem; }

  /* Option grids */
  .option-grid--2    { grid-template-columns: 1fr; }
  .option-grid--3    { grid-template-columns: 1fr 1fr; }
  .option-grid--yesno { grid-template-columns: 1fr 1fr; }

  /* Botões de navegação */
  .diag-btn { font-size: 0.875rem; padding: 0.75rem 1rem; }
  .diag-btn--submit { width: 100%; justify-content: center; font-size: 0.9375rem; padding: 0.9rem 1rem; }

  /* Lead form — passo 4 */
  .lead-capture__icon  { width: 56px; height: 56px; font-size: 1.5rem; margin-bottom: 1rem; }
  .lead-capture__title { font-size: 1.25rem; }
  .lead-capture__sub   { font-size: 0.875rem; margin-bottom: 1.5rem; }
  .lead-form { margin-top: 1rem; }
  .lead-form__grid { grid-template-columns: 1fr !important; gap: 0.75rem; }
  .lead-form__group[style] { grid-column: 1 !important; }
  .lead-form__input,
  .lead-form__select { font-size: 1rem; padding: 0.8125rem 0.875rem; }
  .lead-form__lgpd { padding: 0.75rem; font-size: 0.8125rem; }
}

/* Mobile muito pequeno */
@media (max-width: 400px) {
  .option-grid--3     { grid-template-columns: 1fr; }
  .option-grid--yesno { grid-template-columns: 1fr; }
  .diag-header__title { font-size: 1.375rem; }
  .diag-card__inner   { padding: 1rem 0.875rem; }
}