/* Calculadora de vida útil y desgaste de zapatillas de running - Estilos */
:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.12);
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --orange-color: #f97316;
  --danger-color: #ef4444;

  --bg-main: #0b0f17;
  --card-bg: #111827;
  --bg-card-header: #1f2937;
  --bg-input: #1e293b;
  --border-color: #374151;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --table-stripe: #162032;
  --radius-lg: 12px;
  --radius-md: 8px;
  --transition: all 0.2s ease;
}

[data-theme="light"] {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --bg-card-header: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --table-stripe: #f8fafc;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  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,
.brand-title,
.section-title,
.results-heading,
.methodology-title {
  font-family: var(--font-heading);
}

.mono,
.kpi-value,
code {
  font-family: var(--font-mono);
}

/* Layout */
.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%;
}

/* Card principal */
.card-main {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 2rem;
}

.intro-box {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text-main);
  line-height: 1.25;
}

.section-intro {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0;
}

/* Formulario */
.tool-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.form-group.span-2 {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

.label-hint {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input,
.form-select {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  color: var(--text-main);
  min-height: 42px;
  transition: var(--transition);
}

.input-with-suffix input {
  padding-right: 3rem;
  font-family: var(--font-mono);
}

.form-select {
  font-family: var(--font-main);
  cursor: pointer;
}

.input-with-suffix input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-suffix {
  position: absolute;
  right: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
  font-family: var(--font-mono);
}

/* Resultados */
.results-container {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.results-heading {
  font-size: 1.35rem;
  margin: 0 0 1.5rem;
  color: var(--text-main);
}

/* KPI Banner */
.kpi-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-item {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.kpi-item.highlight {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.kpi-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Barra de fatiga */
.wear-bar-card {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.wear-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.wear-bar-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.wear-bar-state {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.state-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
}

.state-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
}

.state-orange {
  background: rgba(249, 115, 22, 0.15);
  color: var(--orange-color);
}

.state-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
}

.wear-track {
  height: 14px;
  background: var(--bg-main);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.wear-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.wear-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Semáforo card */
.status-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card-header);
  margin-bottom: 2rem;
  transition: var(--transition);
}

.status-card.status-green {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.status-card.status-yellow {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.status-card.status-orange {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.08);
}

.status-card.status-red {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.status-icon-box {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}

.status-green .status-icon-box {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-yellow .status-icon-box {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.status-orange .status-icon-box {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

.status-red .status-icon-box {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.status-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.status-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Alertas de lesiones */
.injury-prevention-card {
  margin-bottom: 2rem;
}

.sub-heading {
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.sub-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.injury-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.injury-card {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.injury-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.injury-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.injury-risk-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.injury-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* Checklist de comprobación */
.checklist-card {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--card-bg);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.check-box-icon {
  flex-shrink: 0;
  color: var(--primary-color);
  margin-top: 0.1rem;
}

.check-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.check-text strong {
  color: var(--text-main);
}

/* FAQ y Metodología */
.methodology-card {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.accordion-item {
  margin-bottom: 1.25rem;
}

.accordion-header {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
  color: var(--text-main);
  font-weight: 600;
}

.accordion-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .card-main {
    padding: 1.25rem;
  }

  .kpi-banner {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-value {
    font-size: 1.6rem;
  }
}

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

  .injury-grid {
    grid-template-columns: 1fr;
  }
}
