/* ==========================================================================
   Calculadora de 1RM lastrado para calistenia y Streetlifting - Estilos
   ========================================================================== */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema claro */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-card: #e2e8f0;
  --border-subtle: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-strong: #0284c7;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;

  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-green: #16a34a;
  --accent-green-light: #dcfce7;
  --accent-purple: #9333ea;
  --accent-purple-light: #f3e8ff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b2b;
  --bg-card-subtle: #1a2438;
  --bg-input: #0f172a;
  --border-card: #24324d;
  --border-subtle: #334155;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-strong: #38bdf8;

  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-light: rgba(56, 189, 248, 0.12);

  --accent-amber: #fbbf24;
  --accent-amber-light: rgba(251, 191, 36, 0.15);
  --accent-green: #4ade80;
  --accent-green-light: rgba(74, 222, 128, 0.15);
  --accent-purple: #c084fc;
  --accent-purple-light: rgba(192, 132, 252, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

h1, h2, h3, h4, h5, h6,
.section-title,
.hero-title,
.faq-section-title,
.brand-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.mono {
  font-family: var(--font-mono);
}

/* Layout canónico */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Tarjeta principal */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.tool-intro {
  margin-bottom: 1.75rem;
}

.tool-intro h2 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

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

/* Formulario de entradas */
.streetlifting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.input-group {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.input-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-select {
  width: 100%;
  height: 44px;
  padding: 0 2.5rem 0 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  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='%2364748b' 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 0.8rem center;
}

.gender-toggle-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.gender-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
  user-select: none;
}

.gender-label input {
  display: none;
}

.gender-label:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Stepper de peso */
.stepper-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.stepper-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.stepper-input-box {
  position: relative;
  flex: 1 1 0%;
}

.stepper-input-box input {
  width: 100%;
  height: 44px;
  padding: 0 2.2rem 0 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 1.15rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.stepper-unit {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
}

/* Hero de resultados */
.results-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.hero-stat-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.hero-stat-card.featured {
  background: linear-gradient(135deg, var(--bg-card-subtle) 0%, var(--primary-light) 100%);
  border-color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.stat-value .unit {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* Nivel oficial de Streetlifting */
.level-meter-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.level-meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.level-meter-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.level-pill-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.level-principiante { background: #e2e8f0; color: #475569; }
.level-intermedio { background: var(--primary-light); color: var(--primary); }
.level-avanzado { background: var(--accent-amber-light); color: var(--accent-amber); }
.level-élite, .level-elite { background: var(--accent-purple-light); color: var(--accent-purple); }
.level-clase-mundial { background: var(--accent-green-light); color: var(--accent-green); }

.level-progress-track {
  height: 8px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.level-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #10b981 100%);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.level-desc-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.level-next-text {
  font-size: 0.82rem;
  color: var(--text-main);
  margin: 0;
}

/* Caja de advertencia de error tradicional */
.naive-comparison-box {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  margin-bottom: 1.75rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
}

/* Fórmulas comparativas */
.formulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.formula-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.formula-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.formula-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Tabla de porcentajes */
.percentages-section {
  margin-top: 1rem;
}

.percentages-section h3 {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}

.percentages-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.percentages-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.percentages-table th {
  background: var(--bg-card-subtle);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.percentages-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-main);
  white-space: nowrap;
}

.table-row-highlight {
  background: rgba(2, 132, 199, 0.05);
}

[data-theme="dark"] .table-row-highlight {
  background: rgba(56, 189, 248, 0.08);
}

.plate-weight-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.plate-weight-tag.positive {
  background: var(--primary-light);
  color: var(--primary);
}

.plate-weight-tag.neutral {
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.plate-weight-tag.assistance {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

.zone-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* FAQ */
.faq-section {
  margin-top: 2rem;
}

.faq-title {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  font-weight: 700;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2rem;
  }

  .card-main {
    padding: 1.25rem;
  }

  .results-hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .results-hero-grid {
    grid-template-columns: 1fr;
  }
}
