/* ============================================
   COTIZACIÓN PÚBLICA — Hexmet
   Static viewer for Cloudflare Pages
   ============================================ */
:root {
  --bg-dark: #1A103C;
  --bg-mid: #241654;
  --bg-card: rgba(22, 12, 54, 0.7);
  --gold: #D4A843;
  --gold-light: #F0D78C;
  --gold-dark: #B8922F;
  --white: #FFFFFF;
  --text-body: #F0EDF7;
  --text-muted: #C0BDCF;
  --border-subtle: rgba(212, 168, 67, 0.1);
  --border-gold: rgba(212, 168, 67, 0.25);
  --font: 'Montserrat', sans-serif;
  --radius: 16px;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font); font-weight: 500;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(212,168,67,0.06), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(212,168,67,0.06), transparent 30%),
    url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg' stroke='%23D4A843' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none' opacity='0.05'%3E%3Cg transform='translate(30,30)'%3E%3Cpath d='M5 15l-5-5 5-5M25 15l5-5-5-5M12 18l6-16'/%3E%3C/g%3E%3Cg transform='translate(130,40)'%3E%3Ccircle cx='15' cy='15' r='10'/%3E%3Cpath d='M5 15h20M15 5c-3 0-5 4-5 10s2 10 5 10 5-4 5-10-2-10-5-10z'/%3E%3C/g%3E%3Cg transform='translate(40,120)'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/g%3E%3Cg transform='translate(140,130)'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.59 13.51l6.83 3.98M15.41 6.51L8.59 10.49'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--white); line-height: 1.7; min-height: 100vh;
}
::selection { background: var(--gold); color: var(--bg-dark); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.gold { color: var(--gold); }
.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ─── Header ─── */
.cot-header { text-align: center; padding-top: 48px; margin-bottom: 40px; }
.cot-header img { height: 36px; margin: 0 auto 24px; }
.cot-header h1 { font-size: 1.8rem; font-weight: 900; }
.cot-id {
  display: inline-block; margin-top: 12px;
  font-size: 0.75rem; font-weight: 600; color: var(--gold);
  letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 100px;
  border: 1px solid var(--border-gold);
  background: rgba(212,168,67,0.06);
}

/* ─── Estado ─── */
.cot-estado { text-align: center; margin-bottom: 32px; }
.cot-badge {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; padding: 6px 18px; border-radius: 100px;
}
.cot-badge.pendiente { background: rgba(212,168,67,0.1); color: var(--gold); border: 1px solid rgba(212,168,67,0.2); }
.cot-badge.aprobada { background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.cot-badge.rechazada { background: rgba(255,77,77,0.1); color: #ff4d4d; border: 1px solid rgba(255,77,77,0.2); }

/* ─── Meta Cards ─── */
.cot-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
.cot-meta-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 24px; backdrop-filter: blur(12px);
}
.cot-meta-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 12px;
}
.cot-meta-value { font-size: 0.95rem; line-height: 1.8; color: var(--text-body); font-weight: 500; }
.cot-meta-value strong { color: var(--white); font-weight: 600; }

/* ─── Services Table ─── */
.cot-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 24px;
}
.cot-table { width: 100%; border-collapse: collapse; }
.cot-table thead th {
  text-align: left; font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px;
  padding: 14px 20px; border-bottom: 1px solid var(--border-subtle);
  background: rgba(212,168,67,0.03);
}
.cot-table thead th:last-child { text-align: right; }
.cot-table tbody td {
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-body); vertical-align: top; font-weight: 500;
}
.cot-table tbody tr:last-child td { border-bottom: none; }
.cot-table tbody td:last-child { text-align: right; font-weight: 600; color: var(--white); white-space: nowrap; }
.srv-name { font-weight: 700; color: var(--white); margin-bottom: 4px; }
.srv-desc { font-size: 0.85rem; color: var(--text-body); font-weight: 400; }

/* ─── Totals ─── */
.cot-total-section {
  background: linear-gradient(135deg, rgba(212,168,67,0.1), rgba(212,168,67,0.04));
  border: 1px solid var(--border-gold); border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 24px;
}
.cot-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 0.95rem; color: var(--text-body);
}
.cot-total-row.grand {
  font-size: 1.6rem; font-weight: 900; color: var(--white);
  padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border-gold);
}
.cot-total-row.grand span:last-child {
  color: var(--gold); text-shadow: 0 0 30px rgba(212,168,67,0.3);
}

/* ─── Notes ─── */
.cot-notes {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
}
.cot-notes h3 {
  font-size: 0.82rem; font-weight: 600; color: var(--gold);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px;
}
.cot-notes p { color: var(--text-body); font-size: 0.9rem; }

.cot-validity {
  text-align: center; padding: 16px; color: var(--text-muted); font-size: 0.82rem;
}
.cot-validity strong { color: var(--gold); }

/* ─── Footer ─── */
.cot-footer {
  text-align: center; padding: 32px 0;
  border-top: 1px solid var(--border-subtle); margin-top: 32px;
}
.cot-footer p { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 20px; }
.footer-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 100px;
  font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  border: none; cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
  white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-dark); box-shadow: 0 4px 24px rgba(212,168,67,0.25);
}
.btn-gold:hover {
  transform: translateY(-2px); box-shadow: 0 8px 32px rgba(212,168,67,0.4);
}
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover {
  background: rgba(212,168,67,0.1);
  box-shadow: 0 0 20px rgba(212,168,67,0.15);
}
.btn svg { width: 18px; height: 18px; }

/* ─── Error State ─── */
.error-state {
  text-align: center; padding: 120px 24px; min-height: 80vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.error-state svg { width: 56px; height: 56px; color: var(--text-muted); opacity: 0.3; margin-bottom: 20px; }
.error-state h2 { font-size: 1.3rem; margin-bottom: 8px; }
.error-state p { color: var(--text-muted); font-size: 0.9rem; }

/* ─── Animation ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.5s ease forwards; }

/* ─── Print ─── */
@media print {
  body { background: #fff; color: #111; }
  .cot-footer .btn { display: none !important; }
  .cot-meta-card, .cot-table-wrap, .cot-total-section, .cot-notes {
    background: #fff; border-color: #ddd; backdrop-filter: none;
  }
  .cot-table thead th { background: #f5f5f5; color: #333; }
  .gold, .cot-total-row.grand span:last-child { color: #B8922F; }
  .cot-meta-value, .cot-table tbody td, .cot-notes p { color: #333; }
  .srv-name { color: #111; }
  .cot-header img { 
    background: #4B3987 !important; /* Lighter Hexmet purple */
    padding: 12px 24px; 
    border-radius: 10px; 
    box-sizing: content-box; 
    -webkit-print-color-adjust: exact !important; 
    print-color-adjust: exact !important; 
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .cot-meta { grid-template-columns: 1fr; }
  .cot-header h1 { font-size: 1.4rem; }
  .cot-total-row.grand { font-size: 1.3rem; }
  .container { padding: 0 16px; }
}
