/* --- 1. VARIABLES & THEME --- */
#llecentralx_calculator_wrapper {
  --primary-color: #0B1F51;    /* Navy */
  --text-color: #2B3445;       /* Body Text */
  --hover-color: #AFC8FF;      /* Light Blue Hover */
  --bg-color: #F8FAFC;
  --white: #FFFFFF;
  --border-color: #E2E8F0;
  --danger-color: #EF4444;     /* Red */
  --danger-bg: #FEF2F2;
  --info-bg: #EFF6FF;
  --info-text: #1E40AF;
  --warning-text: #B45309;
  --success-color: #059669;

  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

#llecentralx_calculator_wrapper * { box-sizing: border-box; margin: 0; padding: 0; }

/* --- 2. LAYOUT --- */
#llecentralx_calculator_wrapper .llecentralx_calculator-container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

#llecentralx_calculator_wrapper .llecentralx_calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Equal distribution on desktop */
  min-height: 600px;
}

#llecentralx_calculator_wrapper .llecentralx_input-section,
#llecentralx_calculator_wrapper .llecentralx_results-section { padding: 35px; }

#llecentralx_calculator_wrapper .llecentralx_input-section {
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

#llecentralx_calculator_wrapper .llecentralx_results-section {
  background-color: #fafbfd;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* --- 3. UI COMPONENTS --- */
#llecentralx_calculator_wrapper .llecentralx_form-section-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #FAFAFC;
}
#llecentralx_calculator_wrapper .llecentralx_form-section-box h3 {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Mode Selection UI */
#llecentralx_calculator_wrapper .llecentralx_mode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
#llecentralx_calculator_wrapper .llecentralx_mode-btn {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 140px;
    cursor: pointer;
}
#llecentralx_calculator_wrapper .llecentralx_mode-btn input[type="radio"] {
    display: none;
}
#llecentralx_calculator_wrapper .llecentralx_mode-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 12px 10px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748B;
    transition: all 0.2s;
    line-height: 1.3;
}
#llecentralx_calculator_wrapper .llecentralx_mode-btn input[type="radio"]:checked + span {
    background: #EFF6FF;
    color: var(--primary-color);
    border-color: #BFDBFE;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#llecentralx_calculator_wrapper .llecentralx_mode-btn:hover span {
    border-color: #CBD5E1;
}

#llecentralx_calculator_wrapper .llecentralx_input-group { margin-bottom: 15px; position: relative; }

#llecentralx_calculator_wrapper .llecentralx_input-group label {
  display: block; 
  margin-bottom: 6px;
  font-weight: 700; 
  color: var(--primary-color);
  font-size: 13px;
}

#llecentralx_calculator_wrapper .llecentralx_input-helper {
    display: block;
    font-size: 11px;
    color: #64748B;
    margin-top: -4px;
    margin-bottom: 6px;
    font-style: italic;
}

#llecentralx_calculator_wrapper .llecentralx_input-wrapper { position: relative; width: 100%; }

#llecentralx_calculator_wrapper .llecentralx_input-field {
    width: 100%;
    padding: 14px; 
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px; 
    background-color: var(--white);
    font-family: 'Inter', sans-serif;
    color: var(--primary-color);
    font-weight: 600;
    transition: border-color 0.2s;
    appearance: none;
}

#llecentralx_calculator_wrapper select.llecentralx_input-field {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1F51' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
}

#llecentralx_calculator_wrapper .llecentralx_input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 31, 81, 0.1);
}

/* Radio Buttons */
#llecentralx_calculator_wrapper .llecentralx_radio-group {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}
#llecentralx_calculator_wrapper .llecentralx_radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
}
#llecentralx_calculator_wrapper .llecentralx_radio-label input[type="radio"]:not(.llecentralx_mode-btn input) {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Error States */
#llecentralx_calculator_wrapper .llecentralx_input-field.llecentralx_error {
    border-color: var(--danger-color);
    background-color: #FEF2F2;
    box-shadow: 0 0 0 1px var(--danger-color);
}

#llecentralx_calculator_wrapper .llecentralx_error-msg {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    display: none; 
    animation: llecentralx_fadeIn 0.3s;
}

@keyframes llecentralx_fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Action Buttons & Loader */
#llecentralx_calculator_wrapper .llecentralx_action-buttons { 
    margin-top: auto; 
    padding-top: 10px; 
    display: grid; 
    gap: 12px; 
}

#llecentralx_calculator_wrapper button.llecentralx_primary-btn {
  background-color: var(--primary-color); 
  color: white; 
  border: none; 
  padding: 18px; 
  border-radius: 8px;
  font-weight: 700; 
  font-size: 16px; 
  cursor: pointer; 
  transition: transform 0.1s, background-color 0.2s, opacity 0.2s;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#llecentralx_calculator_wrapper button.llecentralx_primary-btn:hover:not(:disabled) { background-color: #1a3a7a; }
#llecentralx_calculator_wrapper button.llecentralx_primary-btn:disabled { cursor: not-allowed; opacity: 0.8; }

#llecentralx_calculator_wrapper button.llecentralx_secondary-btn {
  background-color: white; 
  color: var(--text-color); 
  border: 1px solid var(--border-color); 
  padding: 14px; 
  border-radius: 8px;
  font-weight: 600; 
  cursor: pointer;
  width: 100%;
  transition: background-color 0.2s;
}
#llecentralx_calculator_wrapper button.llecentralx_secondary-btn:hover { background-color: #F1F5F9; }

#llecentralx_calculator_wrapper .llecentralx_loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: llecentralx_spin 1s ease-in-out infinite;
}
@keyframes llecentralx_spin { to { transform: rotate(360deg); } }

/* --- 4. RESULTS UI --- */
#llecentralx_calculator_wrapper .llecentralx_hero-card {
    background-color: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--primary-color);
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 25px;
    text-align: center;
    display: none; 
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
}

#llecentralx_calculator_wrapper .llecentralx_hero-card.llecentralx_visible { 
    display: block; 
    opacity: 1; 
    transform: translateY(0); 
}

#llecentralx_calculator_wrapper .llecentralx_hero-label { font-size: 13px; color: var(--primary-color); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
#llecentralx_calculator_wrapper .llecentralx_hero-value { font-size: 38px; font-weight: 800; color: var(--primary-color); margin-bottom: 5px; line-height: 1; word-wrap: break-word;}
#llecentralx_calculator_wrapper .llecentralx_hero-subtext { font-size: 14px; color: #64748B; font-weight: 500; }

#llecentralx_calculator_wrapper .llecentralx_breakdown-box {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    display: none; 
}

#llecentralx_calculator_wrapper .llecentralx_breakdown-header {
    background: #F1F5F9;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

#llecentralx_calculator_wrapper .llecentralx_result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
    color: #334155;
}
#llecentralx_calculator_wrapper .llecentralx_result-row.llecentralx_total-row {
    background-color: #F8FAFC;
    font-weight: 700;
    border-top: 2px solid var(--border-color);
}
#llecentralx_calculator_wrapper .llecentralx_result-row:last-child { border-bottom: none; }

#llecentralx_calculator_wrapper .llecentralx_result-val { font-weight: 700; color: var(--primary-color); text-align: right;}
#llecentralx_calculator_wrapper .llecentralx_result-val.llecentralx_sub-val { font-weight: 600; color: #64748B; font-size: 14px; }

#llecentralx_calculator_wrapper .llecentralx_sub-label {
    font-size: 14px;
    color: #64748B;
    padding-left: 18px;
    position: relative;
}
#llecentralx_calculator_wrapper .llecentralx_sub-label::before {
    content: "↳";
    position: absolute;
    left: 0;
    top: 0;
    color: #CBD5E1;
}

#llecentralx_calculator_wrapper .llecentralx_formula-note {
    font-size: 12px;
    font-weight: normal;
    color: #94A3B8;
    margin-top: 4px;
    display: block;
}

#llecentralx_calculator_wrapper .llecentralx_rule-note {
    background-color: var(--info-bg); color: var(--info-text); padding: 12px; border-radius: 6px; font-size: 13px; margin-top: 20px; border-left: 3px solid #3B82F6; line-height: 1.5; display: none;
}

#llecentralx_calculator_wrapper .llecentralx_output-disclaimer {
    font-size: 11.5px;
    color: #64748B;
    margin-top: 8px;
    font-style: italic;
    display: none;
}

#llecentralx_calculator_wrapper .llecentralx_family-hierarchy {
    margin-top: 15px;
    padding: 15px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-color);
}
#llecentralx_calculator_wrapper .llecentralx_family-hierarchy h4 { font-size: 13px; color: var(--primary-color); margin-bottom: 8px;}
#llecentralx_calculator_wrapper .llecentralx_family-hierarchy ol { margin-left: 20px; color: #475569;}

#llecentralx_calculator_wrapper .llecentralx_disclaimer-box {
    margin-top: 40px;
    border-top: 2px dashed #E2E8F0;
    padding-top: 20px;
    font-size: 12px;
    color: #64748B;
    text-align: center;
    display: none; 
}

#llecentralx_calculator_wrapper .llecentralx_hidden { display: none !important; }

/* Responsive & Touch Targets */
@media (max-width: 1024px) {
  #llecentralx_calculator_wrapper .llecentralx_calculator-grid { grid-template-columns: 1fr; }
  #llecentralx_calculator_wrapper .llecentralx_input-section { border-right: none; border-bottom: 1px solid var(--border-color); padding: 25px; }
  #llecentralx_calculator_wrapper .llecentralx_results-section { padding: 25px; }
}
@media (max-width: 480px) {
    #llecentralx_calculator_wrapper { padding: 10px; }
    #llecentralx_calculator_wrapper .llecentralx_input-section, 
    #llecentralx_calculator_wrapper .llecentralx_results-section { padding: 20px; }
    #llecentralx_calculator_wrapper .llecentralx_hero-value { font-size: 32px; }
    #llecentralx_calculator_wrapper .llecentralx_result-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    #llecentralx_calculator_wrapper .llecentralx_result-val { text-align: left; align-self: flex-start; }
    #llecentralx_calculator_wrapper .llecentralx_mode-btn { flex: 1 1 calc(50% - 10px); min-width: 120px; } /* 2 columns on mobile */
    /* Larger touch targets for mobile */
    #llecentralx_calculator_wrapper .llecentralx_input-field { padding: 16px; font-size: 16px; } 
    #llecentralx_calculator_wrapper button.llecentralx_primary-btn, 
    #llecentralx_calculator_wrapper button.llecentralx_secondary-btn { padding: 16px; min-height: 52px; }
    #llecentralx_calculator_wrapper .llecentralx_radio-label { padding: 8px 0; }
}

/* PRINT STYLES */
@media print {
    body * { visibility: hidden; }
    #llecentralx_calculator_wrapper, #llecentralx_calculator_wrapper * { visibility: visible; }
    #llecentralx_calculator_wrapper { position: absolute; left: 0; top: 0; width: 100%; background: white; padding: 0; font-family: sans-serif; border: none; box-shadow: none; margin: 0; }
    #llecentralx_calculator_wrapper .llecentralx_calculator-container { box-shadow: none; border: none; max-width: 100%; margin: 0; padding: 0; }
    #llecentralx_calculator_wrapper .llecentralx_input-section, 
    #llecentralx_calculator_wrapper .llecentralx_action-buttons { display: none !important; }
    #llecentralx_calculator_wrapper .llecentralx_calculator-grid { display: block; }
    #llecentralx_calculator_wrapper .llecentralx_results-section { width: 100%; padding: 0; display: block !important; margin-top: 0; }
    #llecentralx_calculator_wrapper .llecentralx_disclaimer-box { display: block; }
    #llecentralx_calculator_wrapper .llecentralx_hero-card { border: 1px solid #000; box-shadow: none; page-break-inside: avoid; margin-bottom: 30px; display: block !important; opacity: 1 !important; transform: none !important;}
    #llecentralx_calculator_wrapper .llecentralx_breakdown-box { page-break-inside: avoid; border: 1px solid #000; margin-bottom: 20px; }
    #llecentralx_calculator_wrapper .llecentralx_rule-note { display: block !important; border: 1px solid #000; page-break-inside: avoid; }
    #llecentralx_calculator_wrapper .llecentralx_output-disclaimer { display: none !important; } /* Hidden in print as large disclaimer is shown */
    #llecentralx_calculator_wrapper .llecentralx_family-hierarchy { page-break-inside: avoid; }
    #llecentralx_calculator_wrapper .llecentralx_breakdown-header { background: #eee; -webkit-print-color-adjust: exact; }
}