/**
 * Fijate Tools - Calculadora del desánimo inmobiliario
 * 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);
}

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

/* Banner superior publicitario */
.tools-ad-banner-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

/* Tarjeta principal */
.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;
}

/* Grupos de formulario */
.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-icon-prefix {
  position: absolute;
  left: 0.875rem;
  color: #64748b;
  pointer-events: none;
  font-size: 0.95rem;
}

.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 2.25rem;
  font-size: 0.95rem;
  font-family: var(--font-main);
  min-height: 44px;
  transition: all 0.2s ease;
}

.form-control.no-prefix {
  padding-left: 0.875rem;
}

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

/* Opciones de compra (Pills) */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.pill-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  background: #0b0f17;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 0.15s ease;
  user-select: none;
  min-height: 42px;
}

.pill-option input {
  display: none;
}

.pill-option.active,
.pill-option:has(input:checked) {
  background: rgba(37, 99, 235, 0.18);
  border-color: #3b82f6;
  color: #93c5fd;
  font-weight: 600;
}

/* Panel de resultados / veredicto */
.verdict-box {
  background: linear-gradient(145deg, #161f30 0%, #0d131f 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-badge-success {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 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;
}

/* Tarjetas de métricas (KPIs) */
.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;
}

/* Comparativa intergeneracional (Boomers vs Jóvenes) */
.comparison-card {
  background: #0d1524;
  border: 1px solid #1e2e4a;
  border-radius: 0.875rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.comparison-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.comp-box {
  background: #080d17;
  border-radius: 0.625rem;
  padding: 0.85rem;
  border: 1px solid #172338;
}

.comp-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.comp-kpi {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-heading);
  margin-bottom: 0.25rem;
}

.comp-kpi.boomer {
  color: #34d399;
}

.comp-kpi.millennial {
  color: #f43f5e;
}

.comp-detail {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

/* Botón viral para compartir */
.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);
}

/* Guía metodológica y preguntas frecuentes */
.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;
}

.formula-card {
  background: #080d17;
  border: 1px dashed #334155;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #cbd5e1;
  margin: 0.65rem 0;
}

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