/* =========================================================================
   IUNOS – Questionnaire (escopo único)
   Tudo fica sob #questionnaire-app para evitar conflito com o resto do site
   ========================================================================= */

:root {
  --iunos-ivory: #F4F4F8;
  --iunos-deep-space: #191923;
  --iunos-warm-gray: #4A4A52;
  --iunos-soft-plum: #522B47;
  --iunos-rose-gold: #B9929F;
}

/* /assets/css/local-fonts.css */

/* Inter Normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/Inter/Inter-VariableFont_opsz,wght.woff2') format('woff2');
}

/* Inter Italic */
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.woff2') format('woff2');
}

/* Lora Normal */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/Lora/Lora-VariableFont_wght.woff2') format('woff2');
}

/* Lora Italic */
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/Lora/Lora-Italic-VariableFont_wght.woff2') format('woff2');
}

/* --- Reset mínimo local --- */
#questionnaire-app * { box-sizing: border-box; }
#questionnaire-app h1, 
#questionnaire-app h2, 
#questionnaire-app h3, 
#questionnaire-app p { margin: 0; }

/* --- Página centrada vertical/horizontal --- */
body.questionnaire-body {
  background: var(--iunos-ivory);
  min-height: 100vh;
  display: flex;
  align-items: center; 
  justify-content: center; 
  color: var(--iunos-deep-space);
}

/* --- Wrapper com escopo único --- */
#questionnaire-app {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

/* --- Container interno que o JS usa (mantido id="app") --- */
#questionnaire-app #app {
  width: 100%;
}

/* --- Painéis / telas --- */
#questionnaire-app .screen-panel {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
  text-align: center;
}

/* --- Títulos --- */
#questionnaire-app .screen-title {
  font-family: var(--font-heading, 'Inter', sans-serif); /* ADD THIS LINE */
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--iunos-deep-space);
  margin-bottom: 8px;
}

#questionnaire-app .screen-subtitle {
  font-family: var(--font-body, 'Lora', serif); /* ADD THIS LINE */
  color: var(--iunos-warm-gray);
  margin-bottom: 20px;
}

/* --- Botões --- */
#questionnaire-app .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading, 'Inter', sans-serif); /* Use heading font */
  font-weight: 600;
  padding: 14px 30px; /* Adjusted padding */
  border-radius: 50px; /* Pill shape */
  text-decoration: none;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
}
#questionnaire-app .btn:disabled {
  opacity: .45; /* Adjusted for better visibility */
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background-color: transparent !important; /* Ensure background doesn't interfere */
}
#questionnaire-app .btn-primary {
  background-color: transparent;
  border: 2px solid var(--iunos-rose-gold);
  color: var(--iunos-rose-gold);
}
#questionnaire-app .btn-primary:not(:disabled):hover {
  background-color: var(--iunos-rose-gold);
  color: var(--iunos-deep-space);
  box-shadow: 0 5px 20px rgba(185, 146, 159, 0.25);
  transform: translateY(-4px);
}
#questionnaire-app .btn-secondary {
  background-color: transparent;
  border: 2px solid var(--iunos-warm-gray);
  color: var(--iunos-warm-gray);
}
#questionnaire-app .btn-secondary:not(:disabled):hover { 
  background-color: var(--iunos-warm-gray);
  color: var(--iunos-ivory);
  transform: translateY(-2px);
}
#questionnaire-app .btn-full { width: 100%; }

/* --- Header do questionário e navegação --- */
#questionnaire-app .q-header,
#questionnaire-app .q-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#questionnaire-app .q-header { margin-bottom: 16px; }
#questionnaire-app .q-navigation { margin-top: 20px; }

.q-dimension-name {
    color: #555; 
}

/* --- Barra de progresso --- */
#questionnaire-app .progress-bar-wrapper {
  width: 100%;
  background: #F8F8F8; /* Even Lighter gray */
  border-radius: 9999px;
  height: 8px;
  margin: 18px 0 24px 0;
  overflow: hidden;
}
#questionnaire-app .progress-bar-fill {
  background: var(--iunos-rose-gold);
  height: 8px;
  width: 0%;
  border-radius: 9999px;
  transition: width .45s ease;
}

/* --- Área da pergunta --- */
#questionnaire-app .question-area {
  min-height: 120px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#questionnaire-app .question-text {
  font-family: var(--font-heading, 'Inter', sans-serif); /* ADD THIS LINE */
  font-size: 26px; /* Increased question size */
  line-height: 1.35;
  font-weight: 600;
  color: var(--iunos-deep-space);
  text-align: center;
}

/* --- Slider / valor --- */
#questionnaire-app .slider-wrapper { margin: 24px -15px 8px -15px; }

#questionnaire-app input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 20px; /* UPDATED: 20% thicker (from 16px) */
  background: #e5e7eb; border-radius: 9999px;
  outline: none; opacity: .85; transition: opacity .2s;
}
#questionnaire-app input[type=range]:hover { opacity: 1; }
#questionnaire-app input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; /* UPDATED: Slightly larger handle */
  border-radius: 50%;
  background: var(--iunos-soft-plum);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
  cursor: pointer;
}
#questionnaire-app input[type=range]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--iunos-soft-plum);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
  cursor: pointer;
}

#questionnaire-app .slider-value-text {
  text-align: center;
  font-size: 22px;   /* VERKLEINERT für weniger Dominanz */
  font-weight: 600;  /* REDUZIERT für ein weicheres Aussehen */
  margin-top: 10px;
  color: var(--iunos-soft-plum);
  opacity: 0.75;     /* HINZUGEFÜGT für Transparenz */
}

/* --- Milestone / dica contextual --- */
#questionnaire-app .milestone-feedback {
  min-height: 110px;
  text-align: center;
  color: #444; /* Slightly darker for better contrast */
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s ease;
  /* font-style: italic; --- REMOVED for readability */
  font-size: 18px;    /* INCREASED size */
  font-weight: 500;   /* ADDED for clarity */
  line-height: 1.4;   /* ADDED for better line spacing */
}

/* --- Estados utilitários --- */
#questionnaire-app .hidden { display: none !important; }

#questionnaire-app .fade-in { animation: qaFade .4s ease both; }
@keyframes qaFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Spinner --- */
#questionnaire-app .spinner {
  border: 4px solid rgba(0,0,0,.1);
  border-left-color: var(--iunos-soft-plum);
  width: 36px; height: 36px; border-radius: 50%;
  animation: qaSpin 1s linear infinite;
  margin: 0 auto;
}
@keyframes qaSpin { to { transform: rotate(360deg); } }

/* --- Acessibilidade visual helper --- */
#questionnaire-app .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* --- Responsivo --- */
@media (max-width: 480px) {
  #questionnaire-app { padding: 16px; }
  #questionnaire-app .screen-panel { padding: 22px; }
  #questionnaire-app .screen-title { font-size: 26px; }
  #questionnaire-app .question-text { font-size: 20px; }

  /* --- NEW: Better Mobile Buttons --- */
  #questionnaire-app .q-navigation {
    gap: 12px; /* Adds space between the Back and Next buttons */
  }
  #questionnaire-app .q-navigation .btn {
    flex-grow: 1; /* Makes both buttons share the width equally */
    padding-top: 16px;    /* Increases vertical padding for a larger tap area */
    padding-bottom: 16px; /* Increases vertical padding for a larger tap area */
  }
}


html {
  /* para âncoras/scroll até seções não ficarem escondidas */
  scroll-padding-top: var(--qa-header-h, 80px);
}

.qa-viewport {
  /* espaço para não ficar colado sob o header/footer */
  margin-top: var(--qa-header-h, 80px);
  margin-bottom: var(--qa-footer-h, 0px);

  /* ocupa só a área visível restante, mantendo o centro perfeito */
  min-height: calc(100svh - var(--qa-header-h, 80px) - var(--qa-footer-h, 60px));

  display: flex;
  align-items: center;     /* centraliza verticalmente */
  justify-content: center; /* centraliza horizontalmente */
  background-color: var(--iunos-soft-plum, #F4F4F8);
  
  /* NEW PROPERTIES FOR BACKGROUND IMAGE */
  background-size: auto;
  background-position: center center;
  background-repeat: repeat;
}

/* Improves the style of the disabled back/next buttons */
.q-navigation .btn:disabled {
  background-color: #f0f0f0; 
  color: #b0b0b0;          
  cursor: not-allowed;    
  opacity: 0.7;            

}
.q-dimension-name {
    color: #555; 
}


/* =========================================================================
   NEW START SCREEN STYLES (with final spacing adjustments)
   ========================================================================= */

/* Card padding: 48–56px top/bottom, 24–28px sides → 28px / 16px on mobile. */
#questionnaire-app #start-screen.screen-panel {
  padding: 56px 28px 40px; /* Top, Sides, Bottom */
}

/* Dynamic Intro Container (Icon + Kicker) */
.dynamic-intro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin-bottom: 12px; /* Kicker → H1: 12px */
  color: var(--iunos-soft-plum);
}

#dynamic-intro-icon {
  font-size: 4rem;
  margin-bottom: 8px; /* Icon → kicker: 8px */
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

#dynamic-intro-text {
  font-size: 1.25rem;
  font-weight: 500;
  min-height: 30px;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.is-fading {
  opacity: 0;
  transform: translateY(10px);
}

/* H1 → sub: 12px */
#start-screen .screen-title {
  margin-bottom: 12px;
}

/* Sub → chips row: 32px (Increased) */
/* Max text width: 52–60ch for subline. */
#start-screen .screen-subtitle {
  margin-bottom: 32px; /* UPDATED from 24px */
  max-width: 55ch;
  margin-left: auto;
  margin-right: auto;
}

/* Info Chips */
.info-chips {
  display: flex;
  justify-content: center;
  gap: 8px; /* Chip gap: 8px */
  flex-wrap: wrap;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--iunos-ivory);
  color: var(--iunos-warm-gray);
  padding: 8px 12px; /* chip padding: 8px 12px */
  border-radius: 20px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid #E5E7EB;
}

.info-chip .material-symbols-outlined {
  font-size: 20px;
}


#start-screen .btn-primary {
  display: flex;
  width: 100%;
  max-width: 420px; 
  min-height: 56px; 
  margin: 24px auto 24px; 
}

.start-screen-footer {
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(25, 25, 35, 0.12);
  text-align: center;
}

.show-dimensions-toggle {
  cursor: pointer;
  color: var(--iunos-warm-gray);
  font-weight: 500;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}
.show-dimensions-toggle:hover {
  color: var(--iunos-deep-space);
}

/*
  =========== BUG FIX 2 ===========
  The JS now handles the arrow icon change by swapping text content
  ('expand_more' <=> 'expand_less'). The CSS transform was conflicting
  with this, causing a visual bug. It has been removed.
  ===============================
*/
.toggle-arrow {
  margin-left: 6px;
  /* The 'transform' transition is no longer needed */
}


/* Revealed Dimensions List */
.dimensions-detail-section {
    margin-top: 28px; 
    padding: 20px; 
    background-color: #f9fafb;
    border-radius: 8px;
    animation: qaFade .4s ease both;
}
.screen-title-small {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--iunos-deep-space);
    margin-bottom: 32px; 
    text-align: center;
}
.dimensions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}
.dimensions-list li {
  font-size: 14px;
  color: #4A4A52;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dimensions-list li:last-child {
  border-bottom: none;
}
.dimensions-list li strong {
  color: var(--iunos-deep-space);
  font-weight: 500;
}

/* Mobile responsive spacing */
@media (max-width: 480px) {
  #questionnaire-app #start-screen.screen-panel {
    padding: 28px 16px;
  }
}

.screen-title-small {
  margin-bottom: 1.5rem; /* Adjust this value as needed */
}

.dimensions-list li {
  color: #595959; /* You can adjust this gray to be lighter or darker */
}

/* =========================================================================
   NEW: Dimension-Specific SVG Background Fallbacks
========================================================================= 
*/
.dim-bg-1  { background-image: url('../images/svg/dim-bg-1.svg');  }
.dim-bg-2  { background-image: url('../images/svg/dim-bg-2.svg');  }
.dim-bg-3  { background-image: url('../images/svg/dim-bg-3.svg');  }
.dim-bg-4  { background-image: url('../images/svg/dim-bg-4.svg');  }
.dim-bg-5  { background-image: url('../images/svg/dim-bg-5.svg');  }
.dim-bg-6  { background-image: url('../images/svg/dim-bg-6.svg');  }
.dim-bg-7  { background-image: url('../images/svg/dim-bg-7.svg');  }
.dim-bg-8  { background-image: url('../images/svg/dim-bg-8.svg');  }
.dim-bg-9  { background-image: url('../images/svg/dim-bg-9.svg');  }
.dim-bg-10 { background-image: url('../images/svg/dim-bg-10.svg'); }
.dim-bg-11 { background-image: url('../images/svg/dim-bg-11.svg'); }
.dim-bg-12 { background-image: url('../images/svg/dim-bg-12.svg'); }
.dim-bg-13 { background-image: url('../images/svg/dim-bg-1.svg');  }

/* =========================================================================
   NEW: Completion Screen Analysis Animation
   ========================================================================= */

#completion-screen .screen-panel {
  min-height: 300px; /* Give it some space */
  display: flex;
  align-items: center;
  justify-content: center;
}

.analysis-step-text {
  margin-top: 16px;
  color: var(--iunos-warm-gray);
  font-weight: 500;
  align-items: center;  
  min-height: 24px; /* Prevent layout shift */
  transition: opacity 0.5s ease-in-out;
}

.q-dimension-name,
#questionnaire-app .q-info-text {
  font-size: 14px;
  color: #555;
}

#questionnaire-app .q-info-text {
  color: #6B7280;
}

/* =================================================================
   STYLES FOR QUESTIONNAIRE TERMS & CONDITIONS (REVISED)
   ================================================================= */

.terms-container {
    max-width: 550px;
    margin: 24px auto; /* Adjusted spacing */
    text-align: center;
}

.terms-summary {
  font-size: 14px;            
  color: var(--iunos-warm-gray);
  line-height: 1.4;           
  text-align: center; 
  padding: 8px 12px;         
  margin: 16px auto 24px;     
  font-weight: 400;           
}



.terms-checkbox-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background-color: rgba(0,0,0,0.02); /* Subtle background highlight */
    border-radius: 8px;
}

.terms-checkbox-wrapper label {
    font-size: 15px;
    color: var(--iunos-deep-space);
    cursor: pointer;
    user-select: none;
    text-align: left;
}

.terms-checkbox-wrapper a {
    color: var(--iunos-soft-plum);
    text-decoration: underline;
    font-weight: 600;
}

#terms-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--iunos-soft-plum);
}

