/* ============================================================
   HTG Broadband Checker Styles
   src/assets/css/broadband-checker.css
   Palette: cyan #00AEEF, navy #002F6C, orange #F47920, grey #63666A
   ============================================================ */

/* ── Root variables ──────────────────────────────────────────── */
:root {
  --htg-cyan: #00AEEF;
  --htg-cyan-dark: #0090c5;
  --htg-cyan-light: #e6f6fd;
  --htg-navy: #002F6C;
  --htg-navy-light: #e8edf5;
  --htg-orange: #F47920;
  --htg-orange-light: #fef3ea;
  --htg-grey: #63666A;
  --htg-grey-light: #f5f5f5;
  --htg-white: #ffffff;
  --htg-border: #dde1e7;
  --htg-radius: 8px;
  --htg-radius-lg: 12px;
  --htg-shadow: 0 2px 8px rgba(0, 47, 108, 0.08);
  --htg-shadow-hover: 0 4px 16px rgba(0, 47, 108, 0.14);
}

/* ── Checker wrapper ─────────────────────────────────────────── */
.broadband-checker {
  font-family: 'Calibri', 'Carlito', system-ui, sans-serif;
  color: var(--htg-navy);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ── Progress bar ────────────────────────────────────────────── */
.checker-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--htg-border);
  overflow-x: auto;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--htg-grey);
  position: relative;
}

.progress-step::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--htg-border);
  margin: 0 8px;
}

.progress-step:last-child::after {
  display: none;
}

.progress-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--htg-grey-light);
  border: 1.5px solid var(--htg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--htg-grey);
  flex-shrink: 0;
  transition: all 0.2s;
}

.progress-step.current .progress-num {
  background: var(--htg-cyan);
  border-color: var(--htg-cyan);
  color: white;
}

.progress-step.current .progress-label {
  color: var(--htg-navy);
  font-weight: 600;
}

.progress-step.done .progress-num {
  background: var(--htg-navy);
  border-color: var(--htg-navy);
  color: white;
}

.progress-step.done .progress-num::after {
  content: '✓';
  font-size: 0.7rem;
}

.progress-step.done .progress-num .num-text {
  display: none;
}

/* ── Steps ───────────────────────────────────────────────────── */
[data-step] {
  display: none;
}

[data-step].active {
  display: block;
}

.checker-step-header {
  margin-bottom: 1.5rem;
}

.checker-step-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--htg-navy);
  margin: 0 0 0.4rem;
}

.checker-step-header p {
  color: var(--htg-grey);
  margin: 0;
  font-size: 0.95rem;
}

/* ── Postcode input ──────────────────────────────────────────── */
.postcode-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 480px;
}

.postcode-input-wrap {
  flex: 1;
  min-width: 160px;
}

.postcode-input-wrap input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--htg-border);
  border-radius: var(--htg-radius);
  padding: 0 1rem;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--htg-navy);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.postcode-input-wrap input:focus {
  border-color: var(--htg-cyan);
}

.postcode-input-wrap input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  color: #aaa;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 1.5rem;
  height: 48px;
  border-radius: var(--htg-radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--htg-cyan);
  color: white;
}

.btn--primary:hover {
  background: var(--htg-cyan-dark);
}

.btn--primary:active {
  transform: scale(0.98);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--secondary {
  background: transparent;
  color: var(--htg-navy);
  border: 1.5px solid var(--htg-border);
}

.btn--secondary:hover {
  border-color: var(--htg-navy);
  background: var(--htg-navy-light);
}

.btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Errors ──────────────────────────────────────────────────── */
.checker-error {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--htg-radius);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.checker-muted {
  color: var(--htg-grey);
  font-size: 0.9rem;
}

/* ── Address list ────────────────────────────────────────────── */
.address-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 1.25rem;
}

.address-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--htg-border);
  border-radius: var(--htg-radius);
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

.address-option:hover {
  border-color: var(--htg-cyan);
  background: var(--htg-cyan-light);
}

.address-option input[type="radio"] {
  accent-color: var(--htg-cyan);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.address-option:has(input:checked) {
  border-color: var(--htg-cyan);
  background: var(--htg-cyan-light);
}

.address-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--htg-navy);
}

.address-label .ti {
  color: var(--htg-grey);
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Product grid ────────────────────────────────────────────── */
.products-address-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--htg-grey);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 1.5rem;
}

.product-card {
  background: white;
  border: 1.5px solid var(--htg-border);
  border-radius: var(--htg-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  box-shadow: var(--htg-shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.product-card:hover {
  box-shadow: var(--htg-shadow-hover);
}

.product-card--featured {
  border-color: var(--htg-cyan);
  border-width: 2px;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  background: var(--htg-cyan);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 20px;
  align-self: flex-start;
}

.product-tech {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--htg-cyan-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--htg-navy);
  margin: 0;
  line-height: 1.3;
}

.product-speeds {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speed-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-stat .ti {
  width: 28px;
  height: 28px;
  background: var(--htg-navy-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--htg-navy);
  flex-shrink: 0;
}

.speed-label {
  display: block;
  font-size: 0.73rem;
  color: var(--htg-grey);
}

.speed-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--htg-navy);
  line-height: 1.1;
}

.product-pricing {
  border-top: 1px solid var(--htg-border);
  padding-top: 12px;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.price-amount {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--htg-navy);
  line-height: 1;
}

.price-amount--enquire {
  font-size: 1.3rem;
}

.price-period {
  font-size: 0.9rem;
  color: var(--htg-grey);
}

.price-setup, .price-contract {
  font-size: 0.78rem;
  color: var(--htg-grey);
  margin-top: 2px;
}

.product-ofcom {
  display: flex;
  gap: 8px;
  background: var(--htg-grey-light);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  color: var(--htg-grey);
  line-height: 1.4;
}

.product-ofcom .ti {
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

.product-ofcom a {
  color: var(--htg-cyan-dark);
}

.product-select-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

/* ── Contact form ────────────────────────────────────────────── */
.checker-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 640px;
}

.checker-form .field-full {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--htg-navy);
}

.form-field label .required {
  color: #b91c1c;
  margin-left: 2px;
}

.form-field input,
.form-field textarea {
  height: 42px;
  border: 1.5px solid var(--htg-border);
  border-radius: var(--htg-radius);
  padding: 0 0.875rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--htg-navy);
  outline: none;
  transition: border-color 0.2s;
  background: white;
  box-sizing: border-box;
  width: 100%;
}

.form-field textarea {
  height: 80px;
  padding: 0.5rem 0.875rem;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--htg-cyan);
}

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  grid-column: 1 / -1;
  background: var(--htg-navy-light);
  padding: 0.875rem 1rem;
  border-radius: var(--htg-radius);
}

.consent-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--htg-cyan);
  flex-shrink: 0;
  margin-top: 2px;
}

.consent-field label {
  font-size: 0.82rem;
  color: var(--htg-grey);
  line-height: 1.5;
}

.consent-field a {
  color: var(--htg-cyan-dark);
}

/* ── Selected product summary ────────────────────────────────── */
.selected-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--htg-navy);
  color: white;
  border-radius: var(--htg-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.selected-summary__product {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.selected-summary__product .product-tech {
  color: var(--htg-cyan);
}

.selected-summary__product strong {
  font-size: 1rem;
  color: white;
}

.selected-summary__product .muted {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}

.selected-summary__price {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  white-space: nowrap;
}

.selected-summary__price small {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
}

/* ── Confirmation ────────────────────────────────────────────── */
.confirmation-card {
  background: white;
  border: 1.5px solid var(--htg-border);
  border-radius: var(--htg-radius-lg);
  padding: 2rem;
  text-align: center;
  max-width: 520px;
}

.confirmation-icon {
  width: 56px;
  height: 56px;
  background: #d1fae5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 24px;
  color: #065f46;
}

.confirmation-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--htg-navy);
  margin: 0 0 0.5rem;
}

.confirmation-card p {
  color: var(--htg-grey);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.confirmation-ref {
  display: inline-block;
  background: var(--htg-navy-light);
  color: var(--htg-navy);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.4rem 1rem;
  border-radius: var(--htg-radius);
  margin: 1rem 0;
  letter-spacing: 0.05em;
}

.confirmation-next {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--htg-border);
  font-size: 0.85rem;
  color: var(--htg-grey);
}

/* ── Ofcom compliance note (page footer) ─────────────────────── */
.ofcom-compliance {
  margin-top: 3rem;
  padding: 1.25rem;
  background: var(--htg-grey-light);
  border-radius: var(--htg-radius);
  font-size: 0.78rem;
  color: var(--htg-grey);
  line-height: 1.6;
}

.ofcom-compliance strong {
  color: var(--htg-navy);
}

/* ── Back links ──────────────────────────────────────────────── */
.checker-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--htg-grey);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
  font-family: inherit;
  transition: color 0.15s;
}

.checker-back:hover {
  color: var(--htg-navy);
}

/* ── Term selector & dynamic pricing ────────────────────────────── */
.term-selector { margin-bottom: 4px; }

.term-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--htg-grey);
  margin-bottom: 6px;
}

.term-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.term-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1.5px solid var(--htg-border);
  border-radius: 20px;
  background: white;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--htg-navy);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.term-pill:hover { border-color: var(--htg-cyan); background: var(--htg-cyan-light); }

.term-pill--active {
  background: var(--htg-cyan);
  border-color: var(--htg-cyan);
  color: white;
  font-weight: 600;
}

.term-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--htg-cyan-dark);
  cursor: pointer;
  font-family: inherit;
  padding: 0 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.term-more-btn:hover { color: var(--htg-navy); }

.term-extra { margin-top: 6px; }

.price-display {
  margin-top: 8px;
  min-height: 2rem;
}

.price-placeholder {
  font-size: 0.82rem;
  color: var(--htg-grey);
}

.price-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--htg-grey);
}

.price-result {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.price-setup-inline {
  font-size: 0.75rem;
  color: var(--htg-grey);
  display: block;
  margin-top: 2px;
}

.spinner-dark {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,47,108,0.2);
  border-top-color: var(--htg-navy);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .checker-form {
    grid-template-columns: 1fr;
  }

  .checker-form .field-full {
    grid-column: 1;
  }

  .progress-label {
    display: none;
  }

  .selected-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .postcode-row {
    flex-direction: column;
  }

  .postcode-row .btn {
    width: 100%;
    justify-content: center;
  }
}
