/* MF Creative Bookings — WooCommerce My Account page styling.
 *
 * Loaded on every WC My Account endpoint (sidebar nav + content area).
 * Covers:
 *   - .woocommerce-MyAccount-navigation  (WC's sidebar)
 *   - .woocommerce-MyAccount-content     (content panel)
 *   - .mfc-dash-*                        (custom dashboard endpoint)
 *   - .mfc-students-table, .mfc-my-students
 *   - .mfc-credits-card                  (My Credits)
 *   - .mfc-policy-list                   (Policies)
 *
 * Palette tokens: black for primary text/buttons, grey for accent/secondary.
 */

.woocommerce-MyAccount-navigation,
.woocommerce-MyAccount-content,
.mfc-dash,
.mfc-my-students,
.mfc-my-policies {
    --mfc-text: #111111;
    --mfc-text-soft: #1f2937;
    --mfc-muted: #6b7280;
    --mfc-border: #e5e7eb;
    --mfc-border-strong: #d1d5db;
    --mfc-bg-soft: #fafafb;
    /* v0.38 friendly refresh: studio blue accent + soft corners, matching
       the signup wizard, calendar and membership picker. */
    --mfc-accent: #03469F;
    --mfc-accent-hover: #02356f;
    --mfc-accent-fg: #ffffff;
    --mfc-radius: 5px;
    --mfc-radius-card: 8px;
    --mfc-success: #15803d;
    --mfc-warn: #b45309;
    --mfc-danger: #b91c1c;
    color: var(--mfc-text);
}

/* Post-signup membership picker card (v0.45) — sits under the welcome
   banner so a new family can subscribe without leaving the screen. */
.mfc-dash-welcome-picker {
    border: 1px solid var(--mfc-border);
    border-radius: var(--mfc-radius-card);
    background: #fff;
    padding: 1.1em 1.25em 1.25em;
    margin: 0 0 1.5em;
}
.mfc-dash-welcome-picker__title { margin: 0 0 0.25em; font-size: 1.05rem; }
.mfc-dash-welcome-picker .mfc-memberships { margin: 0.5em 0 0; }

/* ======================================================================
   SIDEBAR NAVIGATION
   ====================================================================== */
.woocommerce-MyAccount-navigation {
    font-family: inherit;
}
.woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    margin: 0;
    padding: 0 !important;
    border: 1px solid var(--mfc-border);
    background: #ffffff;
}
.mfc-dash-hero__cta {
    color:#fff;
}
.woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation ul li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--mfc-border);
}
.woocommerce-MyAccount-navigation ul li:last-child {
    border-bottom: 0;
}
.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.85em 1em;
    color: var(--mfc-text-soft);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.woocommerce-MyAccount-navigation ul li a:hover {
    background: var(--mfc-bg-soft);
    color: var(--mfc-text);
}
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a[aria-current="page"] {
    background: #f3f4f6;
    color: var(--mfc-text);
    font-weight: 700;
    border-left-color: var(--mfc-accent);
}
.woocommerce-MyAccount-navigation ul li--customer-logout a,
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: var(--mfc-muted);
    font-size: 0.9rem;
}

/* ======================================================================
   CONTENT PANEL
   ====================================================================== */
.woocommerce-MyAccount-content {
    color: var(--mfc-text);
}
.woocommerce-MyAccount-content h1,
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3,
.woocommerce-MyAccount-content h4 {
    color: var(--mfc-text);
}
.woocommerce-MyAccount-content a {
    color: var(--mfc-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.woocommerce-MyAccount-content a:hover {
    color: var(--mfc-text-soft);
}

/* WC's default notice strip — desaturate the brand colour bias */
.woocommerce-MyAccount-content .woocommerce-message,
.woocommerce-MyAccount-content .woocommerce-info {
    border-top-color: var(--mfc-accent);
    background: var(--mfc-bg-soft) !important;
    color: var(--mfc-text)  !important;
    font-size: 14px !important;
}

/* ======================================================================
   DASHBOARD ENDPOINT (mfc-dashboard)
   ====================================================================== */
.mfc-dash {
    font-family: inherit;
}
.mfc-dash-welcome {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.85em 1em;
    border-radius: var(--mfc-radius);
    margin-bottom: 1em;
}
.mfc-dash-alert {
    background: #fef9c3;
    border: 1px solid #fde68a;
    color: #713f12;
    padding: 0.85em 1em;
    border-radius: var(--mfc-radius);
    margin-bottom: 1em;
}
.mfc-dash-alert__cta {
    display: inline-block;
    margin-left: 0.5em;
    font-weight: 600;
    color: #713f12;
    text-decoration: underline;
}

.mfc-dash-hero {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    border: 1px solid var(--mfc-border);
    border-radius: var(--mfc-radius-card);
    padding: 1.5em 1.5em;
    margin-bottom: 1.5em;
    background: #ffffff;
}
@media (min-width: 640px) {
    .mfc-dash-hero {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
.mfc-dash-hero__greet {
    margin: 0 0 0.25em;
    font-size: 1.6rem;
    line-height: 1.2;
    color: var(--mfc-text);
    font-weight: 700;
}
.mfc-dash-hero__sub {
    margin: 0;
    color: var(--mfc-muted);
    font-size: 0.95rem;
}

.mfc-my-students form.mfc-student-form {
    margin-top: 15px;
}

.mfc-dash-hero__cta {
    background: var(--mfc-accent);
    color: var(--mfc-accent-fg) !important;
    padding: 0.75em 1.4em;
    border-radius: var(--mfc-radius);
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    align-self: flex-start;
    transition: background 120ms ease;
}
.mfc-dash-hero__cta:hover {
    background: var(--mfc-accent-hover);
    color: var(--mfc-accent-fg);
    text-decoration: none;
}

.mfc-dash-section { margin: 0 0 1.75em; }
.mfc-dash-section__heading {
    margin: 0 0 0.85em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mfc-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.mfc-dash-section__more {
    display: inline-block;
    margin-top: 0.75em;
    color: var(--mfc-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--mfc-text);
}
.mfc-dash-section__more:hover {
    color: var(--mfc-text-soft);
    border-bottom-color: var(--mfc-text-soft);
}
.mfc-dash-empty {
    color: var(--mfc-muted);
    font-style: italic;
    margin: 0;
    padding: 0.85em 1em !important;
    background: var(--mfc-bg-soft);
    border: 1px dashed var(--mfc-border-strong);
}
.mfc-dash-empty a {
    font-style: normal;
    margin-left: 0.5em;
    color: var(--mfc-text);
    font-weight: 600;
}

.mfc-dash-next__list { list-style: none; padding: 0; margin: 0; }
.mfc-dash-next__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
    padding: 0.85em 1em;
    border: 1px solid var(--mfc-border);
    border-radius: var(--mfc-radius-card);
    margin-bottom: 0.5em;
    background: #ffffff;
}
.mfc-dash-next__when {
    color: var(--mfc-text);
    font-weight: 700;
    font-size: 0.9rem;
}
.mfc-dash-next__what { text-align: right; }
.mfc-dash-next__what strong { display: block; color: var(--mfc-text); }
.mfc-dash-next__who { color: var(--mfc-muted); font-size: 0.85rem; }
@media (max-width: 480px) {
    .mfc-dash-next__item { flex-direction: column; align-items: flex-start; gap: 0.25em; }
    .mfc-dash-next__what { text-align: left; }
}

.mfc-dash-students__grid {
    display: grid;
    gap: 0.75em;
    grid-template-columns: 1fr;
}
@media (min-width: 600px) { .mfc-dash-students__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .mfc-dash-students__grid { grid-template-columns: repeat(3, 1fr); } }
.mfc-dash-student {
    border: 1px solid var(--mfc-border);
    border-radius: var(--mfc-radius-card);
    padding: 1.1em 1em;
    background: #ffffff;
    display: grid;
    gap: 0.5em;
    transition: border-color 120ms ease;
}
.mfc-dash-student:hover { border-color: var(--mfc-border-strong); }
.mfc-dash-student__name {
    margin: 0;
    font-size: 1.05rem;
    color: var(--mfc-text);
    font-weight: 700;
}
.mfc-dash-student__status { font-size: 0.85rem; }
.mfc-dash-student__status--good { color: var(--mfc-success); font-weight: 600; }
.mfc-dash-student__status--warn { color: var(--mfc-warn); font-weight: 600; }
.mfc-dash-student__status--none { color: var(--mfc-muted); }
.mfc-dash-student__upcoming { color: var(--mfc-muted); font-size: 0.85rem; }
.mfc-dash-student__cta { margin-top: 0.4em; }

.mfc-dash-button {
    display: inline-block;
    background: var(--mfc-accent);
    color: var(--mfc-accent-fg) !important;
    padding: 0.5em 1em;
    border-radius: var(--mfc-radius);
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 120ms ease;
}
.mfc-dash-button:hover {
    background: var(--mfc-accent-hover);
    color: var(--mfc-accent-fg);
    text-decoration: none;
}
.mfc-dash-button--secondary {
    background: #ffffff;
    color: var(--mfc-accent) !important;
    border: 1px solid var(--mfc-accent);
    text-decoration:none !important;
}
.mfc-dash-button--secondary:hover {
    background: #f0f5fc;
    color: var(--mfc-accent-hover);
    border-color: var(--mfc-accent-hover);
}

.mfc-dash-links__grid {
    display: grid;
    gap: 0.5em;
    grid-template-columns: 1fr 1fr;
}
@media (min-width: 600px) {
    .mfc-dash-links__grid { grid-template-columns: repeat(4, 1fr); }
}
.mfc-dash-quick {
    display: block;
    padding: 0.85em 0.85em;
    background: #ffffff;
    border: 1px solid var(--mfc-border-strong);
    border-radius: var(--mfc-radius);
    color: var(--mfc-text);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    font-size: 0.85rem;
    transition: background 120ms ease, border-color 120ms ease;
}
.mfc-dash-quick:hover {
    background: var(--mfc-bg-soft);
    color: var(--mfc-text);
    border-color: var(--mfc-text);
    text-decoration: none;
}

/* ======================================================================
   MY STUDENTS endpoint
   ====================================================================== */
.mfc-my-students > p:first-of-type {
    color: var(--mfc-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.mfc-my-students h3 {
    margin: 1.75em 0 0.75em;
    font-size: 1.1rem;
    color: var(--mfc-text);
}
.mfc-my-students h3:first-of-type { margin-top: 1em; }

.mfc-account-tcs {
    margin: 1.25em 0 1.5em;
    padding: 1em 1.15em;
    border: 1px solid var(--mfc-border);
    border-left: 4px solid #15803d;
    border-radius: var(--mfc-radius);
    background: #ffffff;
}
.mfc-account-tcs--required {
    border-left-color: #b91c1c;
    background: #fffafa;
}
.mfc-account-tcs__heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
}
.mfc-my-students .mfc-account-tcs__heading-row h3 {
    margin: 0;
}
.mfc-account-tcs__status {
    flex: 0 0 auto;
    padding: 0.2em 0.65em;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.mfc-account-tcs--required .mfc-account-tcs__status {
    background: #fee2e2;
    color: #991b1b;
}
.mfc-account-tcs__summary {
    margin: 0.7em 0 0;
}
.mfc-account-tcs__policy {
    margin: 1em 0;
    border: 1px solid var(--mfc-border);
    background: #ffffff;
}
.mfc-account-tcs__policy > summary {
    padding: 0.75em 0.9em;
    cursor: pointer;
    font-weight: 700;
    color: var(--mfc-text);
}
.mfc-account-tcs__policy-body {
    max-height: 18em;
    overflow-y: auto;
    padding: 0.9em;
    border-top: 1px solid var(--mfc-border);
    background: #f8fafc;
}
.mfc-account-tcs__policy-body > :first-child { margin-top: 0; }
.mfc-account-tcs__policy-body > :last-child { margin-bottom: 0; }
.mfc-account-tcs__form {
    margin-top: 1em;
}
.mfc-account-tcs__acceptance label {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
}
.mfc-account-tcs__acceptance input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 0.25em;
}

.mfc-students-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--mfc-border);
}
.mfc-students-table th,
.mfc-students-table td {
    padding: 0.85em 1em;
    border-bottom: 1px solid var(--mfc-border);
    text-align: left;
    vertical-align: middle;
}
.mfc-students-table thead th {
    background: var(--mfc-bg-soft);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mfc-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.mfc-students-table tbody tr:last-child td { border-bottom: 0; }

.mfc-students-table .button {
    background: #ffffff;
    color: var(--mfc-text);
    border: 1px solid var(--mfc-border-strong);
    padding: 0.4em 0.85em;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.25em;
    border-radius: var(--mfc-radius);
    text-decoration: none;
}
.mfc-students-table .button:hover {
    background: var(--mfc-bg-soft);
    border-color: var(--mfc-text);
    color: var(--mfc-text);
}

.mfc-students-table__you-badge {
    display: inline-block;
    margin-left: 0.5em;
    padding: 0.15em 0.6em;
    background: var(--mfc-accent);
    color: var(--mfc-accent-fg);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.mfc-students-table__row--self td:first-child { font-weight: 700; }

div.mfc-my-students p button {
    margin-top:20px;
}

.mfc-student-form .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    margin-bottom: 0.85em;
}
.mfc-student-form .form-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mfc-text-soft);
}
.mfc-student-form .form-row input {
    padding: 0.6em 0.85em;
    border: 1px solid var(--mfc-border-strong);
    border-radius: var(--mfc-radius);
    font: inherit;
    font-size: 1rem;
    background: #ffffff;
    color: var(--mfc-text);
}
.mfc-student-form .form-row input:focus-visible {
    outline: none;
    border-color: var(--mfc-accent);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18);
}
@media (min-width: 540px) {
    .mfc-student-form .form-row-first,
    .mfc-student-form .form-row-last {
        display: inline-flex;
        width: 48%;
    }
    .mfc-student-form .form-row-first { margin-right: 4%; }
}
.mfc-student-form button[type="submit"] {
    background: var(--mfc-accent);
    color: var(--mfc-accent-fg);
    border: 0;
    padding: 0.7em 1.4em;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--mfc-radius);
}
.mfc-student-form button[type="submit"]:hover { background: var(--mfc-accent-hover); }

/* ======================================================================
   MY CREDITS endpoint
   ====================================================================== */
.mfc-credits-card {
    background: #ffffff;
    border: 1px solid var(--mfc-border);
    padding: 1.25em 1.5em;
    margin: 0 0 1em;
}
.mfc-credits-card h3 {
    margin: 0 0 0.5em;
    font-size: 1.1rem;
    color: var(--mfc-text);
}
.mfc-credits-card__balance {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mfc-text);
}
.mfc-credits-card__sub {
    color: var(--mfc-muted);
    font-size: 0.85rem;
    margin-top: 0.25em;
}

/* ======================================================================
   POLICIES endpoint
   ====================================================================== */
.mfc-my-policies > p:first-of-type {
    color: var(--mfc-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0;
}
.mfc-policy-list {
    list-style: none;
    margin: 1em 0 0;
    padding: 0;
    border: 1px solid var(--mfc-border);
    background: #ffffff;
}
.mfc-policy-list__item {
    margin: 0;
    border-bottom: 1px solid var(--mfc-border);
}
.mfc-policy-list__item:last-child {
    border-bottom: 0;
}
.mfc-policy-list__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    min-height: 3.25em;
    padding: 0.85em 1em;
    color: var(--mfc-text) !important;
    text-decoration: none !important;
    transition: background 120ms ease;
}
.mfc-policy-list__link:hover {
    background: var(--mfc-bg-soft);
    color: var(--mfc-text) !important;
}
.mfc-policy-list__label {
    font-weight: 600;
}
.mfc-policy-list__meta {
    flex: 0 0 auto;
    border: 1px solid var(--mfc-border-strong);
    color: var(--mfc-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    padding: 0.35em 0.55em;
    text-transform: uppercase;
}

/* ======================================================================
   MY BOOKINGS — cancel button + flash messages
   ====================================================================== */
.mfc-my-bookings .mfc-flash {
    margin: 0 0 1em;
    padding: 0.6em 0.9em;
    border: 1px solid;
    font-size: 0.9rem;
}
.mfc-my-bookings .mfc-flash--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
.mfc-my-bookings .mfc-flash--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.mfc-bookings-table__actions {
    text-align: right;
    white-space: nowrap;
}
.mfc-bookings-table__cancel-form {
    margin: 0;
    display: inline;
}
.mfc-bookings-table__cancel-btn {
    background: transparent;
    border: 1px solid var(--mfc-border-strong);
    color: var(--mfc-danger);
    padding: 0.35em 0.9em;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--mfc-radius);
}
.mfc-bookings-table__cancel-btn:hover {
    background: var(--mfc-danger);
    color: #fff;
    border-color: var(--mfc-danger);
}
.mfc-bookings-table__cancel-btn:focus-visible {
    outline: 2px solid var(--mfc-accent);
    outline-offset: 2px;
}

/* Horizontal scroll escape hatch for the booking/enrolment/student tables on
   narrow screens — without it the right-most Cancel column clips off-screen
   on phones, stranding the most common mobile action. */
.mfc-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.mfc-table-scroll > table {
    min-width: 560px;
}

/* Status badges in the bookings table. The Weekly badge marks occurrences
   generated by an enrolment so per-week vs whole-series cancelling is
   visually distinguishable. */
.mfc-badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.mfc-badge-upcoming { background: #dcfce7; color: #14532d; }
.mfc-badge-payment-pending { background: #fef3c7; color: #92400e; }
.mfc-badge-past { background: #f1f5f9; color: #64748b; }
.mfc-badge-weekly { background: #e0e7ff; color: #3730a3; margin-left: 0.4em; }
.mfc-badge-private { background: #ccfbf1; color: #115e59; margin-left: 0.4em; }
.mfc-badge-one-off { background: #fef3c7; color: #92400e; margin-left: 0.4em; }

/* Per-student Consents panel (My Students). Auto-open while anything is
   outstanding; the badge mirrors the booking gate's requirements. */
.mfc-students-table__consents summary {
    cursor: pointer;
    font-weight: 600;
}
.mfc-students-table__consents-badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    margin-left: 0.4em;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #fee2e2;
    color: #991b1b;
}
.mfc-student-consents__list {
    list-style: none;
    margin: 0.6em 0 0;
    padding: 0;
}
.mfc-student-consents__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    padding: 0.45em 0;
    border-bottom: 1px solid #e5e7eb;
}
.mfc-student-consents__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    align-items: baseline;
}
.mfc-student-consents__label { font-weight: 600; }
.mfc-student-consents__value--missing { color: #991b1b; font-weight: 600; }
.mfc-student-consents__signed { color: #6b7280; font-size: 0.85em; }
.mfc-consent-form__policy {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.9em 1em;
    margin: 0.75em 0 1em;
    max-height: 16em;
    overflow-y: auto;
}
.mfc-consent-form__contact,
.mfc-consent-form__medication {
    border: 1px solid #e5e7eb;
    padding: 0.6em 0.8em;
    margin: 0 0 0.75em;
}
.mfc-consent-form__optional { color: #6b7280; font-weight: 400; font-size: 0.85em; }
