/* Self-Employed Retirement Calculator (UK) - scoped CSS (.ser-) */

.ser-wrap{max-width:1600px;margin:0 auto;padding:20px;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#0f172a;background:#f8fafc;border-radius:20px;box-shadow:0 4px 20px rgba(15,23,42,0.08);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}

.ser-card{background:#ffffff;border:2px solid #e2e8f0;border-radius:18px;padding:24px 28px;margin:0 0 20px 0;box-shadow:0 2px 8px rgba(15,23,42,0.04)}
.ser-header{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;margin-bottom:12px}
.ser-title{font-size:2rem;font-weight:900;margin:0;color:#0f172a;line-height:1.2}
.ser-sub{margin:8px 0 0 0;color:#64748b;font-size:1rem;line-height:1.5}
.ser-pill{display:inline-flex;align-items:center;gap:8px;border:2px solid #cbd5e1;border-radius:999px;padding:8px 14px;background:#f1f5f9;font-size:.9rem;color:#475569;font-weight:700}

.ser-inst{background:#fef3c7;border:2px solid #fcd34d;border-radius:14px;padding:14px 16px;color:#92400e;font-size:.95rem;margin-top:14px;line-height:1.5}

.ser-grid{display:flex;flex-direction:column;gap:16px}
.ser-grid-2{display:flex;flex-direction:column;gap:16px}
@media(max-width:720px){.ser-grid-2{display:flex;flex-direction:column;gap:16px}}

.ser-field{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:16px;margin-bottom:0}
.ser-field label{display:block;font-weight:800;font-size:1rem;margin:0 0 8px 0;color:#1e293b}
.ser-field .ser-hint{color:#64748b;font-size:.875rem;margin-top:6px;line-height:1.4}
.ser-input, .ser-select{width:100%;border:2px solid #cbd5e1;border-radius:10px;padding:12px 14px;background:#ffffff;color:#0f172a;font-size:1rem;font-weight:500;-webkit-transition:all 0.2s;transition:all 0.2s;-webkit-appearance:none;-moz-appearance:none;appearance:none}
.ser-input:focus, .ser-select:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 4px rgba(59,130,246,0.1);background:#ffffff}

.ser-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-top:16px}
.ser-btn{border:2px solid #cbd5e1;border-radius:12px;padding:12px 20px;background:#ffffff;color:#475569;font-weight:800;cursor:pointer;font-size:.95rem;transition:all 0.2s}
.ser-btn:hover{background:#f1f5f9;border-color:#94a3b8;-webkit-transform:translateY(-1px);transform:translateY(-1px);box-shadow:0 2px 8px rgba(15,23,42,0.1)}
.ser-btn--primary{background:#3b82f6;border-color:#3b82f6;color:#ffffff}
.ser-btn--primary:hover{background:#2563eb;border-color:#2563eb;box-shadow:0 4px 12px rgba(59,130,246,0.3)}
.ser-btn--danger{background:#ffffff;border-color:#f87171;color:#dc2626}
.ser-btn--danger:hover{background:#fef2f2;border-color:#ef4444}

.ser-stephead{display:flex;gap:14px;align-items:flex-start;flex-wrap:wrap;margin-bottom:20px;padding-bottom:16px;border-bottom:2px solid #e2e8f0}
.ser-stepnum{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:#fff;font-weight:900;font-size:1.1rem;flex:0 0 auto;box-shadow:0 2px 8px rgba(102,126,234,0.3)}
.ser-steptitle{font-size:1.5rem;font-weight:900;margin:0 0 8px 0;color:#0f172a;line-height:1.3}
.ser-stepdesc{color:#64748b;font-size:.95rem;line-height:1.5;margin-top:4px}

.ser-rowlist{display:flex;flex-direction:column;gap:14px;margin-top:14px}
.ser-row{border:2px dashed #cbd5e1;background:#f8fafc;border-radius:14px;padding:18px;margin-top:12px}
.ser-rowtop{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:12px}
.ser-rowtitle{font-weight:900;font-size:1.1rem;color:#1e293b}

.ser-kpis{display:grid;gap:16px;grid-template-columns:repeat(4,minmax(0,1fr));margin-top:20px}
@media(max-width:1200px){.ser-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.ser-kpis{grid-template-columns:1fr}}
.ser-kpi{background:linear-gradient(135deg,#f0f9ff 0%,#e0f2fe 100%);border:2px solid #bae6fd;border-radius:16px;padding:18px;box-shadow:0 2px 8px rgba(14,165,233,0.1)}
.ser-kpi .ser-k{color:#0369a1;font-size:.875rem;font-weight:800;text-transform:uppercase;letter-spacing:0.5px}
.ser-kpi .ser-v{font-size:1.4rem;font-weight:900;margin-top:8px;color:#0c4a6e}
.ser-badge{display:inline-flex;align-items:center;gap:10px;border-radius:999px;padding:10px 16px;font-weight:900;font-size:.95rem;border:2px solid}
.ser-badge--ok{background:#d1fae5;border-color:#10b981;color:#065f46}
.ser-badge--bad{background:#fee2e2;border-color:#ef4444;color:#991b1b}

.ser-tablewrap{overflow:auto;border:2px solid #e2e8f0;border-radius:16px;background:#ffffff;margin-top:20px;box-shadow:0 2px 8px rgba(15,23,42,0.04)}
.ser-table{border-collapse:collapse;width:100%;min-width:1200px}
.ser-table th{position:sticky;top:0;background:linear-gradient(135deg,#f0f9ff 0%,#e0f2fe 100%);color:#0c4a6e;text-align:left;padding:14px 12px;border-bottom:2px solid #bae6fd;font-size:.875rem;font-weight:800;z-index:10}
.ser-table td{padding:12px;border-bottom:1px solid #f1f5f9;font-size:.9rem;white-space:nowrap;color:#334155}
.ser-table tr:hover td{background:#f8fafc}
.ser-table tr:last-child td{border-bottom:none}
.ser-table tr.ser-highlight-row td{background:#dbeafe;font-weight:700}
.ser-table tr.ser-highlight-row:hover td{background:#bfdbfe}

.ser-chart{width:100%;overflow:hidden;background:#ffffff;border:2px solid #e2e8f0;border-radius:16px;padding:20px;margin-top:20px;box-shadow:0 2px 8px rgba(15,23,42,0.04);min-height:400px}
.ser-chart svg{width:100%;height:auto;max-width:100%;display:block;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif}
.ser-chart .axis{stroke:#94a3b8;stroke-width:1.5}
.ser-chart .label{fill:#475569;font-size:13px;font-weight:600;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif}
.ser-charts-container{display:grid;grid-template-columns:repeat(2,1fr);gap:20px;margin-top:20px}
@media(max-width:1200px){.ser-charts-container{grid-template-columns:1fr}}
@media(max-width:1024px){
  .ser-wrap{padding:16px}
  .ser-card{padding:20px 24px}
  .ser-title{font-size:1.75rem}
  .ser-steptitle{font-size:1.3rem}
}
@media(max-width:768px){
  .ser-wrap{padding:12px}
  .ser-card{padding:16px 20px;margin-bottom:16px}
  .ser-title{font-size:1.5rem}
  .ser-steptitle{font-size:1.2rem}
  .ser-stepnum{width:36px;height:36px;font-size:1rem}
  .ser-chart{padding:12px;min-height:300px}
  .ser-chart svg{font-size:11px}
  .ser-table{min-width:1000px}
  .ser-kpi .ser-v{font-size:1.2rem}
}
@media(max-width:480px){
  .ser-wrap{padding:10px}
  .ser-card{padding:14px 16px}
  .ser-title{font-size:1.3rem}
  .ser-steptitle{font-size:1.1rem}
  .ser-stepnum{width:32px;height:32px;font-size:.9rem}
  .ser-field{padding:12px}
  .ser-input, .ser-select{padding:10px 12px;font-size:.95rem}
  .ser-btn{padding:10px 16px;font-size:.9rem}
  .ser-chart{padding:10px;min-height:250px}
  .ser-table{min-width:900px;font-size:.85rem}
  .ser-kpi{padding:14px}
  .ser-kpi .ser-v{font-size:1.1rem}
}
@media print{
  /* Hide common WordPress page elements */
  header, footer, nav, aside, .site-header, .site-footer, .main-navigation, .sidebar, .widget-area, .wp-block-group__inner-container > *:not(.ser-wrap), #wpadminbar{display:none !important}
  
  /* Calculator container */
  .ser-wrap{max-width:100% !important;padding:10px !important;margin:0 !important;background:#fff !important;box-shadow:none !important;border-radius:0 !important}
  
  /* Hide interactive elements */
  .ser-no-print{display:none !important}
  .ser-btn{display:none !important}
  .ser-input, .ser-select{display:none !important}
  
  /* Hide input fields and input sections - they're not needed in print */
  .ser-field{display:none !important}
  
  /* Hide input step cards (Step 1-5) and header - only show results */
  .ser-no-print-inputs{display:none !important}
  
  /* Optimize cards for print */
  .ser-card{background:#fff !important;border:1px solid #ccc !important;border-radius:0 !important;box-shadow:none !important;padding:12px !important;margin-bottom:12px !important;page-break-inside:avoid;break-inside:avoid}
  
  /* Optimize charts */
  .ser-chart{page-break-inside:avoid;break-inside:avoid;border:1px solid #ccc !important;background:#fff !important;box-shadow:none !important;min-height:auto !important}
  .ser-charts-container{grid-template-columns:1fr}
  
  /* Optimize table */
  .ser-table{min-width:0 !important;width:100% !important;font-size:0.8rem !important}
  .ser-table th{background:#f5f5f5 !important;color:#000 !important;border:1px solid #ccc !important;padding:8px 6px !important}
  .ser-table td{border:1px solid #ddd !important;padding:6px !important}
  .ser-tablewrap{overflow:visible !important;border:1px solid #ccc !important}
  
  /* Remove colors and use black/white for print */
  .ser-badge--ok, .ser-badge--bad{background:#fff !important;border:1px solid #000 !important;color:#000 !important}
  .ser-kpi{background:#fff !important;border:1px solid #ccc !important;box-shadow:none !important}
  .ser-kpi .ser-k, .ser-kpi .ser-v{color:#000 !important}
  
  /* Step headers */
  .ser-stephead{border-bottom:2px solid #000 !important}
  .ser-stepnum{background:#000 !important;color:#fff !important;box-shadow:none !important}
  .ser-steptitle{color:#000 !important}
  
  /* Headers */
  .ser-title{color:#000 !important;font-size:1.3rem !important}
  .ser-sub{color:#666 !important}
  
  /* Remove gradients - use solid colors for print */
  .ser-kpi, .ser-table th, .ser-stepnum{background-image:none !important;background:#f5f5f5 !important}
  .ser-stepnum{background:#000 !important}
  
  /* Ensure text is black */
  .ser-rowtitle, .ser-k, .ser-v, .ser-badge{color:#000 !important}
}

/* Responsive grid utilities for inline styles */
@media(max-width:1024px){
  [style*="grid-template-columns:repeat(3,1fr)"]{grid-template-columns:repeat(2,1fr) !important}
  [style*="grid-template-columns:repeat(auto-fit,minmax(250px,1fr))"]{grid-template-columns:repeat(auto-fit,minmax(200px,1fr)) !important}
}
@media(max-width:768px){
  [style*="grid-template-columns:repeat(3,1fr)"]{grid-template-columns:1fr !important}
  [style*="grid-template-columns:repeat(auto-fit,minmax(200px,1fr))"]{grid-template-columns:1fr !important}
  [style*="grid-template-columns:repeat(auto-fit,minmax(250px,1fr))"]{grid-template-columns:1fr !important}
  [style*="grid-template-columns:repeat(auto-fit,minmax(180px,1fr))"]{grid-template-columns:1fr !important}
}

@media print{
  .ser-no-print{display:none !important}
  .ser-wrap{max-width:none}
  .ser-card{break-inside:avoid;page-break-inside:avoid}
  .ser-table{min-width:0;width:100%}
}
