/* SuperGuide calculators, styled to Age Pension Guide (Genesis Sample: Source Sans Pro, #75297a).
   Everything is scoped to .sgcalc so it never touches the theme. Fits a 700px content column. */

.sgcalc {
  --sgcalc-primary: #75297a;
  --sgcalc-primary-hover: #8c348c;
  --sgcalc-tint: #f8ebf7;
  --sgcalc-tint-soft: #fcf6fb;
  --sgcalc-text: #333;
  --sgcalc-muted: #595959;
  --sgcalc-border: #ddd;
  --sgcalc-rule: #eee;
  --sgcalc-error: #b3261e;
  --sgcalc-focus: #75297a;
  --sgcalc-radius: 5px;

  box-sizing: border-box;
  max-width: 700px;
  margin: 0 0 40px;
  color: var(--sgcalc-text);
  font-family: inherit;
  font-size: 18px;
  line-height: 1.625;
}
.sgcalc *, .sgcalc *::before, .sgcalc *::after { box-sizing: inherit; }
.sgcalc p { margin: 0 0 16px; }
.sgcalc [hidden] { display: none !important; }

.sgcalc .sgcalc-intro { margin-bottom: 24px; }
.sgcalc .sgcalc-note { color: var(--sgcalc-muted); font-size: 16px; }

/* Form */
.sgcalc .sgcalc-form {
  background: var(--sgcalc-tint-soft);
  border: 1px solid var(--sgcalc-tint);
  border-top: 4px solid var(--sgcalc-primary);
  border-radius: var(--sgcalc-radius);
  padding: 24px;
}
.sgcalc .sgcalc-field { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.sgcalc .sgcalc-field > legend,
.sgcalc .sgcalc-field > label {
  display: block;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.4;
  margin: 0 0 6px;
  padding: 0;
  color: var(--sgcalc-text);
}
.sgcalc .sgcalc-help { color: var(--sgcalc-muted); font-size: 16px; line-height: 1.5; margin: 0 0 10px; }
.sgcalc .sgcalc-section-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin: 32px 0 8px;
  color: var(--sgcalc-text);
}
.sgcalc .sgcalc-form .sgcalc-section-title:first-of-type { margin-top: 8px; }
.sgcalc .sgcalc-section-help { margin-bottom: 20px; }

/* Radio choices as large, tappable options */
.sgcalc .sgcalc-options { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.sgcalc .sgcalc-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid var(--sgcalc-border);
  border-radius: var(--sgcalc-radius);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
  margin: 0;
}
.sgcalc .sgcalc-option input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--sgcalc-primary);
  flex: none;
}
.sgcalc .sgcalc-option:has(input:checked) {
  border-color: var(--sgcalc-primary);
  background: var(--sgcalc-tint);
  box-shadow: inset 0 0 0 1px var(--sgcalc-primary);
}
.sgcalc .sgcalc-option:has(input:focus-visible) { outline: 3px solid var(--sgcalc-focus); outline-offset: 2px; }

/* Info icon beside an option: shows on hover, keyboard focus or tap */
.sgcalc .sgcalc-option-with-info { display: inline-flex; align-items: center; gap: 8px; }
.sgcalc .sgcalc-info { position: relative; display: inline-flex; }
.sgcalc .sgcalc-info-button {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  margin: 0;
  border: 2px solid var(--sgcalc-primary);
  border-radius: 50%;
  background: #fff;
  color: var(--sgcalc-primary);
  font-family: Georgia, serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.sgcalc .sgcalc-info-button:hover,
.sgcalc .sgcalc-info-button:focus,
.sgcalc .sgcalc-info-button[aria-expanded="true"] { background: var(--sgcalc-primary); color: #fff; }
.sgcalc .sgcalc-info-button:focus-visible { outline: 3px solid var(--sgcalc-focus); outline-offset: 2px; }
.sgcalc .sgcalc-info-text {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--sgcalc-border);
  border-top: 3px solid var(--sgcalc-primary);
  border-radius: var(--sgcalc-radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  color: var(--sgcalc-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
.sgcalc .sgcalc-info:hover .sgcalc-info-text,
.sgcalc .sgcalc-info-button:focus + .sgcalc-info-text,
.sgcalc .sgcalc-info-button[aria-expanded="true"] + .sgcalc-info-text { display: block; }

/* Money inputs */
.sgcalc .sgcalc-money { display: flex; align-items: stretch; max-width: 360px; }
.sgcalc .sgcalc-money-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--sgcalc-border);
  border-right: 0;
  border-radius: var(--sgcalc-radius) 0 0 var(--sgcalc-radius);
  color: var(--sgcalc-muted);
  font-size: 18px;
}
.sgcalc .sgcalc-money input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--sgcalc-border);
  border-radius: 0 var(--sgcalc-radius) var(--sgcalc-radius) 0;
  color: var(--sgcalc-text);
  font-size: 18px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.sgcalc .sgcalc-money input:focus { border-color: var(--sgcalc-primary); }
.sgcalc .sgcalc-money input:focus-visible { outline: 3px solid var(--sgcalc-focus); outline-offset: 2px; }
.sgcalc .sgcalc-money-suffix {
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: var(--sgcalc-muted);
  font-size: 16px;
  white-space: nowrap;
}

/* Errors */
.sgcalc .sgcalc-error { color: var(--sgcalc-error); font-size: 16px; font-weight: 600; margin: 8px 0 0; }
.sgcalc .has-error .sgcalc-money input,
.sgcalc .has-error .sgcalc-money-prefix { border-color: var(--sgcalc-error); }
.sgcalc .sgcalc-error-summary {
  border: 2px solid var(--sgcalc-error);
  border-radius: var(--sgcalc-radius);
  background: #fff;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.sgcalc .sgcalc-error-summary p { font-weight: 600; margin-bottom: 8px; }
.sgcalc .sgcalc-error-summary ul { margin: 0 0 0 20px; padding: 0; }
.sgcalc .sgcalc-error-summary a { color: var(--sgcalc-error); text-decoration: underline; }

/* Buttons: the theme's .button shape, in the site purple */
.sgcalc .sgcalc-actions { margin: 8px 0 0; }
.sgcalc .sgcalc-button {
  display: inline-block;
  background-color: var(--sgcalc-primary);
  border: 2px solid var(--sgcalc-primary);
  border-radius: var(--sgcalc-radius);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  padding: 15px 30px;
  text-decoration: none;
  white-space: normal;
  width: auto;
}
.sgcalc .sgcalc-button:hover,
.sgcalc .sgcalc-button:focus { background-color: var(--sgcalc-primary-hover); border-color: var(--sgcalc-primary-hover); color: #fff; }
.sgcalc .sgcalc-button:focus-visible { outline: 3px solid var(--sgcalc-focus); outline-offset: 3px; }
.sgcalc .sgcalc-button[disabled] { opacity: .7; cursor: progress; }
.sgcalc .sgcalc-button-outline { background: #fff; color: var(--sgcalc-primary); }
.sgcalc .sgcalc-button-outline:hover,
.sgcalc .sgcalc-button-outline:focus { background: var(--sgcalc-tint); color: var(--sgcalc-primary); border-color: var(--sgcalc-primary); }

/* Result */
.sgcalc .sgcalc-result { margin-top: 32px; scroll-margin-top: 24px; }
.sgcalc .sgcalc-result:focus { outline: none; }
.sgcalc .sgcalc-result-title { font-size: 27px; font-weight: 600; line-height: 1.2; margin: 0 0 16px; }
.sgcalc .sgcalc-figure {
  background: var(--sgcalc-primary);
  color: #fff;
  border-radius: var(--sgcalc-radius);
  padding: 24px;
  margin-bottom: 16px;
}
.sgcalc .sgcalc-figure p { margin: 0; color: #fff; }
.sgcalc .sgcalc-figure-main { line-height: 1.1; }
.sgcalc .sgcalc-figure-amount { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sgcalc .sgcalc-figure-unit { font-size: 20px; font-weight: 600; }
.sgcalc .sgcalc-figure-sub { font-size: 20px; margin-top: 8px !important; font-variant-numeric: tabular-nums; }
.sgcalc .sgcalc-figure-each { font-size: 16px; margin-top: 12px !important; opacity: .95; }

.sgcalc .sgcalc-change {
  border-left: 4px solid var(--sgcalc-primary-hover);
  background: var(--sgcalc-tint-soft);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.sgcalc .sgcalc-change p { margin: 0; }
.sgcalc .sgcalc-change .sgcalc-change-note { color: var(--sgcalc-muted); font-size: 15px; margin-top: 4px; }
.sgcalc .sgcalc-change.is-strong { background: var(--sgcalc-tint); }
.sgcalc .sgcalc-change.is-strong p:first-child { font-weight: 700; font-size: 20px; }

.sgcalc .sgcalc-figure-change {
  border-top: 1px solid rgba(255, 255, 255, .35);
  margin-top: 16px !important;
  padding-top: 14px;
  font-size: 17px;
  line-height: 1.45;
}
.sgcalc .sgcalc-figure-change.is-strong { font-size: 20px; font-weight: 700; }

.sgcalc .sgcalc-statement {
  background: var(--sgcalc-tint);
  border-left: 5px solid var(--sgcalc-primary);
  border-radius: var(--sgcalc-radius);
  padding: 16px 20px;
  margin: 0 0 8px !important;
  font-size: 20px;
  line-height: 1.45;
}
.sgcalc .sgcalc-statement strong { color: var(--sgcalc-primary); font-weight: 700; }
.sgcalc .sgcalc-explain { margin-bottom: 24px; }

.sgcalc .sgcalc-guides {
  border: 1px solid var(--sgcalc-border);
  border-radius: var(--sgcalc-radius);
  padding: 16px 20px 8px;
  margin: 0 0 24px;
}
.sgcalc .sgcalc-guides-title { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; color: var(--sgcalc-text); }
.sgcalc .sgcalc-guides ul { margin: 0 0 8px 20px; padding: 0; }
.sgcalc .sgcalc-guides li { margin: 0 0 8px; font-size: 17px; line-height: 1.45; list-style: disc; }
.sgcalc .sgcalc-limits td:first-child a { color: var(--sgcalc-primary); }
.sgcalc .sgcalc-callout {
  background: var(--sgcalc-tint);
  border-radius: var(--sgcalc-radius);
  padding: 16px 20px;
}

/* Limits table, matching the site's table style */
.sgcalc .sgcalc-limits {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.5;
}
.sgcalc .sgcalc-limits th,
.sgcalc .sgcalc-limits td {
  border: 1px solid #f2f2f2;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.sgcalc .sgcalc-limits th { background: var(--sgcalc-tint); color: var(--sgcalc-text); font-weight: 600; }
.sgcalc .sgcalc-limits td:first-child { width: 45%; font-weight: 600; }
.sgcalc .sgcalc-limits td:last-child { color: var(--sgcalc-muted); }
.sgcalc .sgcalc-limits td:last-child strong { color: var(--sgcalc-text); }

.sgcalc .sgcalc-about { border-top: 1px solid var(--sgcalc-rule); padding-top: 16px; }

.sgcalc .sgcalc-warning {
  border: 1px solid var(--sgcalc-border);
  border-left: 4px solid var(--sgcalc-primary);
  border-radius: var(--sgcalc-radius);
  padding: 16px 20px;
  margin: 8px 0 20px;
  font-size: 16px;
  line-height: 1.55;
}
.sgcalc .sgcalc-warning p { margin: 0; }

.sgcalc .sgcalc-details {
  border-bottom: 4px solid var(--sgcalc-primary-hover);
  margin: 0 0 20px;
  font-size: 16px;
}
.sgcalc .sgcalc-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  padding: 12px 0;
  color: var(--sgcalc-text);
}
.sgcalc .sgcalc-details summary:focus-visible { outline: 3px solid var(--sgcalc-focus); outline-offset: 2px; }
.sgcalc .sgcalc-details p { margin-bottom: 16px; }
.sgcalc a { color: var(--sgcalc-primary); text-decoration: underline; text-underline-offset: 3px; }

/* Key figures box */
.sgcalc.sgcalc-figures { max-width: none; background: var(--sgcalc-tint); border: 1px solid #ecdcee; border-radius: 6px; padding: 24px 28px; margin: 0 0 32px; }
.sgcalc .sgcalc-figures-table { width: 100%; border-collapse: collapse; margin: 0 0 12px; background: #fff; }
.sgcalc .sgcalc-figures-table th, .sgcalc .sgcalc-figures-table td { background: #fff; padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; font-size: 17px; }
.sgcalc .sgcalc-figures-table td { white-space: nowrap; font-weight: 600; text-align: center; }
.sgcalc .sgcalc-figures-table thead th:not(:first-child) { text-align: center; }
.sgcalc .sgcalc-figures-table thead th { font-size: 15px; color: var(--sgcalc-text); }
.sgcalc .sgcalc-figures-table tbody th { font-weight: 400; }
.sgcalc .sgcalc-figures-note { display: block; font-size: 14px; color: #666; margin-top: 2px; }
.sgcalc .sgcalc-figures-link { margin: 8px 0 0; }

/* Narrow screens */
@media (max-width: 600px) {
  .sgcalc .sgcalc-form { padding: 18px 16px; }
  .sgcalc .sgcalc-options { flex-direction: column; }
  .sgcalc .sgcalc-option { width: 100%; }
  .sgcalc .sgcalc-option-with-info { width: 100%; }
  .sgcalc .sgcalc-option-with-info .sgcalc-option { flex: 1 1 auto; width: auto; }
  .sgcalc .sgcalc-money { max-width: none; }
  .sgcalc .sgcalc-figure-amount { font-size: 36px; }
  .sgcalc .sgcalc-button { width: 100%; text-align: center; }
  .sgcalc .sgcalc-limits thead { display: none; }
  .sgcalc .sgcalc-limits, .sgcalc .sgcalc-limits tbody, .sgcalc .sgcalc-limits tr, .sgcalc .sgcalc-limits td { display: block; width: 100% !important; }
  .sgcalc .sgcalc-limits tr { border: 1px solid #f2f2f2; margin-bottom: 8px; }
  .sgcalc .sgcalc-limits td { border: 0; }
  .sgcalc .sgcalc-limits td:first-child { background: var(--sgcalc-tint); }
  .sgcalc.sgcalc-figures { padding: 18px 14px; }
  .sgcalc .sgcalc-figures-table th, .sgcalc .sgcalc-figures-table td { padding: 8px 6px; font-size: 15px; }
}
