/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --accent: #06d6a0;
  --grad-start: #4f46e5;
  --grad-end: #06b6d4;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #2d1b69 0%, #4f46e5 45%, #0891b2 100%);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(79,70,229,0.35);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 2px;
}

.logo span {
  background: linear-gradient(90deg, #34d399, #06d6a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== DROPDOWN NAV ===== */
nav { display: flex; gap: 4px; align-items: center; }

.nav-dropdown { position: relative; }

.nav-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

.nav-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.nav-dropdown:hover .nav-arrow { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(79,70,229,0.18), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  min-width: 220px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 200;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.12s;
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.dropdown-menu .menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

@media (max-width: 768px) {
  nav { display: none; }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #2d1b69 0%, #4f46e5 40%, #0891b2 75%, #06d6a0 100%);
  color: white;
  padding: 72px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(6,214,160,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 40px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
  nav { display: none; }
}

/* ===== CARD ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

/* ===== CALCULATOR GRID (home) ===== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 48px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
  display: block;
  color: var(--text);
}

.calc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(37,99,235,0.12);
  text-decoration: none;
}

.calc-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.calc-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.calc-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  appearance: none;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.input-prefix {
  position: relative;
}
.input-prefix span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}
.input-prefix input { padding-left: 28px; }

.input-suffix { position: relative; }
.input-suffix span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}
.input-suffix input { padding-right: 36px; }

/* ===== BUTTON ===== */
.btn {
  display: inline-block;
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 8px;
  box-shadow: 0 2px 12px rgba(79,70,229,0.3);
}

.btn:hover {
  opacity: 0.92;
  box-shadow: 0 4px 20px rgba(79,70,229,0.4);
}
.btn:active { transform: scale(0.99); }

/* ===== RESULTS ===== */
.result-box {
  background: var(--primary-light);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-top: 24px;
  display: none;
}

.result-box.visible { display: block; }

.result-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.result-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-breakdown {
  margin-top: 20px;
  border-top: 1px solid #bfdbfe;
  padding-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.breakdown-item { }
.breakdown-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.breakdown-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-nav {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.sidebar-nav h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sidebar-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}


/* ===== FAQ ===== */
.faq-section {
  padding: 48px 24px;
  max-width: 800px;
  margin: 0 auto;
}

.faq-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-q {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-a {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== PAGE TITLE ===== */
.page-hero {
  background: linear-gradient(135deg, #2d1b69 0%, #4f46e5 50%, #0891b2 100%);
  color: white;
  padding: 40px 24px;
}

.page-hero .container h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.page-hero .container p {
  opacity: 0.85;
  font-size: 1rem;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb span { margin: 0 6px; }

/* ===== FOOTER ===== */
footer {
  background: var(--text);
  color: #94a3b8;
  padding: 40px 24px;
  margin-top: 64px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}

.footer-brand .logo { color: white; margin-bottom: 12px; display: block; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; }

.footer-col h4 {
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 10px;
  transition: color 0.15s;
}

.footer-col a:hover { color: white; text-decoration: none; }

.footer-bottom {
  max-width: 1100px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid #334155;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== AMORTIZATION TABLE ===== */
.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:nth-child(even) td { background: var(--bg); }

/* ===== UTILITIES ===== */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  display: inline-block;
}
