/* ============================================================
   British Gas — main.css
   Corporate blue energy theme, UK context
   ============================================================ */

:root {
    --bg-navy: #002F87;
    --bg-cyan: #0093F5;
    --bg-lime: #7FCC00;
    --bg-lime-logo: #80BC00;
    --hd-teal: #0093F5;
    --hd-teal-dark: #007ACC;
    --hd-teal-light: #E6F4FE;
    --hd-teal-tint: #F0F9FF;
    --hd-ink: #002F87;
    --hd-green: #7FCC00;
    --hd-red: #E30613;
    --hd-amber: #F59E0B;
    --hd-text: #3D4D5C;
    --hd-muted: #7A8A99;
    --hd-line: #E3E9ED;
    --hd-bg: #F4F7F8;
    --hd-card: #FFFFFF;
    --hd-shadow: 0 2px 12px rgba(52, 58, 72, 0.06);
    --hd-shadow-lg: 0 8px 28px rgba(52, 58, 72, 0.10);
    --hd-radius: 14px;
    --hd-radius-sm: 10px;
    --hd-radius-pill: 999px;
    --hd-font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --hd-max: 480px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--hd-font);
    color: var(--hd-text);
    background: var(--hd-bg);
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--hd-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--hd-teal); color: #fff;
    padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* HERO — white header like britishgas.co.uk */
.hd-hero {
    background: #fff;
    border-bottom: 1px solid var(--hd-line);
    position: sticky; top: 0; z-index: 20;
}
body.hd-flow .hd-hero { box-shadow: 0 1px 0 rgba(0, 47, 135, 0.06); }
.hd-hero-bar {
    max-width: var(--hd-max); margin: 0 auto;
    padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
}
.hd-hero-logo {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 20px; letter-spacing: -0.5px;
}
.hd-hero-logo img {
    height: 32px; width: auto; display: block;
}
.hd-logo-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--hd-teal); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px;
}
.hd-logo-text { color: var(--hd-ink); }
.hd-logo-text span { color: var(--hd-teal); }
.hd-menu-btn {
    background: none; border: 1px solid var(--hd-line);
    border-radius: var(--hd-radius-sm);
    width: 38px; height: 38px; cursor: pointer;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.hd-menu-btn span { width: 16px; height: 2px; background: var(--hd-ink); border-radius: 2px; }

/* FLOW LAYOUT */
body.hd-flow { background: var(--hd-bg); }
.hd-flow-page { flex: 1; width: 100%; max-width: var(--hd-max); margin: 0 auto; padding: 0 16px 40px; }
.hd-body { padding: 20px 0 8px; }

/* STEPPER */
.hd-stepper { max-width: var(--hd-max); margin: 0 auto; padding: 16px 18px 8px; display: flex; align-items: center; gap: 6px; }
.hd-stepper-track { display: flex; align-items: center; width: 100%; gap: 4px; }
.hd-step { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 6px; position: relative; }
.hd-step::before { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--hd-line); z-index: 0; }
.hd-step:first-child::before { display: none; }
.hd-step-num { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--hd-line); color: var(--hd-muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; position: relative; z-index: 1; }
.hd-step-label { font-size: 10px; color: var(--hd-muted); font-weight: 600; text-align: center; line-height: 1.2; }
.hd-step-done .hd-step-num { background: var(--bg-navy); border-color: var(--bg-navy); color: #fff; }
.hd-step-done::before { background: var(--bg-navy); }
.hd-step-done .hd-step-label { color: var(--bg-navy); }
.hd-step-active .hd-step-num { background: #fff; border-color: var(--bg-cyan); color: var(--bg-cyan); box-shadow: 0 0 0 4px var(--hd-teal-light); }
.hd-step-active .hd-step-label { color: var(--bg-navy); font-weight: 700; }

/* CARDS */
.hd-card { background: var(--hd-card); border-radius: var(--hd-radius); box-shadow: var(--hd-shadow); padding: 20px; margin-bottom: 14px; border: 1px solid var(--hd-line); }
.hd-card-title { font-size: 19px; font-weight: 700; color: var(--hd-ink); margin-bottom: 8px; letter-spacing: -0.3px; }
.hd-card-title-sm { font-size: 16px; }
.hd-card-text { font-size: 14px; color: var(--hd-text); line-height: 1.55; }
.hd-tracking-line { font-size: 13px; color: var(--hd-muted); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--hd-line); }
.hd-tracking-line strong { color: var(--hd-teal-dark); font-weight: 700; letter-spacing: 0.5px; font-family: 'Courier New', monospace; }

/* APPOINTMENT CARD */
.hd-apt-card { display: flex; gap: 14px; align-items: flex-start; }
.hd-apt-icon { flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px; background: var(--hd-teal-light); display: flex; align-items: center; justify-content: center; color: var(--bg-navy); }
.hd-apt-icon svg { width: 26px; height: 26px; }
.hd-apt-meta { font-size: 13px; color: var(--hd-muted); margin-top: 4px; }
.hd-apt-meta strong { color: var(--hd-ink); }

/* FEE BREAKDOWN */
.hd-card-fees .hd-service-line { font-size: 13px; color: var(--hd-muted); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--hd-line); }
.hd-card-fees .hd-service-line strong { color: var(--hd-ink); }
.hd-fee-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hd-fee-table td { padding: 9px 0; color: var(--hd-text); border-bottom: 1px solid var(--hd-line); }
.hd-fee-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--hd-ink); font-weight: 600; }
.hd-fee-total td { border-bottom: none; border-top: 2px solid var(--hd-ink); padding-top: 14px; font-size: 16px; font-weight: 700; color: var(--hd-ink) !important; }
.hd-fee-total td:last-child { color: var(--bg-navy) !important; }

/* SUMMARY CARD */
.hd-summary-card { padding: 16px 20px; }
.hd-summary-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hd-summary-table td { padding: 8px 0; color: var(--hd-text); border-bottom: 1px solid var(--hd-line); }
.hd-summary-table tr:last-child td { border-bottom: none; }
.hd-summary-table td:last-child { text-align: right; color: var(--hd-ink); font-weight: 600; }
.hd-amount-highlight { color: var(--bg-navy) !important; font-size: 16px !important; }
.hd-summary-table .tracking-code { font-family: 'Courier New', monospace; letter-spacing: 0.5px; color: var(--hd-teal-dark); }
.hd-status-badge { display: inline-block; background: #FFF4E5; color: #B45309; padding: 3px 10px; border-radius: var(--hd-radius-pill); font-size: 12px; font-weight: 700; }

/* BUTTONS */
.hd-btn-primary { display: block; width: 100%; max-width: var(--hd-max); margin: 16px auto 0; padding: 16px 20px; background: var(--hd-teal); color: #fff; border: none; border-radius: var(--hd-radius-pill); font-size: 16px; font-weight: 700; font-family: var(--hd-font); cursor: pointer; text-align: center; text-decoration: none; transition: background 0.15s, transform 0.05s; box-shadow: 0 4px 14px rgba(0, 147, 245, 0.28); }
.hd-btn-primary:hover { background: var(--hd-teal-dark); text-decoration: none; }
.hd-btn-primary:active { transform: scale(0.99); }
.hd-btn-primary:disabled { background: var(--hd-muted); box-shadow: none; cursor: not-allowed; }
.hd-btn-secondary { display: inline-block; padding: 10px 18px; background: #fff; color: var(--hd-teal); border: 1.5px solid var(--hd-teal); border-radius: var(--hd-radius-pill); font-size: 14px; font-weight: 600; font-family: var(--hd-font); cursor: pointer; text-decoration: none; }
.hd-btn-secondary:disabled { color: var(--hd-muted); border-color: var(--hd-line); cursor: not-allowed; }
.hd-btn-outline { display: block; width: 100%; max-width: var(--hd-max); margin: 10px auto 0; padding: 14px 20px; background: #fff; color: var(--hd-text); border: 1.5px solid var(--hd-line); border-radius: var(--hd-radius-pill); font-size: 15px; font-weight: 600; font-family: var(--hd-font); cursor: pointer; text-align: center; text-decoration: none; }
.hd-btn-outline:hover { border-color: var(--hd-teal); color: var(--hd-teal); text-decoration: none; }
.hd-cancel-link { display: block; text-align: center; margin-top: 14px; color: var(--hd-muted); font-size: 14px; font-weight: 600; }
.hd-cancel-link:hover { color: var(--hd-red); text-decoration: none; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--hd-ink); margin-bottom: 6px; }
.input-text, .input-card { width: 100%; padding: 14px 14px; border: 1.5px solid var(--hd-line); border-radius: var(--hd-radius-sm); font-size: 16px; font-family: var(--hd-font); color: var(--hd-ink); background: #fff; transition: border 0.15s, box-shadow 0.15s; -webkit-appearance: none; }
.input-text:focus, .input-card:focus { outline: none; border-color: var(--hd-teal); box-shadow: 0 0 0 3px var(--hd-teal-light); }
.input-text::placeholder, .input-card::placeholder { color: #B8C5CC; }
.input-text[aria-invalid="true"], .input-card[aria-invalid="true"] { border-color: var(--hd-red); box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.08); }
.input-with-icon { position: relative; }
.input-with-icon .card-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; pointer-events: none; }
.input-with-icon .input-card { padding-right: 48px; }
.expiry-cvv-row { display: flex; gap: 12px; }
.expiry-cvv-row .form-group { flex: 1; }
.error-text { font-size: 12px; color: var(--hd-red); margin-top: 5px; min-height: 14px; font-weight: 600; }

/* ALERTS */
.hd-alert { padding: 12px 16px; border-radius: var(--hd-radius-sm); font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.hd-alert-error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.hd-note { font-size: 13px; color: var(--hd-muted); text-align: center; margin: 14px 18px; line-height: 1.5; }
.hd-note-success { color: var(--hd-green); font-weight: 600; }
.hd-redirect-note { text-align: center; font-size: 13px; color: var(--hd-muted); margin: 12px 0; }
.hd-redirect-note strong { color: var(--hd-teal); }

/* PAYMENT METHOD */
.hd-pay-method { display: flex; align-items: center; gap: 14px; padding: 18px; }
.hd-pay-method-inner { display: flex; align-items: center; gap: 14px; width: 100%; }
.hd-pay-check { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.is-selected { border-color: var(--bg-cyan); background: var(--hd-teal-tint); }

/* TERMS */
.hd-terms-card { padding: 16px 18px; }
.hd-terms-label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13px; color: var(--hd-text); line-height: 1.5; }
.hd-terms-label input[type="checkbox"] { margin-top: 2px; accent-color: var(--hd-teal); width: 18px; height: 18px; flex-shrink: 0; }
.hd-terms-label a { color: var(--hd-teal); font-weight: 600; }

/* LOADING */
.hd-loading-card { text-align: center; }
.hd-spinner { width: 44px; height: 44px; border: 4px solid var(--hd-teal-light); border-top-color: var(--hd-teal); border-radius: 50%; margin: 0 auto 18px; animation: hd-spin 0.8s linear infinite; }
@keyframes hd-spin { to { transform: rotate(360deg); } }
.hd-checklist { list-style: none; text-align: left; margin: 16px 0 0; padding: 0; }
.hd-check-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14px; color: var(--hd-muted); border-bottom: 1px solid var(--hd-line); }
.hd-check-item:last-child { border-bottom: none; }
.hd-check-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--hd-line); color: var(--hd-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.hd-check-item.active { color: var(--hd-teal-dark); font-weight: 600; }
.hd-check-item.active .hd-check-icon { background: var(--hd-teal-light); color: var(--hd-teal); }
.hd-check-item.completed { color: var(--hd-green); }
.hd-check-item.completed .hd-check-icon { background: var(--hd-green); color: #fff; }
.hd-loading-note { font-size: 13px; color: var(--hd-amber); margin-top: 16px; font-weight: 600; }

/* OTP */
.hd-otp-form { text-align: center; padding: 16px 18px; }
.hd-otp-form .form-group { margin-bottom: 10px; }
.otp-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
}
.otp-field label {
    width: 100%;
    text-align: center;
    margin-bottom: 6px;
    font-size: 12px;
}
.otp-input-single {
    width: 190px;
    max-width: 100%;
    text-align: center;
    letter-spacing: 0.14em;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 12px;
    font-family: ui-monospace, 'Courier New', monospace;
}
.otp-input-single::placeholder {
    letter-spacing: 0.08em;
    font-size: 14px;
    font-weight: 400;
}
.hd-otp-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
}
.hd-otp-form .hd-btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
}
.hd-otp-form .hd-btn-primary {
    margin-top: 0;
    padding: 14px 18px;
    font-size: 15px;
}
.hd-otp-resend { color: var(--hd-muted); }
.hd-otp-resend strong { color: var(--hd-teal); }
.otp-form-error { margin-bottom: 10px; font-size: 13px; padding: 10px 12px; }

/* RESULT */
.hd-result-card { text-align: center; padding: 28px 20px; }
.hd-result-icon { width: 72px; height: 72px; margin: 0 auto 14px; }
.hd-result-icon svg { width: 100%; height: 100%; }
.hd-result-success .hd-card-title { color: var(--hd-green); }
.hd-result-fail .hd-card-title { color: var(--hd-red); }

/* VBV / OTP / App auth header — compact horizontal strip */
.hd-vbv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    text-align: left;
}
.hd-bank-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
}
.hd-bank-logos .hd-bank-chip {
    background: #fff;
    border: 1px solid var(--hd-line);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 600;
    color: var(--hd-ink);
    line-height: 1.3;
    white-space: nowrap;
}
.hd-card-brand-wrap { display: flex; justify-content: center; align-items: center; margin-top: 0; flex-shrink: 0; }
.hd-card-brand { height: 22px; width: auto; display: block; }
.hd-vbv-timer { text-align: center; font-size: 14px; color: var(--hd-amber); font-weight: 700; margin: 14px 0; }
.hd-vbv-timer strong { color: var(--hd-red); }

/* FOOTER */
.hd-footer { text-align: center; padding: 24px 18px 28px; font-size: 12px; color: var(--hd-muted); border-top: 1px solid var(--hd-line); background: #fff; line-height: 1.55; }
.hd-footer-secure { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--bg-navy); font-weight: 600; }
.hd-footer-secure svg { width: 14px; height: 14px; color: var(--bg-navy); }
.hd-footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-bottom: 12px; font-size: 12px; font-weight: 600; }
.hd-footer-links a { color: var(--bg-navy); text-decoration: none; }
.hd-footer-links a:hover { color: var(--bg-cyan); text-decoration: underline; }
.hd-footer-sep { color: var(--hd-muted); }
.hd-footer-copy { margin: 0 0 8px; font-weight: 700; color: var(--bg-navy); font-size: 12px; }
.hd-footer-legal { margin: 0 0 6px; max-width: 420px; margin-left: auto; margin-right: auto; font-size: 11px; line-height: 1.45; }
.hd-footer-legal:last-child { margin-bottom: 0; }

@media (max-width: 520px) {
    .hd-step-label { display: none; }
}
