/**
 * Fijate Tools - Calculadora del día de la liberación fiscal personal
 * Estilos canónicos basados en variables corporativas
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --bg-card: #111827;
  --bg-card-alt: #1a2234;
  --border-color: #1f293d;
  --border-focus: #3b82f6;
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-accent: #38bdf8;
  --danger-color: #f43f5e;
  --warning-color: #f59e0b;
  --success-color: #10b981;
}

body {
  font-family: var(--font-main);
  background-color: #0b0f17;
  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,
.card-title,
.stat-title,
.verdict-heading {
  font-family: var(--font-heading);
}

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

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

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

.tools-ad-banner-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.panel-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: #f9fafb;
}

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

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.45rem;
}

.form-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: #64748b;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

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

.form-control {
  width: 100%;
  box-sizing: border-box;
  background: #0b0f17;
  border: 1px solid #334155;
  color: #f8fafc;
  border-radius: 0.625rem;
  padding: 0.75rem 2.5rem 0.75rem 0.875rem;
  font-size: 0.95rem;
  font-family: var(--font-main);
  min-height: 44px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

select.form-control {
  appearance: none;
  -webkit-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 0.875rem center;
  background-size: 16px;
  padding-right: 2.5rem;
  cursor: pointer;
}

select.form-control option {
  background: #111827;
  color: #f8fafc;
}

/* Veredicto de liberación fiscal */
.verdict-box {
  background: linear-gradient(145deg, #171d2d 0%, #0d121c 100%);
  border: 1px solid #28354d;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.verdict-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b, #10b981);
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.verdict-badge-danger {
  background: rgba(244, 63, 94, 0.16);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.verdict-badge-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.verdict-main-result {
  font-size: 2.25rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: #ffffff;
}

.verdict-desc {
  font-size: 1rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin: 0 auto;
  max-width: 480px;
}

/* Barra de progreso del año fiscal */
.fiscal-year-progress-wrap {
  margin: 1.25rem 0 1.5rem;
  background: #080d17;
  border: 1px solid #1e293b;
  border-radius: 0.875rem;
  padding: 1rem;
}

.fiscal-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.fiscal-bar-container {
  height: 20px;
  width: 100%;
  background: #1e293b;
  border-radius: 9999px;
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.fiscal-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.seg-ss-empresa { background: #f43f5e; }
.seg-irpf { background: #f59e0b; }
.seg-ss-trabajador { background: #ec4899; }
.seg-iva { background: #8b5cf6; }
.seg-otros { background: #3b82f6; }
.seg-libre { background: #10b981; }

.fiscal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.775rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* KPIs de la cuña fiscal */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #0b0f17;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.775rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
}

.kpi-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* Desglose cronológico */
.timeline-card {
  background: #0d1524;
  border: 1px solid #1e2e4a;
  border-radius: 0.875rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  background: #080d17;
  border-radius: 0.5rem;
  border: 1px solid #172338;
}

.timeline-row-name {
  color: #e2e8f0;
  font-weight: 500;
}

.timeline-row-date {
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.btn-viral-share {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.75rem;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-viral-share:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.edu-section {
  margin-top: 2.5rem;
  border-top: 1px solid #1e293b;
  padding-top: 2rem;
}

.edu-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 1.25rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.faq-q {
  font-size: 1.05rem;
  font-weight: 700;
  color: #38bdf8;
  margin: 0 0 0.5rem;
}

.faq-a {
  font-size: 0.925rem;
  line-height: 1.55;
  color: #94a3b8;
  margin: 0;
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .verdict-main-result {
    font-size: 1.85rem;
  }
}
