/* BC Subscriptions frontend — signup + portal
   Brand: navy #0E2647, yellow #FFC72C, electric blue #206bd0 */

#bc-subs-root, #bc-subs-portal {
    --bc-navy: #0E2647;
    --bc-navy-2: #081e49;
    --bc-yellow: #FFC72C;
    --bc-blue: #206bd0;
    --bc-red: #b91c1c;
    --bc-border: #e5e7eb;
    --bc-muted: #6b7280;
    --bc-bg: #f9fafb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #111827;
    line-height: 1.5;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

#bc-subs-root h2, #bc-subs-portal h2, #bc-subs-portal h3 {
    color: var(--bc-navy);
    margin-top: 0;
}

/* Steps indicator */
.bc-subs-steps {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    flex-wrap: wrap;
}
.bc-subs-steps li {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    background: var(--bc-bg);
    border: 1px solid var(--bc-border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bc-muted);
    text-align: center;
}
.bc-subs-steps li.active { background: var(--bc-navy); color: #fff; border-color: var(--bc-navy); }
.bc-subs-steps li.done   { background: #d1fae5; color: #065f46; border-color: #10b981; }

/* Messages */
.bc-subs-msg {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #78350f;
}
.bc-subs-msg-info { background: #dbeafe; border-color: #60a5fa; color: #1e3a8a; }
.bc-subs-msg-error { background: #fee2e2; border-color: #f87171; color: #991b1b; }
.bc-subs-msg-success { background: #d1fae5; border-color: #10b981; color: #065f46; }

/* Plans grid */
.bc-subs-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0; }
.bc-subs-plan {
    border: 2px solid var(--bc-border);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s ease;
}
.bc-subs-plan:hover { border-color: var(--bc-blue); }
.bc-subs-plan.selected { border-color: var(--bc-navy); box-shadow: 0 0 0 4px rgba(14,38,71,0.08); }
.bc-subs-plan h3 { margin: 0 0 6px 0; font-size: 18px; }
.bc-subs-plan .bc-price { font-size: 28px; font-weight: 800; color: var(--bc-navy); margin: 8px 0; }
.bc-subs-plan .bc-price small { font-size: 13px; font-weight: 500; color: var(--bc-muted); }
.bc-subs-plan ul { padding-left: 18px; margin: 12px 0 0 0; font-size: 14px; }
.bc-subs-plan ul li { margin: 4px 0; }
.bc-subs-plan .bc-plan-desc { color: var(--bc-muted); font-size: 14px; margin: 0 0 8px 0; }

/* Forms */
.bc-subs-field { display: block; margin: 12px 0; }
.bc-subs-field label { display: block; font-weight: 600; font-size: 13px; color: var(--bc-navy); margin-bottom: 4px; }
.bc-subs-field input[type=text],
.bc-subs-field input[type=email],
.bc-subs-field input[type=tel],
.bc-subs-field input[type=number],
.bc-subs-field input[type=date],
.bc-subs-field input[type=password],
.bc-subs-field select,
.bc-subs-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bc-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}
.bc-subs-field input:focus,
.bc-subs-field select:focus,
.bc-subs-field textarea:focus { outline: none; border-color: var(--bc-blue); box-shadow: 0 0 0 3px rgba(32,107,208,0.15); }

.bc-subs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.bc-subs-coupon-row { display: flex; gap: 8px; }
.bc-subs-coupon-row input { flex: 1; }

/* Vehicle mode radios */
.bc-subs-vehicle-mode { display: flex; gap: 24px; margin: 16px 0; }
.bc-subs-vehicle-mode label { font-weight: 600; color: var(--bc-navy); cursor: pointer; }

/* CSV preview */
.bc-subs-csv-preview { border: 1px solid var(--bc-border); border-radius: 6px; padding: 12px; margin-top: 12px; max-height: 300px; overflow: auto; background: var(--bc-bg); font-size: 13px; }
.bc-subs-csv-preview table { width: 100%; border-collapse: collapse; }
.bc-subs-csv-preview th, .bc-subs-csv-preview td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--bc-border); }

/* Buttons */
.bc-subs-btn {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid var(--bc-border);
    border-radius: 6px;
    background: #fff;
    color: var(--bc-navy);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.15s ease;
}
.bc-subs-btn:hover { background: var(--bc-bg); }
.bc-subs-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bc-subs-btn-primary { background: var(--bc-navy); border-color: var(--bc-navy); color: #fff; }
.bc-subs-btn-primary:hover { background: var(--bc-navy-2); }
.bc-subs-btn-danger { background: #fff; border-color: var(--bc-red); color: var(--bc-red); }
.bc-subs-btn-danger:hover { background: #fee2e2; }

.bc-subs-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Summary box */
.bc-subs-summary {
    background: var(--bc-bg);
    border: 1px solid var(--bc-border);
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    font-size: 14px;
}
.bc-subs-summary .bc-total { font-size: 20px; font-weight: 800; color: var(--bc-navy); }

/* Done step — primary CTA row */
.bc-subs-done-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0 20px;
}
.bc-subs-done-actions .bc-subs-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bc-subs-done-footer {
    font-size: 13px;
    color: var(--bc-muted);
    margin: 20px 0 0;
}
.bc-subs-done-footer a { color: var(--bc-navy); font-weight: 600; }

.bc-subs-card-input { padding: 12px; border: 1px solid var(--bc-border); border-radius: 6px; background: #fff; }
.bc-subs-error { color: var(--bc-red); font-size: 13px; margin: 8px 0; }
.bc-subs-tc-ack {
    font-size: 12.5px;
    color: var(--bc-muted);
    background: var(--bc-bg);
    border: 1px solid var(--bc-border);
    border-radius: 6px;
    padding: 12px 14px;
    margin: 16px 0 0;
    line-height: 1.5;
}
.bc-subs-plan { position: relative; }
.bc-plan-sale-badge {
    position: absolute;
    top: -10px;
    left: 12px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(220,38,38,0.35);
}
.bc-price-was {
    color: #9ca3af;
    text-decoration: line-through;
    text-decoration-color: #dc2626;
    text-decoration-thickness: 2px;
    font-weight: 500;
    margin-right: 6px;
}
.bc-subs-plan-onsale .bc-price { color: #dc2626; }

/* Portal */
.bc-portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 16px 0; }

.bc-portal-vehicle-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.bc-portal-vehicle-toolbar input[type=search] { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--bc-border); border-radius: 6px; }

.bc-portal-vtable { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.bc-portal-vtable th, .bc-portal-vtable td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--bc-border); }
.bc-portal-vtable th { background: var(--bc-bg); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--bc-muted); }
.bc-portal-vtable tbody tr:hover { background: var(--bc-bg); }

/* Charity invite banner on signup */
.bc-subs-invite-banner {
    background: linear-gradient( 135deg, var(--bc-navy), var(--bc-blue) );
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(14,38,71,0.15);
    border-left: 4px solid var(--bc-yellow);
}
.bc-subs-invite-banner strong { color: var(--bc-yellow); }

/* Volunteer coupons table (charity portal) */
#bc-charity-panel code {
    background: var(--bc-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: var(--bc-navy);
}
#bc-invite-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    background: var(--bc-bg);
}

/* Modals */
.bc-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99999; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.bc-modal[hidden] { display: none; }
.bc-modal-panel { background: #fff; border-radius: 10px; padding: 24px; max-width: 640px; width: 100%; position: relative; margin-top: 40px; }
.bc-modal-large { max-width: 900px; }
.bc-modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--bc-muted); }
.bc-modal-close:hover { color: var(--bc-navy); }

.bc-subs-portal-guard { padding: 40px 16px; text-align: center; }

/* Small screens */
@media (max-width: 640px) {
    .bc-subs-steps li { min-width: 0; padding: 8px 6px; font-size: 11px; }
    .bc-subs-actions { flex-direction: column-reverse; }
    .bc-subs-actions .bc-subs-btn { width: 100%; }
}

/* ── Step 1: Account (sign in / create) ───────────────────────────────── */
.bc-subs-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 28px;
}
.bc-subs-auth-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 16px 18px;
    background: #fff;
    border: 2px solid var(--bc-border);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.bc-subs-auth-tab:hover {
    border-color: var(--bc-blue);
    box-shadow: 0 2px 8px rgba(32,107,208,0.10);
}
.bc-subs-auth-tab.active {
    border-color: var(--bc-navy);
    background: #f8fafc;
    box-shadow: 0 2px 10px rgba(14,38,71,0.10);
}
/* Radio affordance so it reads as a choice, not a heading */
.bc-subs-auth-tab-radio {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    position: relative;
    transition: border-color .15s;
}
.bc-subs-auth-tab.active .bc-subs-auth-tab-radio { border-color: var(--bc-navy); }
.bc-subs-auth-tab.active .bc-subs-auth-tab-radio::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--bc-yellow);
}
.bc-subs-auth-tab-text { display: block; }
.bc-subs-auth-tab-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--bc-navy);
    line-height: 1.3;
}
.bc-subs-auth-tab-text small {
    display: block;
    font-size: 12.5px;
    color: var(--bc-muted);
    margin-top: 2px;
    line-height: 1.3;
}
@media (max-width: 560px) {
    .bc-subs-auth-tabs { grid-template-columns: 1fr; gap: 10px; }
    .bc-subs-auth-tab { padding: 14px 16px; }
}

/* Inline "account exists" prompt under the email field */
.bc-subs-account-exists {
    background: #fffbeb;
    border: 2px solid var(--bc-yellow);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 4px 0 20px;
}
.bc-subs-account-exists p { margin: 0 0 6px; font-size: 14px; color: #78350f; line-height: 1.5; }
.bc-subs-account-exists p:last-of-type { margin-bottom: 12px; }
.bc-subs-account-exists strong { color: #0E2647; }

.bc-subs-loggedin-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 0 20px;
}
.bc-subs-step-intro {
    color: var(--bc-muted);
    font-size: 14px;
    margin: -6px 0 20px;
}

/* ── Step 2: Vehicles ─────────────────────────────────────────────────── */
.bc-subs-covered-card {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0 0 20px;
}
.bc-subs-covered-title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #166534;
}
.bc-subs-covered-card ul { margin: 0; padding-left: 18px; }
.bc-subs-covered-card li { font-size: 14px; color: #14532d; margin: 3px 0; }
.bc-subs-covered-card li span { color: #4b5563; font-size: 12px; }
.bc-subs-covered-note { margin: 8px 0 0; font-size: 12px; color: #4b5563; }

.bc-subs-inline-msg {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    min-height: 15px;
    color: var(--bc-muted);
}
.bc-subs-inline-msg.is-error { color: var(--bc-red); font-weight: 600; }

.bc-subs-vehicle-list {
    background: #fff;
    border: 1px solid var(--bc-border);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 20px 0;
}
.bc-subs-vehicle-list-title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--bc-navy);
}
.bc-subs-vehicle-list ul { list-style: none; margin: 0; padding: 0; }
.bc-subs-vehicle-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bc-border);
    font-size: 14px;
}
.bc-subs-vehicle-list li:last-child { border-bottom: none; }
.bc-subs-vehicle-list li a { color: var(--bc-red); font-size: 13px; text-decoration: underline; }

.bc-subs-summary .bc-subs-remove-coupon {
    color: var(--bc-red);
    text-decoration: underline;
    margin-left: 6px;
    font-size: 13px;
}

/* ── Password reveal toggle ───────────────────────────────────────────── */
.bc-subs-pw-wrap { display: block; position: relative; }
.bc-subs-pw-wrap input[type=password],
.bc-subs-pw-wrap input[type=text] { padding-right: 46px; }
.bc-subs-pw-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bc-muted);
    transition: color .15s, background .15s;
}
.bc-subs-pw-toggle:hover { color: var(--bc-navy); background: rgba(14,38,71,0.06); }
.bc-subs-pw-toggle::before {
    content: "";
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center;  mask-position: center;
    -webkit-mask-size: contain;     mask-size: contain;
    /* Eye */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.bc-subs-pw-toggle.is-visible { color: var(--bc-navy); }
.bc-subs-pw-toggle.is-visible::before {
    /* Eye with slash */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-10-8-10-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 10 8 10 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='2' y1='2' x2='22' y2='22'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-10-8-10-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 10 8 10 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='2' y1='2' x2='22' y2='22'/%3E%3C/svg%3E");
}

/* Strikethrough + saving pill in the order summary */
.bc-subs-summary .bc-was {
    text-decoration: line-through;
    text-decoration-color: var(--bc-red);
    text-decoration-thickness: 2px;
    color: var(--bc-muted);
    margin-right: 4px;
}
.bc-subs-summary .bc-save-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 9px;
    background: #dcfce7;
    color: #166534;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Membership number, portal */
.bc-portal-member-no {
    background: var(--bc-navy);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 14px;
}
.bc-portal-member-no span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: var(--bc-yellow);
}
.bc-portal-member-no strong {
    display: block;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    margin: 2px 0;
}
.bc-portal-member-no small {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}
.bc-portal-member-no .bc-portal-card-link {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 14px;
    background: var(--bc-yellow);
    color: var(--bc-navy);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

/* Signup plan cards: monthly headline, annual total beneath */
.bc-price-billed {
    margin-top: 5px;
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    letter-spacing: 0.2px;
}
.bc-price-rrp-line {
    margin-bottom: 2px;
    font-size: 13px;
}
.bc-price-rrp-line .bc-price-was {
    text-decoration: line-through;
    text-decoration-color: var(--bc-red);
    color: var(--bc-muted);
}
.bc-price small { line-height: 1.25; }

/* Competition bonus entries on the signup confirmation. Rendered only when
   the BC Competition plugin put them in the response. */
.bc-subs-comp-bonus {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 18px 0;
    padding: 18px 20px;
    background: var(--bc-navy);
    border-radius: 10px;
    text-align: center;
}
.bc-subs-comp-bonus-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
}
.bc-subs-comp-bonus-count {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--bc-yellow);
}
.bc-subs-comp-bonus-sub {
    font-size: 14px;
    color: rgba(255,255,255,.8);
}

/* ── Vehicle count ───────────────────────────────────────────────────────
   The count sits on the plan screen because it is what the price is built
   from: vehicles are described after payment now, so this number is the
   only thing on screen that changes the total. Big tap targets because on
   a phone this is the one control between a customer and a charge. */
.bc-subs-count-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.bc-subs-count-row input[type="number"] {
    width: 86px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    padding: 10px 6px;
    -moz-appearance: textfield;
}
.bc-subs-count-row input[type="number"]::-webkit-outer-spin-button,
.bc-subs-count-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.bc-subs-count-btn {
    min-width: 48px;
    min-height: 48px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bc-subs-count small { display: block; margin-top: 6px; }
.bc-subs-inline-ok { color: #10894a; }
