/**
 * Training on My Account (11/30/2026): the "Training" block in each brand tab of Your Sites & Services, and the dialog
 * the course player opens in. The block lives inside .eezy-billing and uses its variables; the dialog is appended to
 * <body>, outside .eezy-billing, so every color there carries its own fallback (the Update Payment Method overlay lesson).
 * WCAG 2.1 AA: navy-on-white text (16:1), white on navy buttons, muted text #6b7280 on white (4.8:1), visible focus.
 */

/* ---- the block in a brand tab ---- */
.eezy-billing .eezy-trn { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--eezy-billing-border, #e5e7eb); }
.eezy-billing h4.eezy-trn-heading {
    margin: 0 0 4px; padding: 0; font-family: var(--eezy-font-heading, 'Space Grotesk'), system-ui, sans-serif;
    font-size: .76rem; font-weight: 600; line-height: 1.4; letter-spacing: .09em; text-transform: uppercase;
    color: var(--eezy-billing-muted, #6b7280);
}
.eezy-billing .eezy-trn-list { margin-bottom: 4px; }
.eezy-billing .eezy-trn-list li.eezy-trn-item { align-items: center; padding: 12px 0; }
.eezy-trn-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.eezy-billing .eezy-trn-title { font-weight: 600; color: var(--eezy-billing-text, #0F1F36); }
.eezy-trn-summary { font-size: .88rem; line-height: 1.45; }
.eezy-trn-side { flex: 0 1 auto; display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.eezy-trn-meta { white-space: nowrap; }
/* white on brand primary (#00A7E1) is 2.9:1, so the button is navy like the other tab actions; pinned against the theme */
.eezy-billing .eezy-trn button.eezy-trn-start {
    color: #ffffff !important; background: var(--eezy-billing-text, #0F1F36) !important;
    border: 1px solid var(--eezy-billing-text, #0F1F36) !important; font-family: inherit; font-size: .85rem;
    font-weight: 600; cursor: pointer; min-width: 92px; min-height: 36px;
}
.eezy-billing .eezy-trn button.eezy-trn-start:hover { box-shadow: 0 0 0 2px var(--eezy-billing-primary, #00A7E1); }
.eezy-billing .eezy-trn button.eezy-trn-start:focus-visible { outline: 2px solid var(--eezy-billing-primary, #00A7E1); outline-offset: 2px; }
@media (max-width: 640px) {
    .eezy-trn-side { justify-content: flex-start; flex-basis: 100%; }
    .eezy-trn-meta { white-space: normal; }
}

/* ---- the dialog ---- */
.eezy-trn-backdrop {
    position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
    padding: 16px; box-sizing: border-box; background: rgba(15, 31, 54, .6);
}
.eezy-trn-modal {
    display: flex; flex-direction: column; width: 100%; max-width: 1180px; height: 100%; max-height: 880px;
    background: #ffffff; color: #0F1F36; border-radius: 10px; overflow: hidden;
    box-shadow: 0 18px 50px rgba(15, 31, 54, .35); font-family: var(--eezy-font-body, 'Hanken Grotesk'), system-ui, sans-serif;
}
.eezy-trn-modal:focus { outline: none; }
.eezy-trn-bar {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; border-bottom: 1px solid #e5e7eb; background: #ffffff;
}
.eezy-trn-modal .eezy-trn-bar-title {
    margin: 0; min-width: 0; font-family: var(--eezy-font-heading, 'Space Grotesk'), system-ui, sans-serif;
    font-size: 1rem; font-weight: 700; line-height: 1.3; color: #0F1F36;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eezy-trn-modal .eezy-trn-close {
    flex: 0 0 auto; appearance: none; -webkit-appearance: none; margin: 0; padding: 7px 16px; min-height: 36px;
    background: #ffffff; color: #0F1F36; border: 1px solid #0F1F36; border-radius: 6px;
    font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.eezy-trn-modal .eezy-trn-close:hover { background: #ECF0F1; }
.eezy-trn-stage { flex: 1 1 auto; min-height: 0; overflow: auto; background: #f1f5f9; }
.eezy-trn-stage > .etp-root { height: 100%; }
.eezy-trn-loading, .eezy-trn-error {
    margin: 24px; padding: 14px 16px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 1rem; line-height: 1.5; color: #0F1F36;
}
.eezy-trn-error { border-left: 4px solid #b91c1c; color: #7f1d1d; }
/* the player's own controls get a visible focus ring here (navy, 3:1+ against every player background) */
.eezy-trn-modal :focus-visible { outline: 2px solid #0F1F36; outline-offset: 2px; }
.eezy-trn-modal .etp-quiz-opt[aria-checked="true"] { box-shadow: inset 0 0 0 2px #0F1F36; }
/* the player's source credits are #64748b, 4.3:1 on its grey panels; darkened here to pass AA */
.eezy-trn-modal .etp-src { color: #475569; }
.eezy-trn-sr {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
@media (max-width: 640px) {
    .eezy-trn-backdrop { padding: 0; }
    .eezy-trn-modal { max-height: none; border-radius: 0; }
}
/* on a phone the player's own Exit button sits over its slide counter; the dialog's Close does the same job (saves, closes) */
@media (max-width: 768px) { .eezy-trn-modal .etp-btn-exit { display: none; } }
@media (forced-colors: active) {
    .eezy-trn-modal { border: 1px solid CanvasText; }
    .eezy-trn-modal :focus-visible { outline-color: Highlight; }
}
