/* ── TRALO Brand System ──────────────────────────────────── */
:root {
  --red:        #992626;
  --red-dark:   #7a1e1e;
  --blue:       #818BC1;
  --green:      #54A752;
  --green-dark: #24381F;
  --beige:      #DD9E58;

  --cream:      #FFFBF8;
  --white:      #FFFBF8;
  --panel:      #EFEDE8;
  --neutral-01: #F3EFED;
  --neutral-02: #E7E3E1;
  --neutral-03: #DBD8D6;
  --neutral-04: #CFCCCB;
  --neutral-05: #B7B4B4;
  --neutral-06: #87857F;
  --black:      #131313;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

[hidden] { display: none !important; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.25rem;
  color: var(--black);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.02em; }
h1 { font-size: 3rem;   line-height: 3.25rem; font-weight: 500; }
h2 { font-size: 2.5rem; line-height: 2.75rem; font-weight: 500; }
h3 { font-size: 2rem;   line-height: 2.25rem; font-weight: 500; }
h4 { font-size: 1.5rem; line-height: 1.75rem; font-weight: 500; }
h5 { font-size: 1.25rem; line-height: 1.5rem; font-weight: 500; }
h6 { font-size: 1rem;   line-height: 1.25rem; font-weight: 500; }

.eyebrow {
  color: var(--red);
  font-size: 0.875rem;
  line-height: 1.125rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

strong, b { font-weight: 600; } /* Demi Bold */
small { font-size: 0.875rem; line-height: 1.125rem; }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2.5rem;
  background: var(--cream);
  border-bottom: 1px solid var(--neutral-03);
}

.site-header .logo {
  height: 28px;
  width: auto;
  display: block;
}

/* ── Main Layout ─────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.page-intro {
  text-align: center;
  margin-bottom: 3rem;
}

.page-intro h1 {
  margin-bottom: 0.75rem;
}

.page-intro p {
  color: var(--neutral-06);
  font-size: 1.125rem;
  line-height: 1.375rem;
}

/* ── Plan Cards ──────────────────────────────────────────── */
.plans-section {
  margin-bottom: 3rem;
}

.plans-grid {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.plan-card {
  background: var(--white);
  border: 2px solid transparent;
  padding: 2.5rem 2.25rem;
  flex: 1 1 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.plan-card {
  border: 1px solid var(--neutral-03);
}

.plan-card:hover {
  background: var(--neutral-01);
}

.plan-card.selected {
  background: var(--white);
  outline: 2px solid var(--green-dark);
  outline-offset: -2px;
  z-index: 1;
}

.plan-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--green-dark);
  color: #fff;
  font-size: 0.625rem;
  line-height: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  white-space: nowrap;
}

.plan-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--black);
}

.plan-price {
  font-size: 3rem;
  line-height: 3.25rem;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 0.25rem;
}

.plan-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--neutral-06);
}

.plan-desc {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--neutral-06);
  margin-bottom: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--neutral-03);
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.plan-features li {
  font-size: 0.9375rem;
  line-height: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  color: var(--black);
}

.plan-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.plan-card .select-indicator {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--neutral-04);
  background: var(--white);
  transition: background 0.15s, border-color 0.15s;
}

.plan-card.selected .select-indicator {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.plan-card.selected .select-indicator::after {
  content: '';
  display: block;
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(2px, -1px);
  margin: 2px auto 0;
}

/* ── Terms & Conditions ──────────────────────────────────── */
.terms-section {
  background: var(--white);
  border: 1px solid var(--neutral-03);
  border-radius: 0;
  padding: 2.5rem 2.25rem;
  margin-bottom: 2rem;
}

.terms-section h5 {
  margin-bottom: 1rem;
}

.terms-scroll {
  height: 220px;
  overflow-y: scroll;
  background: var(--neutral-01);
  border: 1px solid var(--neutral-03);
  border-radius: 0;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--black);
}

.terms-scroll p { margin-bottom: 0.75rem; }
.terms-scroll h6 { margin: 1rem 0 0.4rem; }
.terms-scroll ul {
  margin: 0 0 0.75rem 1.25rem;
}

.terms-scroll li {
  margin-bottom: 0.35rem;
}

.terms-agree {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.terms-agree input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--neutral-04);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.terms-agree input[type="checkbox"]:checked {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.terms-agree input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0px;
  width: 6px;
  height: 11px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.terms-agree label {
  font-size: 0.875rem;
  line-height: 1.125rem;
  cursor: pointer;
}

/* ── CTA Banner ──────────────────────────────────────────── */
.cta-banner {
  background: var(--green-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2.5rem 2.5rem;
}

.cta-banner h3 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9375rem;
}

.btn-primary {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  min-width: 220px;
}

.btn-primary:hover:not(:disabled) {
  background: #478F45;
}

.btn-primary:disabled {
  background: var(--green);
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Validation hint ─────────────────────────────────────── */
.hint {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--neutral-06);
  min-height: 1.25rem;
  text-align: center;
}

.hint-error {
  color: var(--red);
}

/* ── Equipment & Details Sections ────────────────────────── */
.equipment-section,
.details-section {
  background: var(--white);
  border: 1px solid var(--neutral-03);
  border-radius: 0;
  padding: 2.5rem 2.25rem;
  margin-bottom: 2rem;
}

.equipment-header {
  margin-bottom: 1.25rem;
}

.equipment-header h5,
.details-section h5 {
  margin-bottom: 0.25rem;
}

.equipment-header p {
  font-size: 0.875rem;
  color: var(--neutral-06);
  margin: 0;
}

.panel-note {
  font-size: 0.9375rem;
  color: var(--neutral-06);
  margin: 0.25rem 0 1rem;
}

/* Equipment checklist */
.equipment-checklist { display: grid; gap: 0.75rem; }

.checklist-intro {
  font-size: 0.875rem;
  color: var(--neutral-06);
  margin: 0 0 0.25rem;
}

.equipment-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  cursor: pointer;
}

.equipment-check input { width: 18px; height: 18px; accent-color: var(--green); }

.equipment-item {
  display: grid;
  gap: 0.75rem;
}

.nested-equipment {
  margin-left: 1.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--neutral-02);
}

.water-heater-toggle { font-weight: 500; }

.water-heater-type {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.water-heater-type-label {
  font-size: 0.875rem;
  color: var(--neutral-06);
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  cursor: pointer;
}

.radio-pill input { accent-color: var(--green); }

.heat-pump-type {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.equipment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--neutral-02);
}

.equipment-row:last-of-type { border-bottom: none; }

.equipment-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.equipment-label span { font-size: 1rem; }

.equipment-label small {
  font-size: 0.75rem;
  color: var(--neutral-06);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--neutral-03);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}

.qty-btn:hover { background: var(--neutral-02); border-color: var(--neutral-05); }
.qty-btn:active { background: var(--neutral-03); }

.qty-value {
  font-size: 1rem;
  font-weight: 500;
  min-width: 1.5rem;
  text-align: center;
}

.price-breakdown {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--neutral-02);
}

.price-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--neutral-06);
  font-size: 0.875rem;
}

.price-breakdown strong {
  color: var(--black);
  font-weight: 500;
}

.addon-total {
  margin-top: 1.25rem;
  text-align: right;
  font-size: 1.125rem;
  color: var(--neutral-06);
}

.addon-total strong {
  color: var(--green);
  font-size: 1.25rem;
  font-weight: 500;
}

.details-section h5 {
  margin-bottom: 1.25rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.details-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.details-grid span {
  font-size: 0.875rem;
  line-height: 1.125rem;
  color: var(--black);
}

.details-grid input,
.details-grid textarea,
.details-grid select {
  width: 100%;
  border: 1px solid var(--neutral-03);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: inherit;
  padding: 0.75rem 0.875rem;
  appearance: none;
}

.details-grid select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23131313' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.details-grid input:focus,
.details-grid textarea:focus,
.details-grid select:focus {
  border-color: var(--green-dark);
  outline: none;
}

.details-grid textarea {
  resize: vertical;
  min-height: 96px;
}

.address-autocomplete {
  position: relative;
}

.address-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--neutral-03);
  border-radius: 0;
  box-shadow: 0 12px 28px rgba(15, 15, 21, 0.12);
}

.address-suggestions[hidden] {
  display: none;
}

.address-suggestion {
  display: block;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 0;
  border-bottom: 1px solid var(--neutral-02);
  background: transparent;
  color: var(--black);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.address-suggestion:last-child {
  border-bottom: 0;
}

.address-suggestion:hover,
.address-suggestion:focus {
  background: var(--neutral-01);
  outline: none;
}

.address-suggestion-muted {
  color: var(--neutral-06);
  cursor: default;
}

.address-suggestion-muted:hover {
  background: transparent;
}

.field-note {
  color: var(--neutral-06);
}

.details-full {
  grid-column: 1 / -1;
}

/* ── Checkout page ───────────────────────────────────────── */
#checkout-container {
  max-width: 1100px;
  margin: 2.5rem auto 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--neutral-06);
  text-decoration: none;
  margin-bottom: 2rem;
}

.back-link:hover { color: var(--black); }

/* ── Return / Confirmation page ──────────────────────────── */
.return-card {
  max-width: 540px;
  margin: 4rem auto;
  background: var(--panel);
  border: none;
  border-radius: 0;
  padding: 3rem 2.5rem;
  text-align: center;
}

.return-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.75rem;
}

.return-icon.success { background: rgba(91, 153, 91, 0.15); color: var(--green); }
.return-icon.pending { background: rgba(129, 139, 193, 0.15); color: var(--blue); }

.return-card h2 { margin-bottom: 0.75rem; }
.return-card p  { color: var(--neutral-06); margin-bottom: 1.5rem; }

.return-email {
  font-weight: 600;
  color: var(--black);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--green-dark);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.75rem;
  border: 2px solid var(--green-dark);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-secondary:hover {
  background: var(--green-dark);
  color: #fff;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--black);
  border-top: none;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--neutral-04);
}

.site-footer strong {
  color: var(--white);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--white);
  border-radius: 8px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  text-align: center;
}

.modal-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.modal h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  color: var(--black);
}

.modal p {
  font-size: 0.875rem;
  color: var(--neutral-06);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.modal .btn-primary {
  width: 100%;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .plans-grid { flex-direction: column; }
  main        { padding: 2rem 1rem 4rem; }
  h1          { font-size: 2rem; line-height: 2.5rem; }
  .equipment-row { align-items: flex-start; flex-direction: column; }
  .details-grid { grid-template-columns: 1fr; }
  .addon-total { text-align: left; }
}
