/* Public refer and enquiry pages. Colours, type and spacing come from /tokens/*.css. */

:root {
  --site-gutter: 16px;
  --site-error: #B42318; /* form errors only: 6.5:1 on white */
}

@media (min-width: 768px) {
  :root { --site-gutter: 20px; }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

/* Read out, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html { scroll-behavior: smooth; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--surface-muted);
  line-height: 1.6;
}

main { flex: 1 0 auto; }

/* Text staff can edit keeps the line breaks they type. */
[data-text] { white-space: pre-line; }

:focus-visible { outline: 2px solid var(--nrc-navy); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--site-gutter));
  margin: 0 auto;
  padding: 0 var(--site-gutter);
}

/* Links in light areas: navy and underlined (green text is too faint on white). */
.content a:not(.button) { color: var(--nrc-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.content a:not(.button):hover { color: var(--nrc-green); }
a[href^="tel:"] { white-space: nowrap; }

/* Header */
.site-header { background: var(--surface-dark); }
.site-header :focus-visible { outline-color: var(--nrc-white); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-header__logo { display: block; flex: none; }
.site-header__logo img { width: auto; height: 52px; }

.site-header__phone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--text-on-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  white-space: nowrap;
}
.site-header__phone:hover { color: var(--nrc-green); }

.site-header__phone-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .site-header__logo img { height: 72px; }
  .site-header__phone { font-size: 1.375rem; }
}

/* Hero: photo under the 73% navy overlay (white title 5:1 or better on any photo), arrow badge on the bottom edge. */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 40px var(--site-gutter) 56px;
  background-color: var(--surface-dark);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--nrc-navy-73);
}
.hero--refer { background-image: url("../img/hero-solar-family.webp"); background-position: center 30%; }
.hero--enquire { background-image: url("../img/solar-home-installation.webp"); background-position: center 12%; }

.hero__title {
  position: relative;
  max-width: 900px;
  color: var(--text-on-dark);
  line-height: 1.1;
  text-transform: capitalize;
}

.hero__arrow {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  transform: translate(-50%, 50%);
}
.hero__arrow img { width: 100%; height: 100%; }

@media (min-width: 768px) {
  .hero { min-height: 360px; padding-bottom: 72px; }
  .hero__arrow { width: 72px; height: 72px; }
}

/* Content area */
.content { padding: 56px 0 var(--space-9); background: var(--surface-muted); }

.layout { display: grid; gap: 32px; }

@media (min-width: 1000px) {
  .content { padding: 80px 0 var(--space-10); }
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 640px); gap: var(--space-9); align-items: start; }
}

.lead { font-size: var(--type-lead-size); line-height: 1.6; }

.subhead { margin: 28px 0 16px; font-size: var(--type-h3-size); line-height: 1.2; }

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-left: 60px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface-accent);
  color: var(--text-on-dark);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-black);
  line-height: 1;
}

.callout,
.note {
  margin: 0;
  padding: 16px 20px;
  background: var(--surface-card);
  border-left: 4px solid var(--nrc-green);
  font-weight: 500;
}
.callout { margin-top: 28px; }

.talk { margin-top: 20px; }

/* Referred banner and unknown-link note sit directly on top of the form panel. */
.banner {
  margin: 0;
  padding: 18px 20px;
  background: var(--surface-dark);
  border-left: 6px solid var(--nrc-green);
  color: var(--text-on-dark);
  font-size: var(--type-lead-size);
  font-weight: 500;
  line-height: 1.5;
}

/* "Page not found" and "Something went wrong" */
.notice-panel { max-width: 720px; }
.notice-panel__title { margin-bottom: 12px; font-size: var(--type-h2-size); line-height: 1.15; text-transform: none; }

/* Form panel */
.panel { padding: 24px 20px; background: var(--surface-card); }

@media (min-width: 600px) {
  .panel { padding: 40px; }
}

.panel__title { margin-bottom: 6px; font-size: var(--type-h3-size); line-height: 1.2; }

.form-hint { margin-bottom: 24px; font-size: var(--type-small-size); }

p.noscript {
  margin: 12px 0 16px;
  padding: 14px 16px;
  background: var(--surface-muted);
  border-left: 4px solid var(--nrc-navy);
  font-weight: 500;
}

.fields { display: grid; gap: 20px; }

@media (min-width: 600px) {
  .fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .field--wide { grid-column: 1 / -1; }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field > label,
.label {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.req { color: var(--nrc-green); font-weight: 700; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-none);
  color: var(--nrc-navy);
  font-family: var(--font-body);
  font-size: 1rem; /* 16px, so iOS does not zoom */
  font-weight: 500;
  line-height: 1.4;
  appearance: none;
}
.input:focus {
  border-color: var(--nrc-green);
  outline: 2px solid var(--nrc-navy);
  outline-offset: 2px;
}
.input[aria-invalid="true"] { border-color: var(--site-error); }

textarea.input { min-height: 140px; resize: vertical; }

select.input {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231F354F' stroke-width='2'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 14px 9px;
}

.field__error {
  margin: 0;
  color: var(--site-error);
  font-size: var(--type-small-size);
  font-weight: 500;
  line-height: 1.4;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--nrc-green);
  cursor: pointer;
}
/* Lined up with the consent text, past the 22px box and its 12px gap. */
.consent-privacy { margin: 0 0 0 34px; font-size: var(--type-small-size); }

/* "Who referred you?" — a grey box inside the white panel. The floated legend keeps it inside the box. */
.referrer {
  min-width: 0;
  margin: 0;
  padding: 20px;
  background: var(--surface-muted);
  border: 0;
}
.referrer__title {
  float: left;
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--type-h4-size);
  font-weight: var(--weight-black);
  line-height: 1.3;
}
.referrer__intro { clear: both; margin-bottom: 16px; font-size: 0.9375rem; }

.turnstile { min-height: 65px; margin-top: 24px; }

.form-error {
  margin: 20px 0 0;
  padding: 14px 16px;
  background: var(--surface-muted);
  border-left: 4px solid var(--site-error);
  font-weight: 500;
}

/* Buttons: green, white uppercase Poppins 600, navy on hover; navy variant for share buttons. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 24px;
  background: var(--button-bg);
  border: 0;
  border-radius: var(--radius-none);
  color: var(--button-fg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.button:hover { background: var(--button-bg-hover); color: var(--button-fg); }
/* Disabled (while the scripts load, and while sending): grey, so it plainly cannot be pressed. */
.button:disabled,
.button:disabled:hover { background: var(--border-field); color: var(--nrc-navy); cursor: default; }
.button--navy { background: var(--nrc-navy); }
.button--navy:hover { background: var(--nrc-green); }

.form-submit { width: 100%; margin-top: 24px; }

@media (min-width: 600px) {
  .form-submit { width: auto; min-width: 240px; }
}

/* Thank-you panel */
.thanks__title { margin-bottom: 12px; font-size: var(--type-h2-size); line-height: 1.15; }

.thanks .label { display: block; margin-top: 24px; margin-bottom: 6px; }

.share-link { display: flex; flex-wrap: wrap; gap: 10px; }
.share-link .input { flex: 1 1 240px; }
.share-link .button { flex: 1 0 auto; min-width: 150px; }

@media (min-width: 600px) {
  .share-link .button { flex-grow: 0; }
}

.share-heading { margin: 28px 0 10px; font-size: 0.9375rem; font-weight: 600; }

.share-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

/* Footer: house pattern at 10% on navy, house outline bottom right. */
.site-footer {
  position: relative;
  min-height: 150px;
  padding: 40px 0 48px;
  background: var(--surface-dark) url("../img/nrc-house.png") right -12px bottom -36px / 100px auto no-repeat;
  color: var(--text-on-dark);
  font-size: var(--type-small-size);
  font-weight: 500;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/nrc-house-pattern-1920.png") center top / 1920px auto repeat-x;
  opacity: 0.1;
  pointer-events: none;
}
.site-footer :focus-visible { outline-color: var(--nrc-white); }
.site-footer a { color: var(--text-link); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--text-link-hover); }

.site-footer__inner { position: relative; padding-right: 110px; }

.site-footer__name {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: var(--type-h4-size);
  font-weight: var(--weight-black);
  line-height: 1.3;
}

@media (min-width: 768px) {
  .site-footer { min-height: 180px; background-size: 130px auto; background-position: right 24px bottom -44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, a { transition: none; }
}
