/*--------------------------------------------------------------
# General Styling & Layout
--------------------------------------------------------------*/
html {
  scroll-behavior: smooth;
}

body {
  font-family: "Open Sans", sans-serif;
  background-color: #000000;
  color: #c7bebe;
  margin: 0;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
}

header.header-section {
  text-align: center;
  margin-bottom: 30px;
  max-width: 800px;
  width: 100%;
}

header.header-section h1 {
  font-size: 38px;
  font-weight: 500;
  color: #ffffff;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

header.header-section .subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #8400ea;
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/*--------------------------------------------------------------
# Calculator Card Styling
--------------------------------------------------------------*/
#mainCalculator {
  background: #444444;
  color: #ffffff;
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.5);
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 25px;
  border: 1px solid #555555;
  transition: all 0.3s ease;
}

#mainCalculator:hover {
  box-shadow: 0px 15px 40px rgba(132, 0, 234, 0.15);
}

/*--------------------------------------------------------------
# Forms and Tables Styling
--------------------------------------------------------------*/
table {
  width: 100% !important;
  border-collapse: collapse;
  margin-bottom: 0;
  table-layout: fixed; /* Ensures identical column widths across all tables */
}

td {
  padding: 14px 15px; /* Consistent vertical row spacing */
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td[align="right"] {
  text-align: right;
  font-weight: 600;
  color: #ffffff;
  width: 60%;
  padding-right: 20px;
  font-size: 14px !important;
}

td label {
  color: #ffffff;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.4;
}

/* Align inputs and description texts to the left side of the cell next to labels */
td:not([align="right"]) {
  text-align: left !important;
  width: 40%;
}

/*--------------------------------------------------------------
# Input & Select Fields
--------------------------------------------------------------*/
input[type="text"] {
  text-align: right; /* Align numbers inside inputs to the right */
  font-family: "Open Sans", sans-serif;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  color: #222222;
  padding: 8px 12px;
  border-radius: 4px;
  width: 100%;
  max-width: 260px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

input[type="text"]:focus {
  border-color: #8400ea;
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(132, 0, 234, 0.4);
  outline: none;
}

/* Read-only inputs (calculators result display) */
input[readonly] {
  background-color: #ffffff !important;
  color: #222222 !important;
  border-color: #cccccc;
  cursor: not-allowed;
  font-weight: 600;
}

/* Result rows colors (All calculation displays) */
#NettProfit, #baseCostPre2001, #BaseCost, #CGTProfit, #CGTProfitPerc, #CGTPayable {
  background-color: #8400ea !important;
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid #a32cfc !important;
  box-shadow: 0 0 10px rgba(132, 0, 234, 0.2);
}

#CGTPayable {
  font-size: 16px;
  box-shadow: 0 0 12px rgba(132, 0, 234, 0.4);
}

/*--------------------------------------------------------------
# Checkboxes, Radio Buttons, Fieldsets
--------------------------------------------------------------*/
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #8400ea;
  cursor: pointer;
  vertical-align: middle;
}

fieldset {
  border: 1px solid #555555;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
  background: #333333;
  text-align: center;
}

legend {
  font-weight: 700;
  color: #ffffff;
  padding: 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Center elements inside table row for radio fieldsets */
td[colspan="2"] fieldset {
  margin: 10px auto;
  max-width: 90%;
}

/* Adjust labels for radio buttons styled by jQuery UI */
.ui-checkboxradio-label {
  font-size: 13px !important;
  margin: 5px !important;
  background: #2b2b2b !important;
  color: #ffffff !important;
  border: 1px solid #555555 !important;
}

.ui-checkboxradio-label.ui-checkboxradio-checked {
  background: #8400ea !important;
  color: #ffffff !important;
  border-color: #a32cfc !important;
}

/*--------------------------------------------------------------
# Terms and Conditions
--------------------------------------------------------------*/
#terms {
  /*background: #222222;*/
  color: #c7bebe;
  padding: 25px 30px;
  border-radius: 8px;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
  width: 100%;
  box-sizing: border-box;
}

#terms td {
  border-bottom: none;
  font-size: 12.5px;
  line-height: 1.6;
}

#terms td[align="left"] {
  width: 50%;
  font-size: 14px;
  color: #ffffff;
}

#terms input[type="checkbox"] {
  margin-left: 10px;
}

/*--------------------------------------------------------------
# Responsive Adjustments
--------------------------------------------------------------*/
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }
  
  header.header-section h1 {
    font-size: 28px;
  }
  
  #mainCalculator, #terms {
    padding: 25px 15px;
  }
  
  td {
    padding: 10px 5px;
  }
  
  td[align="right"] {
    width: 100%;
    display: block;
    text-align: left;
    padding-bottom: 5px;
    padding-right: 0;
  }
  
  td:not([align="right"]) {
    width: 100%;
    display: block;
    padding-top: 2px;
    padding-bottom: 12px;
  }
  
  input[type="text"] {
    max-width: 100%;
  }

  td[colspan="2"] fieldset {
    max-width: 100%;
  }
}
