/* --------------------------------------------------------------------------
   CWN Salary Calculator

   Same design system as the rest of the site: 0px radius, Inter 700 against
   Inter 300, hairline edges instead of shadows, fixed px type. The one moment of
   colour-block is the script panel, which sits on the dark secondary so the
   sentence she is meant to say out loud is the thing the eye lands on.
   -------------------------------------------------------------------------- */

.cwnsalarycalc-block {
  background: #fff;
  padding-top: var(--section-padding-top);
  padding-bottom: var(--section-padding-bottom);
}

/* The `hidden` attribute resolves in the user-agent sheet, so any author rule
   with a class outranks it. Restate it here or the results panel shows through
   before anyone has run anything. */
.cwnsalarycalc-block [hidden] {
  display: none !important;
}

.cwnsalarycalc-header {
  max-width: 760px;
  margin-bottom: 40px;
}

.cwnsalarycalc-heading {
  font-size: 38px;
  line-height: 1.12;
  margin: 0 0 16px;
}

.cwnsalarycalc-intro {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--body-text);
  margin: 0;
  max-width: 60ch;
}

.cwnsalarycalc-tool {
  border: 1px solid var(--hairline);
  padding: 40px;
  background: #fff;
}

.cwnsalarycalc-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
}

.cwnsalarycalc-label {
  display: block;
  font-family: var(--font1);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

/* The dollar sign is drawn into the field rather than typed by the visitor, so
   the input stays a plain number and the parser never has to strip a symbol. */
.cwnsalarycalc-input-wrap {
  position: relative;
}

.cwnsalarycalc-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 300;
  color: var(--muted);
  pointer-events: none;
}

.cwnsalarycalc-input-wrap .cwnsalarycalc-input {
  padding-left: 32px;
}

.cwnsalarycalc-input,
.cwnsalarycalc-select {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 0;
  box-shadow: none;
  padding: 13px 16px;
  font-family: var(--font2);
  font-size: 16px;
  font-weight: 300;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.18s ease;
}

.cwnsalarycalc-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%23262626' stroke-width='1.6' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 13px 8px;
  padding-right: 44px;
  cursor: pointer;
}

.cwnsalarycalc-input:focus,
.cwnsalarycalc-select:focus {
  border-color: var(--ink);
  border-width: 2px;
  outline: none;
}

/* Spinners push the value off-centre and invite click-dragging a salary, which
   is not a thing anyone should do by accident. */
.cwnsalarycalc-input::-webkit-outer-spin-button,
.cwnsalarycalc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cwnsalarycalc-input[type=number] {
  -moz-appearance: textfield;
}

.cwnsalarycalc-help {
  font-size: 13px;
  line-height: 1.55;
  font-weight: 300;
  color: var(--muted);
  margin: 8px 0 0;
}

.cwnsalarycalc-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cwnsalarycalc-error {
  margin: 0;
  font-size: 14px;
  font-weight: 300;
  color: #B3261E;
}

.cwnsalarycalc-results {
  margin-top: 40px;
  border-top: 1px solid var(--hairline);
  padding-top: 36px;
}

.cwnsalarycalc-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.cwnsalarycalc-figure {
  background: #fff;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cwnsalarycalc-figure--accent {
  background: var(--surface-card);
}

.cwnsalarycalc-figure-label {
  font-family: var(--font1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.cwnsalarycalc-figure-value {
  font-family: var(--font1);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cwnsalarycalc-figure--accent .cwnsalarycalc-figure-value {
  color: var(--primary);
}

.cwnsalarycalc-figure-sub {
  font-size: 13px;
  line-height: 1.55;
  font-weight: 300;
  color: var(--muted);
}

.cwnsalarycalc-cost {
  margin-top: 32px;
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
  padding: 26px 28px;
}

.cwnsalarycalc-cost-heading {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 10px;
}

.cwnsalarycalc-cost-value {
  font-family: var(--font1);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  margin: 0 0 12px;
}

.cwnsalarycalc-cost-note {
  font-size: 14px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--body-text);
  margin: 0;
  max-width: 62ch;
}

.cwnsalarycalc-script {
  margin-top: 32px;
  background: var(--secondary);
  padding: 34px 36px;
}

.cwnsalarycalc-script-heading {
  font-size: 18px;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 14px;
}

.cwnsalarycalc-script-body {
  font-size: 18px;
  line-height: 1.75;
  font-weight: 300;
  color: #fff;
  margin: 0 0 16px;
  max-width: 68ch;
}

.cwnsalarycalc-script-note {
  font-size: 14px;
  line-height: 1.65;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 22px;
  max-width: 62ch;
}

.cwnsalarycalc-copy {
  font-family: var(--font1);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 0;
  box-shadow: none;
  padding: 13px 24px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cwnsalarycalc-copy:hover {
  background: #fff;
  border-color: #fff;
  color: var(--secondary);
}

.cwnsalarycalc-noscript,
.cwnsalarycalc-note {
  font-size: 13px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--muted);
  margin: 20px 0 0;
  max-width: 74ch;
}

@media (max-width: 1199px) {
  .cwnsalarycalc-heading { font-size: 32px; }
  .cwnsalarycalc-tool { padding: 32px; }
  .cwnsalarycalc-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cwnsalarycalc-script { padding: 28px; }
}

@media (max-width: 767px) {
  .cwnsalarycalc-heading { font-size: 26px; }
  .cwnsalarycalc-intro { font-size: 16px; }
  .cwnsalarycalc-tool { padding: 24px 20px; }
  .cwnsalarycalc-form { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cwnsalarycalc-figures { grid-template-columns: minmax(0, 1fr); }
  .cwnsalarycalc-figure { padding: 20px; }
  .cwnsalarycalc-figure-value { font-size: 26px; }
  .cwnsalarycalc-cost { padding: 22px; }
  .cwnsalarycalc-cost-value { font-size: 28px; }
  .cwnsalarycalc-script { padding: 24px 20px; }
  .cwnsalarycalc-script-body { font-size: 16px; }
  .cwnsalarycalc-actions .btn,
  .cwnsalarycalc-copy { width: 100%; text-align: center; }
}
