﻿

/* =========================================================
   02) VARIABLES / PALETA
   ========================================================= */
:root {
  /* Paleta alineada con www.disc-neo.com */
  --brand-dark: #303947;
  --brand-bg: #f7f7f2;

  --paper: #f7f7f2;
  --paper-warm: #f2f2ec;
  --surface-main: #f7f7f2;
  --surface-card: #ffffff;
  --surface-hover: #f2f2ec;
  --border-subtle: #d8d8d0;
  --rule-soft: #e8e8df;

  --text-primary: #11110f;
  --text-secondary: #5e5e58;
  --text-muted: #8c8c84;

  --accent-primary: #11110f;
  --accent-success: #16a34a;

  /* Compatibilidad con código existente */
  --accent-purple: var(--accent-primary);

  /* Tipografía alineada con www.disc-neo.com */
  --font-sans: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --error-main: #b91c1c;
  --error-background: #fee2e2;

  --radius-card: 0.5rem;
  --radius-pill: 999px; /* botones tipo píldora: estándar visual para www, test y gestor */

  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-subtle: 0 4px 10px rgba(15, 23, 42, 0.05);

  /* ===== Marco unificado (DOBLE marco + sombra) ===== */
  --frame-radius-grid: 22px;
  --frame-ring-gap: 12px;
  --frame-ring-fill: #ffffff;
  --frame-ring-border: rgba(229, 231, 235, 0.95);
  --frame-inner-border: rgba(229, 231, 235, 0.75);
  --frame-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

/* =========================================================
   03) BASE / LAYOUT
   ========================================================= */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  background-color: var(--brand-bg);
  color: var(--text-primary);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 720px;
}

/* contenedor principal */
.main {
  background-color: var(--surface-main);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;

  flex-grow: 1;
  display: flex;
  flex-direction: column;

  padding-bottom: 60px;
}

.logo-max-width {
  max-width: 250px;
}


/* =========================================================
   03.1) LOGO EN PANTALLA DE INICIO
   ========================================================= */
.test-start-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.test-start-brand-logo {
  display: block;
  width: 240px;
  max-width: 82%;
  height: auto;
}

@media (max-width: 576px) {
  .test-start-brand {
    margin-bottom: 1.5rem;
  }

  .test-start-brand-logo {
    width: 190px;
  }
}

/* =========================================================
   04) TIPOGRAFÍA / UTILIDADES
   ========================================================= */
h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}
h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}

/* Texto base (p) suave */
p {
  font-weight: 400;
  color: var(--text-secondary);
}

p.light {
  font-weight: 500;
  color: var(--text-muted);
}

.mt-section {
  margin-top: 40px;
}
.mb-section {
  margin-bottom: 40px;
}

.smaller {
  font-size: 14px;
}
.gray-color {
  color: var(--text-secondary);
}

/* =========================================================
   05) BOTONES
   ========================================================= */
.btn,
button,
.button {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none !important;
  white-space: nowrap;
  text-align: center;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 0;
  transition: background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease, transform 0.18s ease;
}

button.full,
.button.full {
  width: 100%;
}

/* Botón principal: alineado con www.disc-neo.com */
.btn-color-principal,
.btn-color-principal:active,
.btn-color-principal:focus,
.btn-color-principal:active:focus {
  background-color: var(--accent-primary) !important;
  color: var(--paper) !important;
  border-radius: var(--radius-pill) !important;
  border: 1px solid var(--accent-primary) !important;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  padding: 1rem 1.8rem;
  min-height: 3.5rem;
  box-shadow: none !important;
}

.btn-color-principal:hover {
  background-color: #1f1f1c !important;
  color: var(--paper) !important;
  border-color: #1f1f1c !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

/* Botón secundario: alineado con www.disc-neo.com */
.btn-white,
.btn-white:active,
.btn-white:focus,
.btn-outline-secondary,
.btn-outline-secondary:active,
.btn-outline-secondary:focus {
  background-color: var(--paper-warm) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-pill) !important;
  border: 1px solid var(--rule-soft) !important;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  padding: 1rem 1.8rem;
  min-height: 3.5rem;
  box-shadow: none !important;
}

.btn-white:hover,
.btn-outline-secondary:hover {
  background-color: var(--accent-primary) !important;
  color: var(--paper) !important;
  border-color: var(--accent-primary) !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

.btn-wide {
  max-width: 360px;
  width: 100%;
}

/* =========================================================
   06) ENLACES
   ========================================================= */
a {
  color: var(--accent-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.06em;
}

.btn,
button,
input,
textarea,
select,
.form-control,
.form-select,
.accordion-button {
  font-family: var(--font-sans);
}

/* =========================================================
   07) CARDS / LISTAS (DEFAULT GLOBAL)
   ========================================================= */
.card {
  background-color: var(--surface-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.card-body {
  padding: 1.25rem 1.25rem;
}

.list-group-item {
  background-color: transparent;
  border: 0;
  padding-left: 0;
  padding-right: 0;
}

/* =========================================================
   07.1) INSTRUCCIONES — TONALIDAD UNIFICADA
   ========================================================= */
#intro_general,
#disc_instructivo,
#ipip_instructivo {
  color: var(--text-secondary);
}

#intro_general p,
#intro_general li,
#intro_general .list-group-item,
#disc_instructivo p,
#disc_instructivo li,
#disc_instructivo .list-group-item,
#ipip_instructivo p,
#ipip_instructivo li,
#ipip_instructivo .list-group-item {
  color: var(--text-secondary);
  font-weight: 400;
}

#intro_general li::marker,
#disc_instructivo li::marker,
#ipip_instructivo li::marker {
  color: var(--text-secondary);
}

#intro_general h2,
#intro_general h5,
#disc_instructivo h2,
#disc_instructivo h5,
#ipip_instructivo h2,
#ipip_instructivo h5 {
  color: var(--text-primary);
}

/* =========================================================
   08) PROGRESS / SPINNER
   ========================================================= */
.custom-progress-bar {
  background-color: var(--accent-primary) !important;
}

.custom-spinner,
.custom-spinner .spinner-border {
  color: var(--accent-primary);
}

#progressBarRespuesta {
  background-color: var(--accent-primary);
}

/* =========================================================
   09) FORMULARIOS / PARSLEY
   ========================================================= */
.form-floating > label {
  color: var(--text-muted);
}

.form-radius-container {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.radio-group input[type="radio"] {
  margin-right: 4px;
}

.radio-group-column {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.parsley-errors-list {
  color: var(--error-main);
  font-size: 0.9em;
  margin: 2px 0 5px;
  padding-left: 10px;
}

.parsley-error,
#alertPlaceholder {
  border-color: var(--error-main) !important;
  background-color: var(--error-background) !important;
}

.parsley-error .form-control {
  border-color: var(--error-main) !important;
  background-color: var(--error-background) !important;
}

.red {
  color: var(--error-main);
}
.text-error {
  font-size: 0.9em;
}
.big-pad {
  padding: 1rem 1.5rem;
}

#errorVerificacion:before {
  content: "• ";
}

/* =========================================================
   10) TABLAS (BASE) + DISC GRID
   ========================================================= */
table th {
  font-size: 14px;
  text-align: center;
  padding: 10px;
}

th.col-2 {
  width: 70px;
}
th {
  font-size: 0.875rem;
  text-align: center;
}

#testRasgoConducta {
  text-align: left;
}

.table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.table thead th {
  background: var(--surface-hover);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 18px;
}

.table tbody td {
  padding: 14px 18px;
  font-size: 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table thead th + th,
.table tbody td + td {
  border-left: 1px solid var(--border-subtle);
}

.table thead th {
  padding: 10px 16px !important;
  height: 46px !important;
  line-height: 1.1 !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--border-subtle);
}
.table thead tr {
  height: 46px !important;
}

/* DISC table layout */
.table-disc {
  table-layout: fixed;
  width: 100%;
}

.table-disc col.col-frase {
  width: auto;
}
.table-disc col.col-mas,
.table-disc col.col-menos {
  width: 120px;
}

.table-disc td,
.table-disc th {
  display: table-cell !important;
  vertical-align: middle !important;
}

.table-disc td.masAfin,
.table-disc td.menosAfin {
  text-align: center;
}

.selector-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

.selector-mas.selected {
  background: url("/images/mas_a_fin.svg") center center no-repeat;
  background-size: contain;
}
.selector-menos.selected {
  background: url("/images/menos_a_fin.svg") center center no-repeat;
  background-size: contain;
}

#testContenido tr {
  height: 56px;
}
#testContenido td:first-child {
  line-height: 1.45;
}

#modal_image {
  width: 250px;
  height: 250px;
}

/* =========================================================
   11) MODALES
   ========================================================= */
.modal-content {
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.modal-body p {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

/* =========================================================
   12) IPIP (radios + encabezados)
   ========================================================= */
#ipip_test .form-check-input[type="radio"] {
  accent-color: #111827;
  transform: scale(1.25);
  transform-origin: center;
  cursor: pointer;
}

#ipip_test .col.text-center .small {
  user-select: none;
}

#ipip_test .ipip-colhead {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  line-height: 1;
  color: var(--text-muted);
  height: 88px;
  margin: 0 auto 6px auto;
  user-select: none;
}

#ipip_test .ipip-col {
  min-width: 44px;
}

/* ✅ Zona clicable ampliada */
#ipip_test .ipip-choice {
  padding: 10px 0;
  cursor: pointer;
}

/* Hover sutil para indicar “clicable” */
#ipip_test .ipip-choice:hover {
  background: rgba(17, 24, 39, 0.03);
  border-radius: 10px;
}

/* =========================================================
   13) SISTEMA UNIFICADO DE MARCOS (DOBLE) + MINIMALISMO
   ========================================================= */
#intro_general .card,
#disc_instructivo .card,
#ipip_instructivo .card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#intro_general .card-body,
#disc_instructivo .card-body,
#ipip_instructivo .card-body {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#disc_test .card,
#ipip_test .card {
  background: transparent;
  border: none;
  box-shadow: none;
}

#disc_test .card-body,
#ipip_test .card-body {
  padding-left: 0;
  padding-right: 0;
}

.frame-double {
  border-radius: var(--frame-radius-grid) !important;
  overflow: hidden !important;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 0 0 1px var(--frame-inner-border),
    0 0 0 var(--frame-ring-gap) var(--frame-ring-fill),
    0 0 0 calc(var(--frame-ring-gap) + 1px) var(--frame-ring-border),
    var(--frame-shadow);
}

#registroGrid {
  position: relative;
  border-radius: var(--frame-radius-grid) !important;
  overflow: hidden !important;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 0 0 1px var(--frame-inner-border),
    0 0 0 var(--frame-ring-gap) var(--frame-ring-fill),
    0 0 0 calc(var(--frame-ring-gap) + 1px) var(--frame-ring-border),
    var(--frame-shadow);
}

#registroGrid .card.card-flat {
  background-color: #ffffff !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-subtle) !important;
  border-radius: var(--radius-card) !important;
}

/* DISC: marco doble (desktop) */
#disc_test table.table-disc {
  border-radius: var(--frame-radius-grid) !important;
  overflow: hidden !important;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 0 0 1px var(--frame-inner-border),
    0 0 0 var(--frame-ring-gap) var(--frame-ring-fill),
    0 0 0 calc(var(--frame-ring-gap) + 1px) var(--frame-ring-border),
    var(--frame-shadow);
}

/* IPIP: marco doble (desktop) */
#ipip_test #ipipPagina .card {
  background: #ffffff !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow:
    0 0 0 1px var(--frame-inner-border),
    0 0 0 var(--frame-ring-gap) var(--frame-ring-fill),
    0 0 0 calc(var(--frame-ring-gap) + 1px) var(--frame-ring-border),
    var(--frame-shadow) !important;
  border-radius: var(--frame-radius-grid) !important;
  overflow: hidden !important;
}

#ipip_test #ipipPagina .card .row.g-3.align-items-end.mb-3 {
  margin-bottom: 0 !important;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

#ipip_test #ipipPagina .card .card-body {
  padding: 18px !important;
}

#ipip_test #ipipPagina .card .row.g-3.align-items-end.mb-3 {
  background: var(--surface-hover) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  margin: -18px -18px 0 -18px !important;
  padding: 14px 18px 14px 18px !important;
  border-top-left-radius: var(--frame-radius-grid);
  border-top-right-radius: var(--frame-radius-grid);
}

#ipip_test #ipipPagina .card .d-flex.flex-column {
  margin-top: 0 !important;
}

/* =========================================================
   14) NAVBAR (si luego se usa)
   ========================================================= */
.navbar {
  background-color: transparent;
}
.navbar-nav {
  display: flex;
  justify-content: center;
  width: 100%;
}
.nav-item {
  margin: 0 10px;
}
.navbar-toggler {
  border: none;
}

/* ===========================
   Alerts: desaparecer de abajo hacia arriba
   (animación via jQuery slideUp, sin CSS adicional)
   =========================== */

/* =========================================================
   15) RESPONSIVE
   ========================================================= */
@media (max-width: 576px) {
  :root {
    --frame-radius-grid: 18px;
    --frame-ring-gap: 10px;
  }

  body {
    font-size: 14px;
  }
  h2 {
    font-size: 18px;
  }

  .mt-section {
    margin-top: 24px;
  }
  .mb-section {
    margin-bottom: 24px;
  }

  .row.mt-5 {
    margin-top: 1.5rem !important;
  }

  .card.mb-4 {
    margin-bottom: 12px !important;
  }

  /* Que el grid (tabla DISC / IPIP) tenga el mismo ancho visual que la barra de progreso */
  #disc_test .table-wrap-mobile,
  #ipip_test .table-wrap-mobile {
    padding-left: 0;
    padding-right: 0;
  }

  /* ===== DISC: quitar doble marco en móvil ===== */
  #disc_test table.table-disc {
    box-shadow: none !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
  }
  #disc_test .table.table-disc {
    box-shadow: none !important;
  }

  .table-disc col.col-mas,
  .table-disc col.col-menos {
    width: 70px;
  }
  .table-disc th,
  .table-disc td {
    font-size: 13px;
    padding: 8px 6px;
  }

  #testRasgoConducta {
    font-size: 12px;
  }

  #testContenido td:first-child {
    font-size: 14px;
    line-height: 1.4;
    word-break: normal;
    white-space: normal;
  }

  .selector-icon {
    width: 20px;
    height: 20px;
  }
  #testContenido tr {
    height: 48px;
  }

  /* ===== IPIP: quitar doble marco en móvil ===== */
  #ipip_test #ipipPagina .card {
    box-shadow: none !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    overflow: hidden !important;
  }

  #ipip_test .ipip-colhead {
    display: none !important;
  }

  /* ===== FIX: elimina la franja blanca del header (1–5) en móvil =====
     - Quitamos el margin negativo (causaba el "gap")
     - Hacemos header a 0 y padding propio
     - El contenido recibe padding por separado
  */
  #ipip_test #ipipPagina .card .card-body {
    padding: 0 !important;
  }

  #ipip_test #ipipPagina .card .row.g-3.align-items-end.mb-3 {
    margin: 0 !important;
    padding: 12px !important;
    background: var(--surface-hover) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
  }

  #ipip_test #ipipPagina .card .d-flex.flex-column {
    padding: 12px !important;
    margin-top: 0 !important;
  }
}

/* =========================================================
   16) TONALIDAD UNIFICADA EN TEXTOS DE AYUDA (DISC/IPIP TEST)
   ========================================================= */
#disc_test #discGrupoCounter,
#ipip_test #ipipGrupoCounter {
  color: var(--text-secondary) !important;
  font-weight: 400;
}

#disc_test .card-body,
#ipip_test .card-body {
  color: var(--text-secondary);
}

#disc_test .card-body p,
#ipip_test .card-body p,
#disc_test .card-body li,
#ipip_test .card-body li,
#disc_test .card-body .gray-color,
#ipip_test .card-body .gray-color {
  color: var(--text-secondary) !important;
  font-weight: 400;
}

#disc_test h2,
#ipip_test h2 {
  color: var(--text-primary) !important;
}

#disc_test table.table-disc td {
  color: var(--text-primary);
}
#ipip_test #ipipPagina .fw-semibold {
  color: var(--text-primary);
}

#disc_test .card-body strong,
#ipip_test .card-body strong,
#intro_general .card-body strong,
#disc_instructivo .card-body strong,
#ipip_instructivo .card-body strong {
  color: inherit;
  font-weight: 600;
}

/* =========================================================
   17) PANTALLA INICIAL — LOGO ARRIBA + FORMULARIO CENTRADO
   ========================================================= */
.test-start-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--brand-bg);
  padding: 32px 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-start-brand {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0 1rem;
}

.test-start-brand-logo {
  display: block;
  width: 240px;
  max-width: 70vw;
  height: auto;
}

.test-start-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
   transform: translateY(-40px);
}

.test-start-panel {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 576px) {

  .test-start-container {
    transform: translateY(-20px);
  }

  .test-start-page {
    min-height: 100svh;
    padding: 24px 1rem;
  }

  .test-start-brand {
    top: 24px;
  }

  .test-start-brand-logo {
    width: 190px;
  }
}

/* En pantallas muy bajas, evitamos que el formulario se superponga al logo. */
@media (max-height: 720px) {
  .test-start-page {
    align-items: flex-start;
    padding-top: 132px;
  }
}
