/* ==========================================================================
   BDSTally Portal Styles
   Loaded only on pages containing [bdstally_portal]
   ========================================================================== */

/* ── Portal Section ─────────────────────────────────────────────────────────── */
.bds-portal-section { background: var(--bds-color-off-white); }

/* ── Neutralize page-template background behind the dark portal ─────────────── */
/* When .bds-portal-dark is on the page, set common WordPress theme content     */
/* wrappers to match the dark background so no white gap shows below the portal */
body:has(.bds-portal-dark) .entry-content,
body:has(.bds-portal-dark) .page-content,
body:has(.bds-portal-dark) .hentry,
body:has(.bds-portal-dark) .site-main,
body:has(.bds-portal-dark) main[id],
body:has(.bds-portal-dark) #content,
body:has(.bds-portal-dark) #primary,
body:has(.bds-portal-dark) .bds-portal-section {
    background: #0d1321 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.bds-portal__header { margin-bottom: var(--bds-space-xl); }
.bds-portal__welcome {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--bds-color-primary);
    margin: 0;
}

/* ── Tab Navigation ─────────────────────────────────────────────────────────── */
.bds-portal__tabs {
    display: flex;
    gap: var(--bds-space-sm);
    border-bottom: 2px solid var(--bds-color-light-gray);
    margin-bottom: var(--bds-space-xl);
    padding-bottom: 0;
}
.bds-portal__tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.6rem 1.1rem;
    margin-bottom: -2px;
    font-family: var(--bds-font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bds-color-text-muted);
    cursor: pointer;
    transition: color var(--bds-transition), border-color var(--bds-transition);
    border-radius: var(--bds-border-radius) var(--bds-border-radius) 0 0;
}
.bds-portal__tab:hover {
    color: var(--bds-color-primary);
}
.bds-portal__tab--active {
    color: var(--bds-color-accent);
    border-bottom-color: var(--bds-color-accent);
}

/* ── Panels ─────────────────────────────────────────────────────────────────── */
.bds-portal__loading {
    text-align: center;
    padding: var(--bds-space-2xl);
    color: var(--bds-color-text-muted);
    font-size: 0.95rem;
}
.bds-portal__empty {
    text-align: center;
    padding: var(--bds-space-2xl);
    color: var(--bds-color-text-muted);
    font-size: 0.95rem;
}

/* ── Lesson List ────────────────────────────────────────────────────────────── */
.bds-lesson-list {
    list-style: none;
    margin: 0 0 var(--bds-space-xl);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--bds-space-md);
}
.bds-lesson-item {
    background: var(--bds-color-white);
    border: 1.5px solid var(--bds-color-light-gray);
    border-radius: var(--bds-border-radius);
    padding: var(--bds-space-lg);
    display: flex;
    align-items: center;
    gap: var(--bds-space-lg);
    box-shadow: var(--bds-shadow-sm);
}
.bds-lesson-item__date {
    flex-shrink: 0;
    text-align: center;
    background: var(--bds-color-primary);
    color: var(--bds-color-white);
    border-radius: var(--bds-border-radius);
    padding: var(--bds-space-sm) var(--bds-space-md);
    min-width: 64px;
}
.bds-lesson-item__date-day   { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.bds-lesson-item__date-month { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.8; }
.bds-lesson-item__info       { flex: 1; }
.bds-lesson-item__time       { font-weight: 600; color: var(--bds-color-primary); font-size: 0.95rem; }
.bds-lesson-item__service    { font-size: 0.85rem; color: var(--bds-color-text-muted); margin-top: 2px; }
.bds-lesson-item__status     {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bds-lesson-item__status--approved { background: #d4edda; color: #155724; }
.bds-lesson-item__status--pending  { background: #fff3cd; color: #856404; }
.bds-lesson-item__status--canceled { background: #f8d7da; color: #721c24; }

/* ── Package List ───────────────────────────────────────────────────────────── */
.bds-package-list {
    list-style: none;
    margin: 0 0 var(--bds-space-xl);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--bds-space-lg);
}
.bds-package-item {
    background: var(--bds-color-white);
    border: 1.5px solid var(--bds-color-light-gray);
    border-radius: var(--bds-border-radius-lg);
    padding: var(--bds-space-lg);
    text-align: center;
    box-shadow: var(--bds-shadow-sm);
}
.bds-package-item__name     { font-weight: 700; color: var(--bds-color-primary); margin-bottom: var(--bds-space-sm); }
.bds-package-item__remaining {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--bds-color-accent);
    line-height: 1;
}
.bds-package-item__label    { font-size: 0.8rem; color: var(--bds-color-text-muted); margin-top: var(--bds-space-xs); }

/* ── Portal Quick Actions ───────────────────────────────────────────────────── */
.bds-portal__actions {
    display: flex;
    gap: var(--bds-space-md);
    padding-top: var(--bds-space-xl);
    border-top: 1px solid var(--bds-color-light-gray);
    margin-top: var(--bds-space-xl);
}

@media (max-width: 600px) {
    .bds-portal__actions    { flex-direction: column; }
    .bds-lesson-item        { flex-direction: column; align-items: flex-start; }
    .bds-lesson-item__date  { align-self: flex-start; }
}

/* ── Session Cards ──────────────────────────────────────────────────────────── */
.bds-sessions {
    margin-bottom: var(--bds-space-2xl);
}
.bds-sessions__package-name {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--bds-color-text-muted);
    margin: 0 0 var(--bds-space-lg);
    padding-bottom: var(--bds-space-sm);
    border-bottom: 1px solid var(--bds-color-light-gray);
}
.bds-sessions__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--bds-space-lg);
}

/* Base card */
.bds-session-card {
    background: var(--bds-color-white);
    border: 2px solid var(--bds-color-light-gray);
    border-radius: var(--bds-border-radius-lg);
    padding: var(--bds-space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--bds-space-md);
    min-height: 210px;
}

/* Booked — upcoming */
.bds-session-card--booked {
    border-color: var(--bds-color-accent);
    box-shadow: 0 0 0 1px var(--bds-color-accent), var(--bds-shadow-sm);
}
/* Booked — past/completed */
.bds-session-card--completed {
    border-color: var(--bds-color-light-gray);
    opacity: 0.7;
}
/* Unbooked — open slot */
.bds-session-card--unbooked {
    border-style: dashed;
    border-color: #adb5bd;
}
/* Locked — road test held */
.bds-session-card--locked {
    border-style: dashed;
    border-color: var(--bds-color-light-gray);
    background: var(--bds-color-off-white);
}

/* Card header row */
.bds-session-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bds-session-card__num {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bds-color-text-muted);
}

/* Status badges */
.bds-session-card__badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
}
.bds-session-card__badge--confirmed { background: #d4edda; color: #155724; }
.bds-session-card__badge--done      { background: #e9ecef; color: #495057; }
.bds-session-card__badge--open      { background: #e8f4fd; color: #0c5460; }
.bds-session-card__badge--held      { background: #fff3cd; color: #856404; }

/* Booked date display */
.bds-session-card__date {
    display: flex;
    align-items: center;
    gap: var(--bds-space-md);
    flex: 1;
}
.bds-session-card__day-num {
    font-size: 3.25rem;
    font-weight: 800;
    color: var(--bds-color-primary);
    line-height: 1;
    flex-shrink: 0;
}
.bds-session-card__month {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bds-color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bds-session-card__time {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bds-color-primary);
    margin-top: 3px;
}

/* Placeholder body (unbooked + locked) */
.bds-session-card__placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
    padding: var(--bds-space-sm) 0;
}
.bds-session-card__placeholder-icon {
    color: #ced4da;
    margin-bottom: 0.25rem;
}
.bds-session-card--locked .bds-session-card__placeholder-icon {
    color: #adb5bd;
}
.bds-session-card__placeholder-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bds-color-text-muted);
    margin: 0;
}
.bds-session-card__lock-sub {
    font-size: 0.78rem;
    color: var(--bds-color-text-muted);
    line-height: 1.55;
    margin: 0;
    opacity: 0.85;
    max-width: 200px;
}

/* Action row */
.bds-session-card__actions {
    display: flex;
    gap: var(--bds-space-sm);
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto;
}
.bds-session-card__cancel-link {
    font-size: 0.82rem;
    color: var(--bds-color-text-muted);
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
}
.bds-session-card__cancel-link:hover {
    color: #c0392b;
}

/* Small button variant */
.bds-btn--sm {
    font-size: 0.82rem;
    padding: 0.35rem 0.9rem;
}

@media (max-width: 600px) {
    .bds-sessions__grid { grid-template-columns: 1fr; }
}


/* ── Booking Confirmed Banner ─────────────────────────────────────── */
.bds-booking-confirmed-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #eafaf1;
    border: 1.5px solid #27ae60;
    border-radius: 10px;
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.75rem;
    color: #1a5c35;
}
.bds-booking-confirmed-banner__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #27ae60;
    color: #fff;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}
.bds-booking-confirmed-banner__text {
    flex: 1;
    font-size: 0.97rem;
    line-height: 1.55;
}
.bds-booking-confirmed-banner__text strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

/* ── Instant-password form (login-prompt.php, ?booked=1 path) ─────────────── */

.bds-ipr__group {
    margin-bottom: 1.1rem;
}

.bds-ipr__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #1a1a1a;
}

.bds-ipr__input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #d0d0d0;
    border-radius: 7px;
    font-size: 1rem;
    color: #1a1a1a;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bds-ipr__input:focus {
    outline: none;
    border-color: #0057e3;
    box-shadow: 0 0 0 3px rgba(0, 87, 227, .12);
}
/* Placeholder — medium gray on white/light background */
.bds-ipr__input::placeholder,
.bds-ipr__input::-webkit-input-placeholder { color: #9ca3af !important; opacity: 1 !important; }

.bds-ipr__err {
    display: block;
    color: #c0392b;
    font-size: 0.88rem;
    margin-top: 0.35rem;
    line-height: 1.4;
}

.bds-ipr__btn {
    width: 100%;
    margin-top: 0.1rem;
}

.bds-ipr__alt-link {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
    color: #555;
}

/* ── Panel visibility (tab switching) ───────────────────────────────────────── */
.bds-portal__panel          { display: none; }
.bds-portal__panel--active  { display: block; }

/* ── Portal sub-heading (under welcome name) ────────────────────────────────── */
.bds-portal__subhead {
    font-size: 0.95rem;
    color: var(--bds-color-text-muted);
    margin: 0.35rem 0 0;
    font-weight: 400;
}

/* ── Slot-selection grid (Schedule a Session tab) ───────────────────────────── */
.bds-portal__slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--bds-space-lg);
    margin-top: var(--bds-space-lg);
}

/* ── Portal buttons (bds-btn) ───────────────────────────────────────────────── */
.bds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    padding: 0.55rem 1.25rem;
    border-radius: var(--bds-border-radius);
    font-family: var(--bds-font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background var(--bds-transition), color var(--bds-transition), border-color var(--bds-transition), opacity var(--bds-transition);
    text-decoration: none;
    white-space: nowrap;
}
.bds-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.bds-btn--primary {
    background: var(--bds-color-accent);
    color: #fff;
    border-color: var(--bds-color-accent);
}
.bds-btn--primary:hover:not(:disabled) {
    background: #c0392b;
    border-color: #c0392b;
}
.bds-btn--outline {
    background: transparent;
    color: var(--bds-color-accent);
    border-color: var(--bds-color-accent);
}
.bds-btn--outline:hover:not(:disabled) {
    background: var(--bds-color-accent);
    color: #fff;
}
/* bds-btn--sm already defined above */

/* ==========================================================================
   Student Portal v2 — Dark Theme
   Scoped to .bds-portal-dark so it doesn't affect other site pages.
   ========================================================================== */

.bds-portal-dark {
    background: #0d1321;
    min-height: 60vh;
    padding: 2.25rem 1.5rem 5rem;
    font-family: var(--bds-font-sans, system-ui, -apple-system, sans-serif);
    color: #e2e8f0;
}
.bds-portal-dark__inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

/* ── Success banner ─────────────────────────────────────────────────────────── */
.bds-portal-dark__banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(34, 197, 94, .08);
    border: 1.5px solid #22c55e;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: .93rem;
    color: #86efac;
    line-height: 1.55;
}
.bds-portal-dark__banner-check {
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: .85rem;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.bds-portal-dark__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .9rem;
    padding: .25rem 0 .5rem;
}
.bds-portal-dark__avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: #22d3ee;
    color: #0d1321;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .03em;
}
.bds-portal-dark__name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    line-height: 1.2;
}
.bds-portal-dark__account-holder {
    font-size: .78rem;
    color: #64748b;
    margin: .2rem 0 0;
    font-weight: 400;
}

/* ── Info / history cards ────────────────────────────────────────────────────── */
.bds-portal-dark__card {
    background: #121c2e;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 12px;
    padding: 1.1rem 1.4rem;
}
.bds-portal-dark__card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .85rem;
}
.bds-portal-dark__card-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
}
.bds-portal-dark__action-btn {
    background: transparent;
    border: 1.5px solid #22d3ee;
    color: #22d3ee;
    padding: .3rem .85rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background .15s, color .15s;
    font-family: inherit;
    line-height: 1.4;
}
.bds-portal-dark__action-btn:hover {
    background: #22d3ee;
    color: #0d1321;
    text-decoration: none;
}

/* ── Student info grid ───────────────────────────────────────────────────────── */
.bds-portal-dark__info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .6rem 1.25rem;
}
.bds-portal-dark__info-field {
    display: flex;
    flex-direction: column;
    gap: .18rem;
}
.bds-portal-dark__info-label {
    font-size: .68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.bds-portal-dark__info-val {
    font-size: .9rem;
    color: #cbd5e1;
}

/* ── Purchase history ────────────────────────────────────────────────────────── */
.bds-portal-dark__history { display: flex; flex-direction: column; }
.bds-portal-dark__history-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .3rem 1rem;
    font-size: .87rem;
    padding: .55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.bds-portal-dark__history-row:last-child { border-bottom: none; }
.bds-portal-dark__history-date   { color: #22d3ee; font-weight: 600; flex-shrink: 0; }
.bds-portal-dark__history-pkg    { color: #e2e8f0; }
.bds-portal-dark__history-pkg strong { color: #fff; }
.bds-portal-dark__history-amount { color: #94a3b8; }
.bds-portal-dark__history-txn    { color: #334155; font-size: .75rem; font-family: 'SF Mono', 'Fira Code', monospace; }
.bds-portal-dark__empty  { color: #475569; font-size: .9rem; margin: 0; }
.bds-portal-dark__link   { color: #22d3ee; text-decoration: underline; }

/* ── Training blocks section ─────────────────────────────────────────────────── */
.bds-portal-dark__blocks-header { margin-bottom: .75rem; }
.bds-portal-dark__blocks-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin: 0;
}
.bds-portal-dark__blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}
.bds-portal-dark__no-packages {
    text-align: center;
    padding: 2rem;
}

/* ── Session card v2 (bds-pt-card) ──────────────────────────────────────────── */
.bds-pt-card {
    background: #121c2e;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 1rem 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-height: 160px;
    transition: border-color .15s, box-shadow .15s;
}
.bds-pt-card:hover {
    border-color: rgba(34, 211, 238, .35);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, .12);
}
.bds-pt-card--completed:hover {
    border-color: rgba(255, 255, 255, .08);
    box-shadow: none;
}

/* Package name — always cyan, always top */
.bds-pt-card__pkg {
    font-size: .88rem;
    font-weight: 700;
    color: #22d3ee;
    line-height: 1.3;
}
.bds-pt-card__sub {
    font-size: .78rem;
    color: #475569;
    margin-top: -.2rem;
    margin-bottom: .25rem;
}

/* ── Completed card ── */
.bds-pt-card--completed { opacity: .85; border-color: rgba(99, 102, 241, .45); box-shadow: 0 0 0 1px rgba(99, 102, 241, .12); }
.bds-pt-card__state--completed {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    border: 1.5px solid rgba(99, 102, 241, .4);
    border-radius: 8px;
    padding: .5rem .7rem;
    margin-top: auto;
    font-size: .8rem;
    color: #c4b5fd;
    background: rgba(99, 102, 241, .1);
    cursor: default;
    user-select: none;
}
.bds-pt-card__state--completed span:first-child {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #818cf8;
    letter-spacing: .06em;
}

/* ── Scheduled card ── */
.bds-pt-card__state--scheduled {
    display: block;
    border: 1.5px solid #22d3ee;
    border-radius: 8px;
    padding: .6rem .8rem;
    margin-top: auto;
    background: transparent;
    width: 100%;
}
.bds-pt-card__state-label {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    width: 100%;
}
.bds-pt-card__state-label span:first-child {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #22d3ee;
}
.bds-pt-card__state-label span:last-child {
    font-size: .92rem;
    color: #e2e8f0;
    font-weight: 600;
}
/* Edit Details — subtle full-width bar above cancel */
.bds-pt-card__edit-link {
    font-size: .73rem;
    color: #7dd3fc;
    background: none;
    border: 1px solid rgba(125, 211, 252, .25);
    border-radius: 8px;
    cursor: pointer;
    padding: .35rem .65rem;
    text-align: center;
    font-family: inherit;
    width: 100%;
    display: block;
    transition: color .15s, border-color .15s, background .15s;
}
.bds-pt-card__edit-link:hover {
    color: #bae6fd;
    border-color: rgba(125, 211, 252, .55);
    background: rgba(125, 211, 252, .06);
}

/* Cancel / Reschedule — full width bar at bottom of card */
.bds-pt-card__cancel-link {
    font-size: .75rem;
    color: #94a3b8;
    background: none;
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: 8px;
    cursor: pointer;
    padding: .4rem .65rem;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    width: 100%;
    display: block;
    transition: color .15s, border-color .15s, background .15s;
}
.bds-pt-card__cancel-link:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, .45);
    background: rgba(239, 68, 68, .06);
}

/* ── Open / unscheduled card ── */
.bds-pt-card__schedule-btn {
    border: none;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    background: #22d3ee;
    color: #0d1321;
    width: 100%;
    margin-top: auto;
    font-family: inherit;
    transition: opacity .15s, transform .1s;
    letter-spacing: .01em;
}
.bds-pt-card__schedule-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bds-portal-dark__info-grid   { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .bds-portal-dark                { padding: 1.25rem 1rem 3rem; }
    .bds-portal-dark__info-grid     { grid-template-columns: 1fr 1fr; }
    .bds-portal-dark__blocks-grid   { grid-template-columns: 1fr 1fr; }
    .bds-portal-dark__history-row   { flex-direction: column; gap: .15rem; }
}
@media (max-width: 420px) {
    .bds-portal-dark__blocks-grid   { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Portal Modals + Form Fields
   Used in slot picker, booking detail, and contact update modals.
   Scoped to portal pages only (not admin).
   ========================================================================== */

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
.bds-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
    box-sizing: border-box;
}
.bds-modal__card {
    background: #1a2540;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    padding: 1.4rem 1.6rem 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    width: 100%;
    box-sizing: border-box;
}
.bds-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.bds-modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}
.bds-modal__close {
    background: none;
    border: none;
    color: #475569;
    font-size: 1rem;
    cursor: pointer;
    padding: .2rem .45rem;
    border-radius: 5px;
    line-height: 1;
    font-family: inherit;
    transition: color .12s, background .12s;
}
.bds-modal__close:hover { color: #e2e8f0; background: rgba(255,255,255,.06); }

/* ── Form fields (booking + contact modals) ─────────────────────────────────── */
.bds-adm-field {
    margin-bottom: .85rem;
}
.bds-adm-label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: .28rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.bds-adm-input,
.bds-adm-textarea {
    width: 100%;
    background: #0d1321;
    border: 1.5px solid rgba(255, 255, 255, .1);
    border-radius: 7px;
    padding: .55rem .8rem;
    font-size: .9rem;
    color: #e2e8f0;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.bds-adm-input:focus,
.bds-adm-textarea:focus {
    outline: none;
    border-color: #22d3ee;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .1);
}
.bds-adm-textarea { resize: vertical; min-height: 64px; }
/* Placeholder — medium gray on dark portal admin inputs */
.bds-adm-input::placeholder,
.bds-adm-textarea::placeholder,
.bds-adm-input::-webkit-input-placeholder,
.bds-adm-textarea::-webkit-input-placeholder { color: #94a3b8 !important; opacity: 1 !important; }
.bds-adm-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}
.bds-adm-toggle input { cursor: pointer; }

/* ── Buttons (portal context) ───────────────────────────────────────────────── */
.bds-adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35em;
    padding: .55rem 1.1rem;
    border-radius: 7px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.bds-adm-btn:disabled { opacity: .5; cursor: not-allowed; }
.bds-adm-btn--primary {
    background: #22d3ee;
    color: #0d1321;
    border-color: #22d3ee;
}
.bds-adm-btn--primary:hover:not(:disabled) {
    background: #0ea5e9;
    border-color: #0ea5e9;
}
.bds-adm-btn--ghost {
    background: transparent;
    color: #64748b;
    border-color: rgba(255, 255, 255, .14);
}
.bds-adm-btn--ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, .05);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, .22);
}

/* ── Slot picker calendar (Schedule Now modal) ──────────────────────────────── */
#bds-portal-cal {
    --fc-border-color: rgba(255, 255, 255, .07);
    --fc-neutral-bg-color: #0d1321;
    --fc-page-bg-color: #0d1321;
    --fc-event-bg-color: #22d3ee;
    --fc-event-border-color: #22d3ee;
    --fc-event-text-color: #0d1321;
    --fc-today-bg-color: rgba(34, 211, 238, .05);
    --fc-now-indicator-color: #22d3ee;
    color: #e2e8f0;
    font-size: .85rem;
}
#bds-portal-cal .fc-toolbar-title { font-size: 1rem; color: #f1f5f9; }
#bds-portal-cal .fc-button {
    background: #1a2540 !important;
    border-color: rgba(255,255,255,.14) !important;
    color: #94a3b8 !important;
    font-size: .8rem !important;
    padding: .3rem .65rem !important;
    box-shadow: none !important;
}
#bds-portal-cal .fc-button:hover {
    background: rgba(255,255,255,.07) !important;
    color: #e2e8f0 !important;
}
#bds-portal-cal .fc-button-active {
    background: rgba(34,211,238,.12) !important;
    color: #22d3ee !important;
    border-color: rgba(34,211,238,.3) !important;
}
#bds-portal-cal .fc-col-header-cell-cushion,
#bds-portal-cal .fc-timegrid-slot-label-cushion { color: #64748b; }
#bds-portal-cal .fc-event {
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
    font-size: .78rem;
}
#bds-portal-cal .fc-event:hover { opacity: .85; }
.bds-portal-cal-loading {
    text-align: center;
    padding: 2rem;
    color: #475569;
    font-size: .9rem;
}

/* ==========================================================================
   Portal Messaging — Header button + Modal
   ========================================================================== */

/* Header "Message Burgess Driving School" link-button */
a.bds-msg-header-btn,
a.bds-msg-header-btn:link,
a.bds-msg-header-btn:visited {
    margin-left: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem !important;
    padding: .45rem 1rem !important;
    border-radius: 20px !important;
    border: 1px solid #00c8ff !important;
    background: rgba(0,200,255,.1) !important;
    color: #00c8ff !important;
    font-size: .82rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: background .15s, box-shadow .15s;
    line-height: 1.4 !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
}
a.bds-msg-header-btn:hover { background: rgba(0,200,255,.2) !important; box-shadow: 0 0 12px rgba(0,200,255,.25); }
.bds-msg-btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
    animation: bds-badge-pulse 1.5s ease-in-out infinite;
}
@keyframes bds-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
    50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Unread badge reused in thread list */
.bds-pt-msg-badge     { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; border-radius: 9px; margin-left: .4rem; vertical-align: middle; }
.bds-pt-msg-badge--sm { font-size: .62rem; min-width: 14px; height: 14px; padding: 0 4px; margin-left: .3rem; }

/* Modal overlay */
.bds-msg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 99990;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
@media (min-width: 600px) {
    .bds-msg-modal-overlay { align-items: center; padding: 1rem; }
}

/* Modal panel */
.bds-msg-modal {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #0d1829;
    border: 1px solid rgba(0,200,255,.2);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}
@media (min-width: 600px) {
    .bds-msg-modal { border-radius: 16px; }
}

.bds-msg-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: rgba(0,200,255,.06);
    flex-shrink: 0;
}
.bds-msg-modal__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #00c8ff;
    font-size: .95rem;
    font-weight: 700;
}
.bds-msg-modal__close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .2rem;
    transition: color .12s;
}
.bds-msg-modal__close:hover { color: #e2e8f0; }

/* Compose area */
.bds-msg-modal__compose {
    padding: .9rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.bds-msg-field-row  { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .65rem; }
.bds-msg-label      { font-size: .75rem; color: #94a3b8; font-weight: 600; }
.bds-msg-textarea   {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    color: #e2e8f0;
    padding: .55rem .75rem;
    font-size: .85rem;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}
.bds-msg-textarea:focus { outline: none; border-color: #00c8ff; }
/* Placeholder — medium gray on dark messaging textarea */
.bds-msg-textarea::placeholder,
.bds-msg-textarea::-webkit-input-placeholder { color: #94a3b8 !important; opacity: 1 !important; }

/* Topic + pref toggle buttons */
.bds-msg-topic-btns,
.bds-msg-reply-pref-btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.bds-msg-topic-btn,
.bds-msg-pref-btn {
    padding: .32rem .75rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.04);
    color: #94a3b8;
    font-size: .75rem;
    cursor: pointer;
    transition: all .13s;
}
.bds-msg-topic-btn--active,
.bds-msg-pref-btn--active { border-color: #00c8ff; color: #00c8ff; background: rgba(0,200,255,.1); }

/* Send row */
.bds-msg-modal__send-row { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; }
.bds-msg-send-btn {
    padding: .45rem 1.1rem;
    border-radius: 20px;
    border: none;
    background: #00c8ff;
    color: #070F1C;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .13s;
}
.bds-msg-send-btn:disabled { opacity: .55; cursor: default; }
.bds-msg-send-btn:hover:not(:disabled) { opacity: .88; }
#bds-msg-send-status { font-size: .78rem; }

/* Thread list */
.bds-msg-modal__threads-head {
    padding: .5rem 1.1rem .3rem;
    font-size: .72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.bds-msg-modal__thread-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.1rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.bds-msg-loading, .bds-msg-empty { font-size: .8rem; color: #475569; text-align: center; padding: .75rem 0; }

.bds-msg-pt-thread {
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    background: rgba(255,255,255,.025);
    padding: .6rem .75rem;
}
.bds-msg-pt-thread-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .4rem;
}
.bds-msg-pt-topic           { font-size: .72rem; font-weight: 700; }
.bds-msg-pt-topic--booking  { color: #00c8ff; }
.bds-msg-pt-topic--training { color: #a78bfa; }
.bds-msg-pt-pref  { font-size: .72rem; }
.bds-msg-pt-date  { font-size: .68rem; color: #475569; margin-left: auto; }

/* Bubbles */
.bds-msg-pt-messages  { display: flex; flex-direction: column; gap: .35rem; }
.bds-msg-pt-bubble    { padding: .4rem .65rem; border-radius: 8px; max-width: 88%; }
.bds-msg-pt-bubble--out { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); align-self: flex-end; }
.bds-msg-pt-bubble--in  { background: rgba(0,200,255,.08); border: 1px solid rgba(0,200,255,.18); align-self: flex-start; }
.bds-msg-pt-bubble-meta { display: flex; gap: .4rem; margin-bottom: .18rem; }
.bds-msg-pt-sender      { font-size: .67rem; font-weight: 700; color: #00c8ff; }
.bds-msg-pt-bubble--out .bds-msg-pt-sender { color: #64748b; }
.bds-msg-pt-time        { font-size: .64rem; color: #475569; }
.bds-msg-pt-bubble-body { font-size: .8rem; color: #cbd5e1; line-height: 1.45; white-space: pre-wrap; }

/* Instructor selector — colors applied via inline styles from instructor calendar color */
.bds-msg-instructor-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: flex-start;
}
.bds-msg-instructor-btn {
    padding: .32rem .75rem !important;
    border-radius: 20px !important;
    border: 1px solid transparent !important; /* color set inline */
    font-size: .75rem !important;
    font-weight: 400;
    cursor: pointer;
    transition: background .13s, font-weight .1s;
    white-space: nowrap;
    align-self: flex-start;
    line-height: 1.4;
    display: inline-block !important;
    box-sizing: border-box !important;
}
