/* ==========================================================================
   Variables y tokens de diseño corporativos Fijate Tools
   Herramienta: Test de roles de equipo de Belbin
   ========================================================================== */

:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema oscuro */
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #182234;
  --bg-card-hover: #1e293b;
  --bg-input: #0b1120;
  --border-color: #334155;
  --border-focus: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #cbd5e1;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-rgb: 59, 130, 246;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #334155;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-rgb: 37, 99, 235;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
}

.tool-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1536px) {
  .tool-with-sidebar {
    grid-template-columns: 1fr 300px;
  }
}

.tool-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

/* Hero */
.intro-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.intro-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.intro-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.intro-lead {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Barra de progreso */
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* Preguntas */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-row {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.question-row.answered {
  border-color: rgba(var(--primary-rgb), 0.4);
}

.q-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.q-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.q-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.opt-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.opt-label input[type="radio"] {
  display: none;
}

.opt-radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  transition: all 0.2s;
}

.opt-text {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text-dim);
}

.opt-label:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.opt-label.selected {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: var(--primary);
}

.opt-label.selected .opt-radio-dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.opt-label.selected .opt-text {
  color: var(--text-main);
}

/* Resultados */
.results-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.roles-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .roles-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.role-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.role-primary {
  border-color: var(--primary);
  border-width: 2px;
}

.role-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.role-cat-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.cat-action { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.cat-social { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.cat-mental { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.role-score-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.role-name {
  font-size: 1.25rem;
}

.role-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.role-details {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.role-mini-desc {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-dim);
}

/* Gráfica Canvas */
.belbin-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.canvas-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Simulador de equipo (Team Builder) */
.team-builder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.team-members-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.team-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

.member-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.member-name {
  font-weight: 600;
  color: var(--text-main);
}

.member-role-lbl {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.btn-del-mem {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.2rem;
}

.btn-del-mem:hover {
  color: #ef4444;
}

.add-member-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .add-member-bar {
    grid-template-columns: 1fr 1fr auto;
  }
}

.team-eval-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eval-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.eval-status-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.eval-balanced {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.eval-balanced .eval-desc { color: var(--text-dim); }

.eval-unbalanced {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.eval-unbalanced .eval-desc { color: var(--text-dim); }

.eval-missing-list {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.eval-desc {
  font-size: 0.85rem;
  line-height: 1.45;
}

.form-input,
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 0.85rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.form-select option {
  background-color: var(--bg-surface);
  color: var(--text-main);
}

/* Botones */
.actions-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

@media (min-width: 640px) {
  .actions-bar {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  min-height: 42px;
  width: 100%;
}

@media (min-width: 640px) {
  .btn { width: auto; }
}

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-surface); color: var(--text-main); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--primary); }

.hidden { display: none !important; }

/* Modal */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.custom-modal-overlay.active { display: flex; }

.custom-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* @media print */
#print-sheet { display: none; }

@media print {
  header.app-header,
  footer.fijate-footer,
  aside.tool-ad-sidebar,
  section.tools-ad-banner-section,
  .intro-hero,
  .progress-card,
  .questions-list,
  .team-builder-card,
  .actions-bar,
  .custom-modal-overlay {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
    padding: 0;
    margin: 0;
  }

  #print-sheet {
    display: block !important;
    padding: 10mm;
  }

  .print-report-header {
    border-bottom: 2px solid #0f172a;
    padding-bottom: 4mm;
    margin-bottom: 4mm;
  }

  .print-title {
    font-size: 14pt;
    font-weight: 800;
    margin-bottom: 2mm;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2mm 6mm;
    font-size: 9pt;
  }
}
