/* ==========================================================================
   Calculadora de Plafones — Design System
   ========================================================================== */

:root {
  --pfc-primary: #1e3a8a;
  --pfc-primary-hover: #1e40af;
  --pfc-accent: #f97316;
  --pfc-text: #334155;
  --pfc-text-light: #64748b;
  --pfc-bg: #f8fafc;
  --pfc-white: #fff;
  --pfc-border: #e2e8f0;
  --pfc-radius: 8px;
  --pfc-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --pfc-font: Arial, Helvetica, sans-serif;
}

/* ==========================================================================
   1. Container & Reset
   ========================================================================== */
.pfc-c {
  font-family: var(--pfc-font);
  color: var(--pfc-text);
  background: var(--pfc-bg);
  padding: 24px;
  border-radius: var(--pfc-radius);
  max-width: 100%;
  margin: 0 auto;
  box-shadow: var(--pfc-shadow);
}
.pfc-c * { box-sizing: border-box; }

/* ==========================================================================
   2. Business Header (hidden on screen, visible in print)
   ========================================================================== */
.pfc-bh {
  background: var(--pfc-white);
  padding: 20px;
  border-bottom: 2px solid var(--pfc-primary);
  margin-bottom: 30px;
  display: none;
}
.pfc-bc {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.pfc-bl { width: 250px; }
.pfc-bl img { max-width: 220px; display: block; }
.pfc-bi { font-size: .85rem; line-height: 1.4; color: var(--pfc-text); }
.pfc-qm { text-align: right; }
.pfc-qt { font-size: 1.4rem; font-weight: 700; color: var(--pfc-primary); margin-bottom: 5px; }
.pfc-d, .pfc-cr { font-size: .9rem; color: var(--pfc-text-light); }

/* ==========================================================================
   3. Header (logo + title)
   ========================================================================== */
.pfc-h {
  text-align: center;
  margin-bottom: 24px;
}
.pfc-h img {
  max-width: 250px;
  display: block;
  margin: 0 auto 15px;
}
.pfc-h h2 {
  margin: 0 0 8px;
  color: var(--pfc-primary);
  font-size: 1.5rem;
  font-weight: 700;
}
.pfc-h p {
  margin: 0;
  color: var(--pfc-text-light);
  font-size: .95rem;
}

/* ==========================================================================
   4. Tabs
   ========================================================================== */
.pfc-ts {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--pfc-border);
}
.pfc-tb {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pfc-text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.pfc-tb:hover { color: var(--pfc-primary); }
.pfc-tb.act { color: var(--pfc-primary); border-bottom-color: var(--pfc-accent); }

/* ==========================================================================
   5. Input Section
   ========================================================================== */
.pfc-is {
  background: var(--pfc-white);
  padding: 20px;
  border-radius: var(--pfc-radius);
  border: 1px solid var(--pfc-border);
  margin-bottom: 24px;
}
.pfc-ig { display: none; }
.pfc-ig.act { display: block; }
.pfc-ig label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: .95rem;
}
.pfc-ig input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--pfc-border);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color .2s;
}
.pfc-ig input[type="number"]:focus {
  outline: none;
  border-color: var(--pfc-primary);
  box-shadow: 0 0 0 3px rgba(30,58,138,.1);
}

/* ==========================================================================
   6. Dimension Row
   ========================================================================== */
.pfc-dr { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pfc-dr2 {
  margin-top: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pfc-primary);
  background: rgba(30,58,138,.05);
  padding: 12px;
  border-radius: 6px;
  text-align: center;
}

/* ==========================================================================
   7. Options Row
   ========================================================================== */
.pfc-or {
  display: flex;
  align-items: center;
  margin-top: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.pfc-ws select {
  padding: 6px 10px;
  border: 1px solid var(--pfc-border);
  border-radius: 4px;
  font-size: .9rem;
  background: #fff;
  cursor: pointer;
}
.pfc-ws label { font-size: .85rem; color: var(--pfc-text-light); margin-right: 8px; }
.pfc-lb label { font-size: .85rem; color: var(--pfc-text-light); margin-right: 8px; }
.pfc-lb input {
  padding: 6px 10px;
  border: 1px solid var(--pfc-border);
  border-radius: 4px;
  font-size: .9rem;
  width: 90px;
  background: #fff;
}
.pfc-iv select {
  padding: 6px 10px;
  border: 1px solid var(--pfc-border);
  border-radius: 4px;
  font-size: .9rem;
  background: #fff;
  cursor: pointer;
}
.pfc-iv label { font-size: .85rem; color: var(--pfc-text-light); margin-right: 8px; }

/* ==========================================================================
   8. Visualization (SVG)
   ========================================================================== */
.pfc-vw { margin-top: 16px; }
.pfc-v {
  background: var(--pfc-white);
  border: 1px solid var(--pfc-border);
  border-radius: 8px;
  padding: 20px;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, #fcfcfc, #f1f5f9);
}
.pfc-v svg {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,.1));
}
.pfc-vp {
  text-align: center;
  padding: 20px;
  color: var(--pfc-text-light);
  font-style: italic;
}

/* ==========================================================================
   9. Results Section
   ========================================================================== */
.pfc-rs {
  background: var(--pfc-white);
  padding: 24px;
  border-radius: var(--pfc-radius);
  border: 1px solid var(--pfc-border);
  margin-bottom: 24px;
}
.pfc-rh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.pfc-rh h3 { margin: 0; font-size: 1.2rem; color: var(--pfc-primary); }
.pfc-ab {
  background: var(--pfc-accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 600;
}

/* ==========================================================================
   10. Table
   ========================================================================== */
.pfc-t {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.pfc-t th {
  background: var(--pfc-bg);
  padding: 10px 6px;
  text-align: left;
  font-weight: 600;
  color: var(--pfc-text);
  border-bottom: 2px solid var(--pfc-border);
  font-size: .85rem;
}
.pfc-t td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--pfc-border);
}
.pfc-t th:nth-child(1), .pfc-t td:nth-child(1) { width: 45%; }
.pfc-t th:nth-child(2), .pfc-t td:nth-child(2),
.pfc-t th:nth-child(3), .pfc-t td:nth-child(3) { width: 8%; text-align: center; }
.pfc-t th:nth-child(4), .pfc-t td:nth-child(4),
.pfc-t th:nth-child(5), .pfc-t td:nth-child(5) { width: 19.5%; text-align: right; }

/* ==========================================================================
   11. Footer Rows
   ========================================================================== */
.pfc-tr { text-align: right !important; font-size: .85rem; }
.pfc-bold { font-weight: 600; }
.pfc-sr td { background: var(--pfc-bg); font-weight: 600; padding: 10px 6px; }
.pfc-gt td {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pfc-primary);
  border-top: 2px solid var(--pfc-border);
  background: rgba(30,58,138,.05);
  padding: 10px 6px;
}
.pfc-fi {
  margin-top: 16px;
  font-size: .85rem;
  color: var(--pfc-text-light);
  font-style: italic;
  border-top: 1px solid var(--pfc-border);
  padding-top: 12px;
}
.pfc-tb2 {
  margin-top: 15px;
  background: #fff;
  border: 1px solid var(--pfc-accent);
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  font-size: .9rem;
}
.pfc-tb2 a { color: var(--pfc-accent); text-decoration: none; font-weight: 600; }
.pfc-tb2 a:hover { text-decoration: underline; }

/* ==========================================================================
   12. PDF Button
   ========================================================================== */
.pfc-ac { text-align: right; margin-top: 16px; }
.pfc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pfc-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.pfc-btn:hover { background: var(--pfc-primary-hover); }
.pfc-btn:active { transform: scale(.98); }

/* ==========================================================================
   13. Responsive
   ========================================================================== */
@media (max-width: 600px) {
  .pfc-dr { grid-template-columns: 1fr; }
  .pfc-rh { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pfc-or { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   14. Print Styles
   ========================================================================== */
@media print {
  @page { size: letter; margin: 1.2cm; }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body {
    font-family: Arial, Helvetica, sans-serif;
    color: #334155;
    margin: 0;
    padding: 0;
    background: #fff;
    font-size: 12px;
  }

  /* Show business header */
  .pfc-bh {
    display: block !important;
    padding: 10px 0 14px;
    border-bottom: 2px solid #1e3a8a;
    margin-bottom: 16px;
  }
  .pfc-bl img { max-width: 180px; }
  .pfc-bi { font-size: 10px; line-height: 1.35; }
  .pfc-qt { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
  .pfc-d, .pfc-cr { font-size: 11px; }

  /* Hide interactive elements */
  .pfc-h, .pfc-is, .pfc-ac, .pfc-vw, .pfc-btn {
    display: none !important;
  }

  /* Results */
  .pfc-rs { border: none; padding: 0; background: none; }
  .pfc-rh { margin-bottom: 10px; }
  .pfc-rh h3 { font-size: 15px; }
  .pfc-ab { font-size: 11px; padding: 3px 10px; }

  /* Table */
  .pfc-t { font-size: 9px; table-layout: fixed; width: 100%; }
  .pfc-t th { font-size: 9px; padding: 4px; }
  .pfc-t td { padding: 3px 4px; vertical-align: middle; }
  .pfc-tr { font-size: 9px; }
  .pfc-gt td { font-size: 13px; }
  .pfc-fi {
    margin-top: 14px;
    font-size: 10px;
    padding-top: 8px;
  }
}
