/* ==========================================================================
   KYRINO ACADEMY - ASSESSMENT DESIGN SYSTEM (EVALUATION INTERFACE)
   Estética Dark Gold Premium, Glassmorphism, Micro-transições e Acessibilidade
   ========================================================================== */

:root {
  --bg-primary: #000b26;
  --bg-secondary: #061535;
  --bg-tertiary: #0c214d;
  --bg-panel: rgba(10, 25, 56, 0.84);
  --bg-panel-strong: rgba(7, 19, 44, 0.96);
  --bg-card-hover: rgba(14, 33, 74, 0.94);
  
  --text-primary: #f7f4ee;
  --text-secondary: rgba(231, 231, 231, 0.88);
  --text-muted: rgba(195, 200, 212, 0.76);
  --text-dark: #08152f;
  
  --accent-gold: #d4a63c;
  --accent-gold-hover: #e0b84f;
  --accent-gold-soft: rgba(212, 166, 60, 0.16);
  --accent-gold-border: rgba(224, 184, 79, 0.28);
  --accent-gold-active: rgba(224, 184, 79, 0.48);
  
  --surface-stroke: rgba(255, 255, 255, 0.1);
  --surface-stroke-strong: rgba(224, 184, 79, 0.32);
  
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 14px 40px rgba(212, 166, 60, 0.22);
  --shadow-glow: 0 0 24px rgba(212, 166, 60, 0.2);
  
  --radius-xs: 10px;
  --radius-sm: 16px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --radius-pill: 999px;
  
  --font-heading: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Manrope", "Arial", sans-serif;
  
  --transition-smooth: all 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body), sans-serif;
  color: var(--text-primary);
  background: radial-gradient(circle at 50% -10%, rgba(52, 88, 158, 0.22), transparent 45%),
              linear-gradient(180deg, #04112d 0%, #000b26 40%, #020d24 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   CABEÇALHO DA AVALIAÇÃO
   ========================================================================== */
.assessment-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(1, 13, 36, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(224, 184, 79, 0.16);
}

.header-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.assessment-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.assessment-logo {
  width: 180px;
  height: auto;
  display: block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(224, 184, 79, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-gold-hover);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-gold-hover);
  box-shadow: 0 0 8px rgba(224, 184, 79, 0.8);
}

.btn-reset-session {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  transition: var(--transition-smooth);
}

.btn-reset-session:hover {
  color: var(--text-primary);
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.06);
}

/* Barra de Progresso Discreta */
.progress-bar-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-bar-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, #d4a63c, #e0b84f);
  box-shadow: 0 0 10px rgba(224, 184, 79, 0.7);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL E VIEWPORTS
   ========================================================================== */
.assessment-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 80px;
}

.stage-container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

/* ==========================================================================
   HERO / TELA INICIAL
   ========================================================================== */
.hero-card {
  text-align: center;
  padding: 56px 40px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--accent-gold-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: assessmentFadeIn 0.45s ease;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  margin-bottom: 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-gold-border);
  background: rgba(212, 166, 60, 0.08);
  color: var(--accent-gold-hover);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-heading), serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.06;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--text-secondary);
  max-width: 660px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 auto 40px;
  max-width: 720px;
  text-align: left;
}

.hero-feature-item {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(224, 184, 79, 0.16);
}

.hero-feature-item strong {
  display: block;
  color: var(--accent-gold-hover);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.hero-feature-item span {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: block;
}

/* ==========================================================================
   CARD DA PERGUNTA ATIVA
   ========================================================================== */
.question-card {
  padding: 44px 40px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--accent-gold-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: assessmentSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.question-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(224, 184, 79, 0.24);
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-back:hover {
  background: rgba(224, 184, 79, 0.08);
  color: var(--accent-gold-hover);
  border-color: var(--accent-gold);
  transform: translateX(-2px);
}

.btn-back:focus-visible {
  outline: 2px solid var(--accent-gold-hover);
  outline-offset: 3px;
}

.question-eyebrow {
  color: var(--accent-gold-hover);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.question-title {
  font-family: var(--font-heading), serif;
  font-size: clamp(1.8rem, 3.8vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  outline: none;
}

.question-helper {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ==========================================================================
   OPÇÕES SELECIONÁVEIS
   ========================================================================== */
.options-grid {
  display: grid;
  gap: 14px;
}

.option-button {
  width: 100%;
  text-align: left;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: rgba(6, 21, 53, 0.72);
  border: 1px solid rgba(224, 184, 79, 0.18);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.option-button:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 16px rgba(212, 166, 60, 0.14);
}

.option-button:focus-visible {
  outline: 2px solid var(--accent-gold-hover);
  outline-offset: 3px;
}

.option-indicator {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(224, 184, 79, 0.4);
  flex-shrink: 0;
  margin-top: 3px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-button:hover .option-indicator {
  border-color: var(--accent-gold-hover);
  box-shadow: 0 0 8px rgba(224, 184, 79, 0.5);
}

.option-content {
  flex: 1;
}

.option-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.option-desc {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ==========================================================================
   INPUTS DE TEXTO E LEAD GATEWAY
   ========================================================================== */
.textarea-wrapper {
  margin-bottom: 28px;
}

.objective-textarea {
  width: 100%;
  min-height: 140px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: rgba(6, 21, 53, 0.8);
  border: 1px solid rgba(224, 184, 79, 0.24);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.02rem;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  transition: var(--transition-smooth);
}

.objective-textarea:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 4px rgba(212, 166, 60, 0.18);
}

.lead-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

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

.lead-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-gold-hover);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.lead-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(6, 21, 53, 0.8);
  border: 1px solid rgba(224, 184, 79, 0.24);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.98rem;
  outline: none;
  transition: var(--transition-smooth);
}

.lead-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 166, 60, 0.18);
}

/* Fix Autofill: Chrome, Edge, Safari e navegadores WebKit */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #061535 inset !important;
  -webkit-text-fill-color: #F8FAFC !important;
  caret-color: #F8FAFC !important;
  border-color: rgba(224, 184, 79, 0.4) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.consent-wrapper {
  margin-bottom: 24px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.consent-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-gold);
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.error-banner {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: rgba(220, 50, 50, 0.15);
  border: 1px solid rgba(255, 100, 100, 0.35);
  color: #ffb8b8;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.assessment-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(224, 184, 79, 0.25);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.assessment-id-badge code {
  color: var(--accent-gold-hover);
  font-weight: bold;
  font-family: monospace;
}

.privacy-consent {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.honeypot-input {
  display: none !important;
  opacity: 0;
  position: absolute;
  left: -9999px;
}

/* ==========================================================================
   BOTÕES PRINCIPAIS
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 32px;
  border-radius: var(--radius-pill);
  background: var(--accent-gold);
  color: var(--text-dark);
  font-size: 1.02rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 45px rgba(212, 166, 60, 0.32);
}

.btn-primary:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.btn-full {
  width: 100%;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(224, 184, 79, 0.28);
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(224, 184, 79, 0.08);
  border-color: var(--accent-gold-hover);
  color: var(--accent-gold-hover);
  transform: translateY(-2px);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--accent-gold-hover);
  outline-offset: 3px;
}

/* ==========================================================================
   TELA DE RESULTADO / LEITURA INICIAL
   ========================================================================== */
.result-card {
  padding: 52px 44px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--accent-gold-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: assessmentFadeIn 0.55s ease;
}

.result-icon-glow {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-pill);
  background: var(--accent-gold-soft);
  border: 1px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold-hover);
  font-size: 1.8rem;
  margin-bottom: 24px;
  box-shadow: var(--shadow-glow);
}

.result-lead-greeting {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-gold-hover);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.result-title {
  font-family: var(--font-heading), serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 600;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.result-reading-block {
  padding: 28px 32px;
  border-radius: var(--radius-md);
  background: rgba(4, 17, 45, 0.72);
  border: 1px solid rgba(224, 184, 79, 0.22);
  margin-bottom: 28px;
}

.result-reading-block p {
  font-size: 1.08rem;
  color: var(--text-primary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.result-reading-block p:last-child {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.result-closing-note {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}

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

/* ==========================================================================
   PAINEL FLUTUANTE DE DEPURAÇÃO (?debug=1)
   ========================================================================== */
.debug-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 440px;
  max-width: calc(100vw - 40px);
  max-height: 82vh;
  background: rgba(3, 10, 26, 0.97);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 166, 60, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: monospace;
  font-size: 0.78rem;
  color: #a0c0ff;
  overflow: hidden;
}

.debug-header {
  padding: 12px 16px;
  background: rgba(224, 184, 79, 0.15);
  border-bottom: 1px solid rgba(224, 184, 79, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--accent-gold-hover);
  font-weight: bold;
}

.debug-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.debug-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.debug-section-title {
  color: #fff;
  font-weight: bold;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.debug-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.debug-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.badge-low { background: rgba(80, 160, 255, 0.2); color: #80c0ff; }
.badge-medium { background: rgba(255, 200, 80, 0.2); color: #ffd080; }
.badge-high { background: rgba(255, 100, 80, 0.25); color: #ff9080; }
.badge-very_high { background: rgba(255, 50, 120, 0.35); color: #ff80b0; }

.debug-toggle-btn {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold-hover);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}

/* ==========================================================================
   ACESSIBILIDADE: PREFERS-REDUCED-MOTION
   ========================================================================== */
@keyframes assessmentFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

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

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

/* ==========================================================================
   RESPONSIVIDADE (375px, 390px, 430px, 768px, 1024px, 1440px)
   ========================================================================== */
@media (max-width: 768px) {
  .header-container {
    padding: 12px 16px;
  }
  
  .assessment-logo {
    width: 145px;
  }

  .header-badge span:last-child {
    font-size: 0.72rem;
  }
  
  .hero-card, .question-card, .result-card {
    padding: 32px 20px;
    border-radius: var(--radius-md);
  }
  
  .hero-features {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .lead-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .result-reading-block {
    padding: 20px 18px;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
  }

  .debug-panel {
    bottom: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    max-height: 50vh;
  }
}
