/* Tarifa Pro - Modern Fintech UI System */
:root {
  --bg-main: #030712;
  --bg-card: rgba(15, 23, 42, 0.7);
  --bg-card-hover: rgba(22, 36, 66, 0.85);
  --bg-input: #080e1e;
  --border: rgba(16, 185, 129, 0.18);
  --border-hover: rgba(0, 210, 255, 0.45);
  --primary: #10b981;
  --primary-light: #34d399;
  --cyan: #00d2ff;
  --indigo: #6366f1;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 15% 15%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(0, 210, 255, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Header */
header.site-header {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
}
.brand-logo {
  width: 36px;
  height: 36px;
}
.brand-gradient {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
  max-width: 850px;
}
.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
}
.main-nav a:hover, .main-nav a.active {
  color: var(--primary);
}

/* Hero */
.hero {
  padding: 56px 0 36px;
  text-align: center;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero h1 span {
  background: linear-gradient(135deg, #fff 40%, var(--primary) 80%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 720px;
  margin: 0 auto 30px;
}

/* Search Box */
.search-container {
  max-width: 680px;
  margin: 0 auto 40px;
  position: relative;
}
.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 16px 24px 16px 54px;
  color: #fff;
  font-size: 1.05rem;
  font-family: inherit;
  transition: var(--transition);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
}
.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--text-muted);
}
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0b1120;
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  margin-top: 8px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  display: none;
}
.search-result-item {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}
.search-result-item:hover {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
}

/* Category Grid */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-bottom: 50px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.12);
}
.card-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
}
.card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card h3::after {
  content: "→";
  color: var(--primary);
  transition: transform 0.2s;
}
.card:hover h3::after {
  transform: translateX(4px);
}
.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Interactive Calculator Tool Section */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 60px;
  backdrop-filter: blur(14px);
}
.calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  margin-top: 24px;
}
@media (max-width: 850px) {
  .calc-grid { grid-template-columns: 1fr; }
}

.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.form-input, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.result-card {
  background: #020617;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.result-stat {
  margin-bottom: 20px;
}
.result-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
}
.result-val-big {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.result-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}
.breakdown-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

/* Invoice / Proposal Builder */
.invoice-paper {
  background: #fff;
  color: #0f172a;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
  font-family: inherit;
  margin-bottom: 30px;
}
.invoice-paper input, .invoice-paper textarea {
  border: 1px dashed #cbd5e1;
  padding: 6px 10px;
  font-family: inherit;
  border-radius: 4px;
  width: 100%;
}
.invoice-paper input:focus, .invoice-paper textarea:focus {
  border-color: #0f172a;
  outline: none;
  background: #f8fafc;
}
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
.invoice-table th {
  background: #f1f5f9;
  text-align: left;
  padding: 10px;
  font-size: 0.85rem;
  color: #475569;
}
.invoice-table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #030712;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.45);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}

/* Editorial / EEAT Box */
.editorial-box {
  background: linear-gradient(145deg, #0b1120, #030712);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 60px;
}
.editorial-box h2 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.editorial-box p {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 16px;
}
.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.badge-item {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Footer */
footer.site-footer {
  background: #02040c;
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}
.footer-col h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .header-inner { height: auto; padding-top: 14px; padding-bottom: 14px; flex-direction: column; gap: 12px; }
  .main-nav { display: flex; justify-content: center; gap: 8px 12px; }
  .main-nav a { font-size: 0.85rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

.table-scroll { position: relative; width: 100%; overflow-x: auto; }
.table-scroll table { min-width: 560px; }
.guide-content h2 { margin: 28px 0 12px; line-height: 1.35; }
.guide-content h3 { margin: 22px 0 10px; }
.guide-content p, .guide-content ul, .guide-content ol { margin-bottom: 16px; }
.guide-content ul, .guide-content ol, .panel-card ul { padding-left: 24px; }
.guide-content table { margin: 20px 0; }
.guide-content .invoice-table { width: 100%; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.invoice-heading { gap: 20px; }
.invoice-summary { gap: 24px; }
.invoice-summary > div:first-child { flex: 1; }
.invoice-paper textarea { width: 100%; resize: vertical; }
.invoice-paper select { padding: 6px; border: 1px solid #cbd5e1; background: white; color: #0f172a; }

@media (max-width: 600px) {
  .invoice-paper { padding: 24px; }
  .invoice-heading, .invoice-summary { flex-direction: column; }
  .invoice-parties { grid-template-columns: 1fr !important; }
  .invoice-heading > div, .invoice-parties > div, .invoice-summary > div { text-align: left !important; }
  .invoice-heading input, .invoice-parties input { width: 100% !important; text-align: left !important; }
}

a { color: var(--primary-light); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

@media print {
  body * { visibility: hidden; }
  #invoice-area, #invoice-area * { visibility: visible; }
  #invoice-area { position: absolute; left: 0; top: 0; width: 100%; }
  body:has(#invoice-area) { background: #fff; display: block; }
  body:has(#invoice-area) > header, body:has(#invoice-area) > footer { display: none; }
  body:has(#invoice-area) main { margin: 0 !important; padding: 0 !important; }
  #invoice-area button { display: none; }
  #invoice-area .table-scroll { overflow: visible; }
  #invoice-area .table-scroll table { min-width: 0; }
  #invoice-area input, #invoice-area select, #invoice-area textarea { border: none; color: #0f172a; }
  #invoice-area tr { break-inside: avoid; }
}
