/* Calculator widgets (calculators/<name>/index.html), styled to match the homepage design.
   The calculator markup keeps its original class names so the existing calculation scripts keep working. */

:root {
  --cs-ink: oklch(22% .02 258);
  --cs-navy: #00337c;
  --cs-gold: oklch(83% .16 85);
  --cs-slate: oklch(60% .02 250);
  --cs-hairline: oklch(92% .006 250);
  --cs-cream: oklch(98.5% .003 90);
  --cs-forest: oklch(52% .09 155);
  --cs-forest-soft: oklch(88% .05 155);
}

/* ---------- card ---------- */
.calculator-box {
  border: 1px solid var(--cs-hairline);
  border-radius: 1.5rem;
  background: #fff;
  padding: 2rem;
  box-shadow: 0 40px 80px -45px rgba(11, 31, 58, .35);
}

@media (min-width: 768px) {
  .calculator-box {
    padding: 2.5rem;
  }
}

.calculator-box h3.h3 {
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--cs-ink);
}

.calculator-box .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 1.5rem;
}

@media (min-width: 768px) {
  .calculator-box .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calculator-box .col-md-6,
.calculator-box .col-md-12 {
  min-width: 0;
}

.calculator-box .text_xs {
  margin: 0 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--cs-hairline);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cs-slate);
}

.calculator-box .text_xs b {
  font-weight: 600;
}

/* ---------- fields ---------- */
.calculator-box .input-box {
  margin-bottom: 1.25rem;
}

.calculator-box label {
  display: block;
  width: 100%;
  font-size: .875rem;
  font-weight: 500;
  color: var(--cs-ink);
}

.calculator-box label > div {
  position: relative;
  margin-top: .375rem;
}

.calculator-box .currency-symbol {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--cs-navy);
  pointer-events: none;
}

.calculator-box input.form-control {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--cs-hairline);
  border-radius: .75rem;
  background: var(--cs-cream);
  padding: .8rem 1rem .8rem 2.25rem;
  font: inherit;
  font-size: .9375rem;
  line-height: 1.4;
  color: var(--cs-ink);
  outline: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}

.calculator-box input.form-control::placeholder {
  color: oklch(60% .02 250 / .6);
}

.calculator-box input.form-control:focus {
  border-color: var(--cs-navy);
  background: #fff;
  box-shadow: 0 0 0 3px oklch(83% .16 85 / .6);
}

.calculator-box input.form-control:disabled {
  background: #fff;
  border-style: dashed;
  font-weight: 600;
  color: var(--cs-navy);
  opacity: 1;
  -webkit-text-fill-color: var(--cs-navy);
}

.calculator-box input.form-control:disabled::placeholder {
  color: oklch(60% .02 250 / .45);
  -webkit-text-fill-color: oklch(60% .02 250 / .45);
}

/* ---------- buttons ---------- */
.calculator-box input[type="button"] {
  display: block;
  width: 100%;
  cursor: pointer;
  border: 0;
  border-radius: 9999px;
  padding: .95rem 1.5rem;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
  background: var(--cs-navy);
  transition: background-color .3s, transform .3s, color .3s;
}

.calculator-box input[type="button"]:hover {
  transform: translateY(-2px);
  background: var(--cs-gold);
  color: #0b1f3a;
}

.calculator-box .input-box.arrow_btn {
  margin-bottom: 0;
}

.calculator-box .flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  padding-top: .25rem;
  font-size: .875rem;
  color: var(--cs-slate);
}

.calculator-box .flex > .arrow_btn {
  flex: 1 1 10rem;
}

.calculator-box .btn-2 {
  background: var(--cs-gold);
  color: #0b1f3a;
}

.calculator-box .btn-2:hover {
  background: var(--cs-navy);
  color: #fff;
}

.calculator-box .input-box > p {
  margin: .875rem 0 0;
  font-size: .875rem;
  color: var(--cs-slate);
}

/* ---------- results ---------- */
.calculator-box .output,
.calculator-box .full-output {
  margin-top: 1.75rem;
  padding: 1.5rem;
  border: 1px solid var(--cs-forest-soft);
  border-radius: 1.25rem;
  background: linear-gradient(135deg, oklch(98% .02 155), oklch(98.5% .02 88));
}

.calculator-box .output {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .calculator-box .output {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calculator-box .full-output {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .calculator-box .full-output:has(.input-box + .input-box:not(.hide)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calculator-box .full-output .input-box {
  margin: 0;
}

.calculator-box .output label,
.calculator-box .full-output label {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--cs-slate);
}

.calculator-box .output label b,
.calculator-box .full-output label b {
  font-weight: 500;
}

.calculator-box .output input.form-control,
.calculator-box .full-output input.form-control {
  border: 0;
  background: transparent;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 1.875rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.02em;
}

.calculator-box .output .currency-symbol,
.calculator-box .full-output .currency-symbol {
  font-size: 1.25rem;
}

.calculator-box .output input.form-control,
.calculator-box .full-output input.form-control {
  padding-left: 1.75rem;
}

.calculator-box .output input.form-control.no-symbol,
.calculator-box .full-output input.form-control.no-symbol {
  padding-left: 0;
}

.hide {
  display: none;
}

/* "show more" toggle for optional fields */
.calculator-box .show-more {
  margin: 0 0 1.25rem;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  color: var(--cs-forest);
  user-select: none;
}

.calculator-box .show-more::before {
  content: "+ Show more fields";
}

.calculator-box .show-more.minus::before {
  content: "\2212  Show fewer fields";
}

.calculator-box .show-more:hover {
  text-decoration: underline;
}

/* ---------- explanatory copy ---------- */
.cs-prose p {
  margin: 0 0 1rem;
  line-height: 1.75;
  color: oklch(22% .02 258 / .72);
}

.cs-prose b,
.cs-prose strong {
  font-weight: 600;
  color: var(--cs-ink);
}

.cs-prose a.link,
.cs-link {
  color: var(--cs-forest);
  font-weight: 500;
  text-decoration: none;
}

.cs-prose a.link:hover,
.cs-link:hover {
  text-decoration: underline;
}

.cs-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.cs-list li {
  position: relative;
  margin: 0 0 .625rem;
  padding-left: 1.875rem;
  line-height: 1.65;
  color: oklch(22% .02 258 / .72);
}

.cs-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .2rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: var(--cs-forest-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23327a54' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.cs-list li strong {
  font-weight: 600;
  color: var(--cs-ink);
}

/* dark sections */
.cs-prose-dark p,
.cs-prose-dark li {
  color: rgb(255 255 255 / .7);
}

.cs-prose-dark a.link {
  color: var(--cs-gold);
}

/* table (GST due dates) */
.cs-table {
  overflow: hidden;
  border: 1px solid var(--cs-hairline);
  border-radius: 1.5rem;
  background: #fff;
}

.cs-table table {
  width: 100%;
  border-collapse: collapse;
}

.cs-table th,
.cs-table td {
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: .9375rem;
}

.cs-table th {
  background: var(--cs-navy);
  color: #fff;
  font-weight: 600;
}

.cs-table td {
  border-top: 1px solid var(--cs-hairline);
  color: var(--cs-ink);
}

.cs-table tr:nth-child(even) td {
  background: var(--cs-cream);
}

/* worked example */
.example_box {
  margin-top: 1.5rem;
  border: 1px solid var(--cs-hairline);
  border-left: 4px solid var(--cs-gold);
  border-radius: 1.25rem;
  background: var(--cs-cream);
  padding: 1.5rem 1.75rem;
}

.example_box .title {
  margin-bottom: .75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cs-ink);
}

.example_box p {
  margin: 0 0 .5rem;
  color: oklch(22% .02 258 / .72);
}
