/* style/style.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* variables de tema */
:root {
  --bg: #1e1e1e;
  --panel-bg: #1e1e1e;
  --text: #e0e0e0;
  --text-muted: #9aaeb9;
  --border: #3a4a5a;
  --accent: #45a29e;
  --input-bg: transparent;
  --input-border: #3a4a5a;
  --input-focus: #45a29e;
  --card-bg: #2a2f35;
  --slider-bg: #3a4a5a;
  --slider-thumb: #45a29e;
  --core-stat-bg: transparent;
  --focus-outline: 2px solid #45a29e;
}

body.light {
  --bg: #f5f5f5;
  --panel-bg: #ffffff;
  --text: #1e1e1e;
  --text-muted: #3e5a6b;
  --border: #a0b8cc;
  --accent: #006b70;
  --input-bg: #ffffff;
  --input-border: #a0b8cc;
  --input-focus: #006b70;
  --card-bg: #e8ecf0;
  --slider-bg: #a0b8cc;
  --slider-thumb: #006b70;
  --core-stat-bg: #eef2f6;
  --focus-outline: 2px solid #006b70;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background 0.2s,
    color 0.2s;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 100;
  border-radius: 0;
  font-family: monospace;
}

.dashboard {
  display: grid;
  grid-template-columns: 45% 55%;
  width: 100%;
  max-width: 1400px;
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.control-panel {
  background: var(--panel-bg);
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--border);
}

.results-panel {
  background: var(--panel-bg);
  padding: 2.5rem 2rem;
}

@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
    border: none;
  }
  .control-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
  .theme-toggle {
    padding: 0.75rem 1.2rem;
    font-size: 1rem;
  }
}

h1 {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 2rem;
  color: var(--text);
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.input-group {
  margin-bottom: 1.8rem;
}

.input-group label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.input-group input {
  background: var(--input-bg);
  border: none;
  border-bottom: 2px solid var(--input-border);
  padding: 0.5rem 0 0.3rem;
  width: 100%;
  color: var(--text);
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 1.2rem;
  outline: none;
  transition: border-color 0.15s;
}

.input-group input:focus {
  border-bottom-color: var(--accent);
}

.core-stats {
  display: flex;
  gap: 2rem;
  margin: 2.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--core-stat-bg);
}

.core-stat .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.core-stat .value {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 1.8rem;
  color: var(--text);
  line-height: 1.2;
}

.slider-block {
  margin: 2rem 0 2.5rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--text);
}

.slider-header label {
  font-size: 0.9rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.slider-value {
  font-family: monospace;
  font-size: 1.5rem;
  color: var(--accent);
  background: var(--card-bg);
  padding: 0.2rem 1rem;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: var(--slider-bg);
  border-radius: 0;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--slider-thumb);
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.results-section {
  margin-bottom: 2.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.metric-card {
  padding: 1.2rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.metric-card .period {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.metric-card .value {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 2rem;
  color: var(--text);
  line-height: 1.2;
  margin-top: 0.2rem;
  word-break: break-word;
}

.metric-card.year-card {
  border-top: 4px solid var(--accent);
  background: var(--card-bg);
}

.metric-card.year-card .value {
  font-size: 2.8rem;
}

.footnote {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.mono {
  font-family: monospace;
}

[aria-live="polite"] {
  /* sin estilo extra */
}
