/* PERPLEXITY DESIGN SYSTEM - Sin variables CSS - Colores Financieros */

/* Base styles */
html {
  font-size: 14px;
  font-family: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #f8f9fa;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 30px;
}
h2 {
  font-size: 24px;
}
h3 {
  font-size: 20px;
}
h4 {
  font-size: 18px;
}
h5 {
  font-size: 16px;
}
h6 {
  font-size: 14px;
}

p {
  margin: 0 0 16px 0;
}

a {
  color: #0066cc;
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: #004499;
}

code,
pre {
  font-family: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  font-size: 13.3px;
  background-color: #f1f3f4;
  border-radius: 4px;
}

code {
  padding: 1px 4px;
}

pre {
  padding: 16px;
  margin: 16px 0;
  overflow: auto;
  border: 1px solid #e0e0e0;
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all 200ms ease;
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #0066cc;
}

.btn--primary {
  background: #0066cc;
  color: white;
  border: 1px solid #0052a3;
}

.btn--primary:hover {
  background: #0052a3;
  transform: translateY(-1px);
}

.btn--primary:active {
  background: #004080;
  transform: translateY(0);
}

.btn--secondary {
  background: #6c757d;
  color: white;
  border: 1px solid #5a6268;
}

.btn--secondary:hover {
  background: #5a6268;
}

.btn--outline {
  background: transparent;
  border: 1px solid #0066cc;
  color: #0066cc;
}

.btn--outline:hover {
  background: #0066cc;
  color: white;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
}

.btn--lg {
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 6px;
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: white;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition: border-color 150ms ease;
}

.form-control:focus {
  border-color: #0066cc;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

textarea.form-control {
  font-family: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
}

select.form-control {
  padding: 8px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  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='%230066cc' 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 12px center;
  background-size: 16px;
  padding-right: 32px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #1a1a1a;
}

.form-group {
  margin-bottom: 16px;
}

/* Card component */
.card {
  background-color: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 200ms ease;
}

.card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card__body {
  padding: 16px;
}

.card__header,
.card__footer {
  padding: 16px;
  border-bottom: 1px solid #e0e0e0;
}

/* Status indicators */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 12px;
}

.status--success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status--error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status--warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status--info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: 16px;
  padding-left: 16px;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: 4px;
}
.gap-8 {
  gap: 8px;
}
.gap-16 {
  gap: 16px;
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: 8px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mx-8 {
  margin-left: 8px;
  margin-right: 8px;
}
.my-8 {
  margin-top: 8px;
  margin-bottom: 8px;
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: 8px;
  padding-bottom: 8px;
}
.px-8 {
  padding-left: 8px;
  padding-right: 8px;
}
.py-16 {
  padding-top: 16px;
  padding-bottom: 16px;
}
.px-16 {
  padding-left: 16px;
  padding-right: 16px;
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

/* END PERPLEXITY DESIGN SYSTEM */
/* CDT Simulator Professional Styles - Colombia 2025 */

/* Header */
.header {
  background-color: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header h1 {
  color: #0066cc;
  font-size: 24px;
  margin: 0;
  font-weight: 600;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 50px;
  background: #e9ecef;
  border: 1px solid #ced4da;
  cursor: pointer;
  transition: all 150ms ease;
}

.theme-toggle:hover {
  background: #dee2e6;
}

.theme-icon {
  font-size: 16px;
}

/* Market Indicators */
.market-indicators {
  margin-bottom: 32px;
  padding: 20px 0;
}

.indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.indicator-card {
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 150ms ease;
}

.indicator-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.indicator-card h4 {
  margin: 0 0 8px 0;
  color: #6c757d;
  font-size: 12px;
  font-weight: 500;
}

.indicator-value {
  font-size: 18px;
  font-weight: 600;
  color: #0066cc;
  display: block;
}

/* Main Content */
.main {
  padding: 32px 0;
  min-height: 60vh;
}

/* Calculator Section */
.calculator-section {
  margin-bottom: 32px;
}

.calculator-form h2 {
  margin-bottom: 24px;
  color: #1a1a1a;
  font-size: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.form-text {
  font-size: 12px;
  color: #6c757d;
  margin-top: 4px;
}

/* Alerts Section */
.alerts-section {
  margin-bottom: 24px;
}

.alert {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 16px;
}

.alert h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.alert p {
  margin: 0;
  font-size: 12px;
}

.alert ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.alert-success {
  background-color: rgba(33, 128, 141, 0.1);
  border-color: rgba(33, 128, 141, 0.3);
  color: #155724;
}

.alert-warning {
  background-color: rgba(168, 75, 47, 0.1);
  border-color: rgba(168, 75, 47, 0.3);
  color: #856404;
}

.alert-info {
  background-color: rgba(98, 108, 113, 0.1);
  border-color: rgba(98, 108, 113, 0.3);
  color: #0c5460;
}

/* Results Section */
.results-section h2 {
  margin-bottom: 24px;
  color: #1a1a1a;
  font-size: 24px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.result-card {
  text-align: center;
  transition: all 150ms ease;
  border: 1px solid #e0e0e0;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.result-card h3 {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 8px;
  font-weight: 500;
}

.result-value {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
}

.result-value.positive {
  color: #28a745;
}

.result-value.negative {
  color: #dc3545;
}

.result-value.total {
  color: #0066cc;
  font-size: 24px;
}

.rentabilidad-info {
  display: block;
  font-size: 11px;
  color: #6c757d;
  margin-top: 4px;
}

/* Special Cards */
.retention-card {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

.retention-note {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #dc3545;
  font-weight: 500;
}

.total-card {
  border-color: #0066cc;
  background-color: rgba(0, 102, 204, 0.05);
}

/* Chart Section */
.chart-section {
  margin-bottom: 32px;
}

.chart-section h3 {
  margin-bottom: 16px;
  color: #1a1a1a;
}

.chart-container {
  background-color: white;
  border-radius: 8px;
  padding: 16px;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.amortization-table,
.comparison-table,
.scenarios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background-color: white;
}

.amortization-table th,
.amortization-table td,
.comparison-table th,
.comparison-table td,
.scenarios-table th,
.scenarios-table td {
  padding: 12px 8px;
  text-align: right;
  border-bottom: 1px solid #e0e0e0;
}

.amortization-table th:first-child,
.amortization-table td:first-child,
.comparison-table th:first-child,
.comparison-table td:first-child,
.scenarios-table th:first-child,
.scenarios-table td:first-child {
  text-align: left;
}

.amortization-table th,
.comparison-table th,
.scenarios-table th {
  background-color: #e7f3ff;
  font-weight: 600;
  color: #1a1a1a;
  position: sticky;
  top: 0;
}

.amortization-table tr:hover,
.comparison-table tr:hover,
.scenarios-table tr:hover {
  background-color: #f8f9fa;
}

/* Sections */
.amortization-section,
.scenarios-section,
.comparison-section,
.savings-goal-section,
.liquidity-section,
.export-section {
  margin-bottom: 32px;
}

.amortization-section h3,
.scenarios-section h3,
.comparison-section h3,
.savings-goal-section h3,
.liquidity-section h3,
.export-section h3 {
  margin-bottom: 16px;
  color: #1a1a1a;
  font-size: 20px;
}

/* Savings Goal Form */
.savings-form {
  display: flex;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.savings-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.savings-result {
  padding: 16px;
  background-color: #d4edda;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.savings-result h4 {
  margin: 0 0 12px 0;
  color: #1a1a1a;
}

.savings-details p {
  margin-bottom: 8px;
  color: #1a1a1a;
}

.savings-details ul {
  margin: 0;
  padding-left: 20px;
}

.savings-details li {
  margin-bottom: 4px;
  color: #6c757d;
}

/* Liquidity Section */
.liquidity-info {
  margin-top: 16px;
}

/* Export Buttons */
.export-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.export-buttons .btn {
  flex: 1;
  min-width: 150px;
}

/* Footer */
.footer {
  background-color: white;
  border-top: 1px solid #e0e0e0;
  padding: 32px 0;
  margin-top: 32px;
}

.disclaimer h4 {
  color: #1a1a1a;
  margin-bottom: 16px;
}

.disclaimer p {
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: justify;
}

.market-data h5,
.legal-notice h5 {
  color: #1a1a1a;
  margin: 24px 0 12px 0;
  font-size: 16px;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.data-item {
  padding: 8px;
  background-color: #e7f3ff;
  border-radius: 6px;
  color: #6c757d;
  font-size: 12px;
}

.legal-notice p {
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 20px;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .indicators-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .indicator-card {
    padding: 12px;
  }

  .indicator-value {
    font-size: 16px;
  }

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

  .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .result-value {
    font-size: 18px;
  }

  .result-value.total {
    font-size: 20px;
  }

  .savings-form {
    flex-direction: column;
    align-items: stretch;
  }

  .export-buttons {
    flex-direction: column;
  }

  .export-buttons .btn {
    flex: none;
  }

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

  .amortization-table,
  .comparison-table,
  .scenarios-table {
    font-size: 11px;
  }

  .amortization-table th,
  .amortization-table td,
  .comparison-table th,
  .comparison-table td,
  .scenarios-table th,
  .scenarios-table td {
    padding: 8px 4px;
  }

  .chart-container {
    height: 300px !important;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 16px 0;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

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

  .result-card {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .calculator-form h2,
  .results-section h2 {
    font-size: 20px;
  }

  .amortization-section h3,
  .scenarios-section h3,
  .comparison-section h3,
  .savings-goal-section h3,
  .liquidity-section h3,
  .export-section h3 {
    font-size: 18px;
  }
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
  .theme-icon::before {
    content: '☀️';
  }
  
  .indicator-card {
    background-color: white;
  }
}

[data-color-scheme="dark"] .theme-icon::before {
  content: '☀️';
}

[data-color-scheme="light"] .theme-icon::before {
  content: '🌙';
}

/* Animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Enhanced focus states for accessibility */
.form-control:focus,
.btn:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Print styles */
@media print {
  .header,
  .theme-toggle,
  .export-section {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #e0e0e0;
    break-inside: avoid;
  }

  .main {
    padding: 0;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .results-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .chart-container {
    height: 300px !important;
  }
}