/*
 * ENTTEC My Account, Design System "v2" enhancements (FLAG-GATED, test-only).
 * ---------------------------------------------------------------------------
 * This file layers the 2026-07 account-DS enhancements ON TOP of the shipped
 * base (css/enttec-account-ui.css). It is enqueued ONLY when
 * enttec_account_ds2_active() is true (test box / local dev), and every rule is
 * scoped under the .acct-ds2 flag class, emitted only when the helper is true:
 *   - #enttec-account.acct-ds2 ...   (page body wrapper, my-account.php)
 *   - .acct-header.acct-ds2 ...      (account top bar, header.php)
 *
 * Consequence by design: on production the flag is absent, this file is NOT
 * enqueued, and the base stylesheet is byte-identical to PR1, so prod renders
 * exactly as it does today. Flip enttec_account_ds2_active() to true (or
 * add_filter('enttec_account_ds2_active','__return_true')) at ELM-2026 go-live
 * to ship all of this to every region in one line.
 *
 * The extra .acct-ds2 class raises every selector's specificity by one class
 * over the base's #enttec-account / .acct-header rules, and this file loads
 * after the base, so these overrides win without new !important (the !important
 * that remains defeats Bootstrap/WC/tablepress utility classes, exactly as the
 * base does). Ported from docs/myaccount-design-system.html + the audit
 * (docs/2026-07-13-myaccount-ds-audit.md).
 */

/* ============================================================================
 * TOKENS (added this cycle). Scoped to the flag so the base :root is untouched.
 * .acct-ds2 sits on both the wrapper and the header, so these inherit into
 * every descendant of either. Badge greens + table chrome, per the audit's
 * "point components AND bridges at tokens" cleanup.
 * ==========================================================================*/
.acct-ds2 {
    --acct-badge-success-bg: #e6f7ec;
    --acct-badge-success-text: #1a7f37;
    --acct-table-head-bg: #fafbfc;
    --acct-table-head-text: #6b7280;
    --acct-table-row-line: #f0f0f0;
    --acct-table-border: #e0e0e0;
}

/* ============================================================================
 * ACCOUNT HEADER alignment. The theme sizes .my-account-row at 98% / 1480px,
 * but the base header inner is capped narrower, so the logo sat right of the
 * content's left edge. Match the same box (and 15px gutter) on account only;
 * checkout keeps the narrower base header.
 * ==========================================================================*/
.acct-header.acct-ds2 .acct-header-inner {
    width: 98%;
    max-width: 1480px;
    padding-left: 15px;
    padding-right: 15px;
}
/* Secure-lock trust badge (logged-out header): the 116x126 PNG ships with no
 * size constraint, so it renders full-size and dominates the header. Cap it to
 * a small icon on the same scale as the logo/avatar. */
.acct-header.acct-ds2 .secureLockImage img {
    height: 28px; width: auto; display: block;
}

/* ============================================================================
 * OPTION A SIDE NAV.
 *
 * The theme renders each row as <li> <i class="fa"></i> <a>Label</a> so the
 * icon is a SIBLING of the anchor and the theme paints a solid #e7f6fc pill on
 * the <li>. We restyle the whole <li> as the row so icon + label share ONE
 * soft-tint + accent-bar surface, and neutralise the theme pill. Because the
 * base already styles the <a> as the row, this override also RESETS the base
 * box props on the <a> (min-height/padding) so they don't double up on the <li>.
 * ==========================================================================*/
/* The row: icon + anchor on one flex line, one shared hover/active surface. */
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li {
    position: relative; margin: 0;
    display: flex; align-items: center; gap: 12px;
    min-height: 46px; padding: 11px 14px;
    border-radius: 0 var(--acct-radius) var(--acct-radius) 0;   /* flat against the rail edge, rounded on the free side */
    border-left: 2px solid transparent;   /* reserved: active bar swaps colour, no text shift */
    color: var(--acct-text-muted);
    background: transparent;               /* neutralises the theme's #e7f6fc pill */
    transition: color var(--acct-dur) var(--acct-ease),
                background var(--acct-dur) var(--acct-ease),
                border-color var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li a {
    flex: 1 1 auto; display: block;
    min-height: 0; padding: 0;   /* reset the base <a> box; the <li> now owns the row box */
    font-family: var(--acct-font-head); font-weight: 500; font-size: 14px;
    color: inherit; text-decoration: none; border: 0; background: transparent;
    transition: color var(--acct-dur) var(--acct-ease);
}
/* Sibling icon: muted at rest; nudges right + turns brand on hover (micro-motion). */
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li .fa {
    flex: 0 0 20px; width: 20px; text-align: center;
    font-size: 15px; color: #8a929c;
    transition: color var(--acct-dur) var(--acct-ease), transform var(--acct-dur) var(--acct-ease);
}

/* Hover (non-active): darken label, brand-tint the row, nudge the icon. */
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li:hover { color: var(--acct-text); background: rgba(14,165,223,0.05); }
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li:hover .fa { color: var(--acct-blue); transform: translateX(2px); }
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li a:focus-visible { outline: none; box-shadow: var(--acct-ring-soft); border-radius: var(--acct-radius-sm); }
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li:active { transform: translateY(0.5px); }

/* Active row: soft tint + 3px accent bar + weight + brand colour (icon & label). */
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.is-active {
    color: var(--acct-blue);
    background: rgba(14,165,223,0.06);
    border-left-color: var(--acct-blue);
}
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.is-active a { font-weight: 600; }
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.is-active .fa { color: var(--acct-blue); transform: none; }

/* Logout / Sign Out: separated at the bottom, danger on hover, NEVER blue-active. */
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
    margin-top: 6px; padding-top: 14px;
    border-top: 1px solid var(--acct-border);
    border-radius: 0 0 var(--acct-radius-sm) var(--acct-radius-sm);
}
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout:hover,
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout.is-active {
    color: var(--acct-danger); background: var(--acct-danger-tint); border-left-color: transparent;
}
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout:hover .fa {
    color: var(--acct-danger); transform: translateX(2px);
}
/* Selected (active) logout: keep the icon red too, else the generic
 * `li.is-active .fa { color: blue }` rule wins. */
#enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout.is-active .fa {
    color: var(--acct-danger);
}

/* ============================================================================
 * LAYOUT: account row (sidebar rail + content). Template ships col-lg-3/9
 * (25/75); design calls for a ~20% rail. Override at the lg breakpoint where
 * the two-column layout kicks in; below that Bootstrap stacks full-width.
 * ==========================================================================*/
@media (min-width: 992px) {
    #enttec-account.acct-ds2 .my-account-row { display: flex; flex-wrap: nowrap; }
    #enttec-account.acct-ds2 .my-account-row > .col-lg-3 { flex: 0 0 20%; max-width: 20%; width: 20%; }
    #enttec-account.acct-ds2 .my-account-row > .col-lg-9 { flex: 1 1 auto; max-width: none; width: auto; }
}

/* ============================================================================
 * TABLES (#enttec-account.acct-ds2 .shop_table)   [design system, Section 11]
 *
 * One reusable table standard for the account sub-pages (Orders, Downloads,
 * Subscriptions, Payment methods, and the order / subscription detail tables).
 * Hooks onto WooCommerce's own .shop_table class, so no markup changes needed.
 * The licences page uses .license-table (not .shop_table), so it stays untouched.
 *
 * !important appears ONLY to defeat the Bootstrap/tablepress *utility* classes
 * the theme layers on (.bg-dark, .thead-dark, .table-striped, .rounded-xxl),
 * which ship !important themselves; everything else wins on specificity alone.
 * ==========================================================================*/
/* Card shell on the table itself (WC tables have no consistent wrapper). */
#enttec-account.acct-ds2 .shop_table {
    width: 100%; margin: 0 0 32px;
    border-collapse: separate; border-spacing: 0;
    background: #fff; border: 1px solid var(--acct-table-border); border-radius: var(--acct-radius-lg);
    box-shadow: 0 4px 14px rgba(0,0,0,0.05); overflow: hidden;
    font-family: var(--acct-font-body); color: var(--acct-text-2); font-size: 14px;
}
/* Header band: light neutral, uppercase micro-label. !important beats
 * .thead-dark / .bg-dark on the Orders + Payment-methods tables. */
#enttec-account.acct-ds2 .shop_table thead,
#enttec-account.acct-ds2 .shop_table thead tr { background: var(--acct-table-head-bg) !important; color: var(--acct-table-head-text) !important; }
#enttec-account.acct-ds2 .shop_table thead th {
    padding: 13px 16px; font-family: var(--acct-font-body);
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px;
    color: var(--acct-table-head-text) !important; background: transparent !important;
    /* !important on the divider defeats the theme's thead.bg-dark rule
     * (border-color: var(--dark) !important). */
    border: 0 !important; border-bottom: 1px solid var(--acct-border-soft) !important;
    text-align: left; white-space: nowrap;
}
#enttec-account.acct-ds2 .shop_table thead th:last-child,
#enttec-account.acct-ds2 .shop_table tbody td:last-child { text-align: right; }
/* Body cells: roomy padding, hairline rule, no Bootstrap striping. */
#enttec-account.acct-ds2 .shop_table tbody td,
#enttec-account.acct-ds2 .shop_table tbody th {
    padding: 12px 16px; font-size: 14px; color: var(--acct-text-2);
    border: 0; border-top: 1px solid var(--acct-table-row-line); vertical-align: middle; background: transparent;
}
#enttec-account.acct-ds2 .shop_table tbody tr { background: #fff !important; }             /* kills .table-striped */
#enttec-account.acct-ds2 .shop_table tbody tr:first-child td,
#enttec-account.acct-ds2 .shop_table tbody tr:first-child th { border-top: 0; }            /* no doubled rule under thead */
#enttec-account.acct-ds2 .shop_table tbody tr:hover { background: var(--acct-table-head-bg) !important; }
#enttec-account.acct-ds2 .shop_table tbody a:not(.button):not(.btn) { color: var(--acct-blue); text-decoration: none; font-weight: 600; }
#enttec-account.acct-ds2 .shop_table tbody a:not(.button):not(.btn):hover { color: var(--acct-blue-hover); text-decoration: underline; }

/* Row-action buttons: outline pill matching the EMU/licences table View button
 * (18px radius, 6px 14px, 13px, blue outline filling on hover). radius + colour
 * use !important to beat .rounded-xxl and .btn-primary{color:#fff!important}. */
#enttec-account.acct-ds2 .shop_table td .button,
#enttec-account.acct-ds2 .shop_table td a.btn,
#enttec-account.acct-ds2 .shop_table td .woocommerce-Button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 0 !important; height: auto; padding: 6px 14px !important; margin: 0 0 0 6px;
    border: 1px solid var(--acct-blue) !important; border-radius: 18px !important;
    background: #fff !important; color: var(--acct-blue) !important;
    font-family: var(--acct-font-body); font-size: 13px; font-weight: 600; line-height: 1.3;
    text-transform: none; letter-spacing: 0; box-shadow: none; white-space: nowrap;
    transition: background var(--acct-dur) var(--acct-ease), color var(--acct-dur) var(--acct-ease), border-color var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 .shop_table td .button:first-child,
#enttec-account.acct-ds2 .shop_table td a.btn:first-child { margin-left: 0; }
#enttec-account.acct-ds2 .shop_table td .button:hover,
#enttec-account.acct-ds2 .shop_table td a.btn:hover,
#enttec-account.acct-ds2 .shop_table td .woocommerce-Button:hover {
    background: var(--acct-blue) !important; color: #fff !important; border-color: var(--acct-blue) !important; text-decoration: none;
}
/* Cancel / delete read as danger. */
#enttec-account.acct-ds2 .shop_table td a.cancel,
#enttec-account.acct-ds2 .shop_table td a.delete { border-color: var(--acct-danger-line) !important; color: var(--acct-danger-text) !important; background: #fff !important; }
#enttec-account.acct-ds2 .shop_table td a.cancel:hover,
#enttec-account.acct-ds2 .shop_table td a.delete:hover { background: var(--acct-danger-tint); color: var(--acct-danger) !important; border-color: var(--acct-danger); }
/* Status column emphasis (a true pill needs a wrapping span, phase 2). */
#enttec-account.acct-ds2 .shop_table td.order-status,
#enttec-account.acct-ds2 .shop_table td.woocommerce-orders-table__cell-order-status,
#enttec-account.acct-ds2 .shop_table td.subscription-status { font-weight: 600; }

/* Responsive: WC's .shop_table_responsive stacks < 768px, re-skin each row as a
 * tinted card of label / value pairs, matching the licences mobile view. */
@media (max-width: 768px) {
    #enttec-account.acct-ds2 .shop_table { border: 0; box-shadow: none; background: transparent; border-radius: 0; overflow: visible; }
    #enttec-account.acct-ds2 .shop_table thead { display: none; }
    #enttec-account.acct-ds2 .shop_table tbody tr,
    #enttec-account.acct-ds2 .shop_table tbody tr:hover {
        display: block; background: #f6f9fb !important; border: 1px solid #e2eaf0; border-radius: 10px;
        padding: 14px 16px; margin-bottom: 10px;
    }
    #enttec-account.acct-ds2 .shop_table tbody td,
    #enttec-account.acct-ds2 .shop_table tbody th {
        display: flex; justify-content: space-between; align-items: center; gap: 12px;
        padding: 4px 0; border: 0; text-align: right; font-size: 13px;
    }
    #enttec-account.acct-ds2 .shop_table tbody td::before {
        content: attr(data-title); font-size: 12px; color: #888; font-weight: 400; text-align: left; flex-shrink: 0;
    }
    #enttec-account.acct-ds2 .shop_table tbody td:last-child { justify-content: flex-end; padding-top: 10px; }
    #enttec-account.acct-ds2 .shop_table tbody td .button,
    #enttec-account.acct-ds2 .shop_table tbody td a.btn { margin-left: 0; }
}

/* ============================================================================
 * CHECKBOX / RADIO (#enttec-account.acct-ds2 .enttec-check)   [design system]
 * Native input hidden (kept for keyboard + form semantics), brand box drawn.
 * ==========================================================================*/
#enttec-account.acct-ds2 .enttec-check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--acct-text-2); line-height: 1.4; margin: 0; }
/* !important so the native-checkbox bridge below can't un-hide this input. */
#enttec-account.acct-ds2 .enttec-check input { position: absolute !important; opacity: 0 !important; width: 0 !important; height: 0 !important; }
#enttec-account.acct-ds2 .enttec-check__box {
    flex: 0 0 auto; width: 20px; height: 20px;
    border: 1.5px solid var(--acct-border); background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px;
    border-radius: 5px;
    transition: background var(--acct-dur) var(--acct-ease), border-color var(--acct-dur) var(--acct-ease), transform 90ms var(--acct-ease);
}
#enttec-account.acct-ds2 .enttec-check--radio .enttec-check__box { border-radius: 50%; }
#enttec-account.acct-ds2 .enttec-check__box i { opacity: 0; transform: scale(0.6); transition: opacity var(--acct-dur) var(--acct-ease), transform var(--acct-dur) var(--acct-ease); }
#enttec-account.acct-ds2 .enttec-check input:checked + .enttec-check__box { background: var(--acct-blue); border-color: var(--acct-blue); }
#enttec-account.acct-ds2 .enttec-check input:checked + .enttec-check__box i { opacity: 1; transform: scale(1); }
#enttec-account.acct-ds2 .enttec-check input:focus-visible + .enttec-check__box { box-shadow: var(--acct-ring-soft); border-color: var(--acct-blue); }
#enttec-account.acct-ds2 .enttec-check input:active + .enttec-check__box { transform: scale(0.92); }
#enttec-account.acct-ds2 .enttec-check input:disabled ~ * { opacity: 0.5; }
#enttec-account.acct-ds2 .enttec-check a { color: var(--acct-blue); text-decoration: none; }
#enttec-account.acct-ds2 .enttec-check a:hover { text-decoration: underline; }

/* ============================================================================
 * VIEW ORDER / ORDER DETAILS (single order + subscription detail)
 * Turn the theme's dark .bg-dark title bars into clean headings and give the
 * div-based .shop_table the account table look.
 * ==========================================================================*/
#enttec-account.acct-ds2 .woocommerce-order-details__title,
#enttec-account.acct-ds2 .woocommerce-column__title,
#enttec-account.acct-ds2 .woocommerce-order-downloads__title {
    background: transparent !important;
    color: var(--acct-text) !important;
    font-family: var(--acct-font-head);
    font-size: 16px !important; font-weight: 600 !important;
    text-transform: none !important; letter-spacing: 0 !important;
    padding: 0 !important; margin: 0 0 12px !important;
}
/* div-based order table: header band + padded rows inside the card shell. */
#enttec-account.acct-ds2 .shop_table.order_details { display: block; }
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-head {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--acct-table-head-bg); color: var(--acct-table-head-text);
    padding: 13px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px;
    border-bottom: 1px solid var(--acct-border-soft);
}
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-body { display: block; }
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: 12px 16px; border-top: 1px solid var(--acct-table-row-line);
}
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-body .woocommerce-table-row:first-child { border-top: 0; }
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-footer { display: block; background: var(--acct-table-head-bg); }
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-footer .woocommerce-table-row { border-top: 1px solid var(--acct-table-row-line); padding: 10px 16px; font-size: 14px; }
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-row > span:last-child { text-align: right; white-space: nowrap; }
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-footer .order_total span:last-child,
#enttec-account.acct-ds2 .shop_table.order_details .woocommerce-table-footer .total span:last-child { font-weight: 700; color: var(--acct-text); }
/* Customer/billing/shipping address blocks as clean cards under their heading. */
#enttec-account.acct-ds2 .woocommerce-customer-details address {
    display: block; font-style: normal; line-height: 1.65; color: var(--acct-text-2);
    border: 1px solid var(--acct-table-border); border-radius: var(--acct-radius-lg); padding: 16px 18px; margin: 0;
}

/* ============================================================================
 * "GO BACK" header button (edit-account, edit-address, new-ticket). The
 * template ships a Bootstrap dark-outline pill (.btn-outline-dark .rounded-xxxl);
 * restyle to the DS neutral button. Scoped to .rounded-xxxl inside a heading so
 * the .rounded-xl Edit buttons are untouched.
 * ==========================================================================*/
#enttec-account.acct-ds2 h2 a.btn-outline-dark.rounded-xxxl {
    display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 20px !important;
    background: #fff !important;
    color: var(--acct-text-2) !important;
    border: 1.5px solid var(--acct-border) !important;
    border-radius: var(--acct-radius) !important;
    font-family: var(--acct-font-body) !important;
    font-size: 14px !important; font-weight: 600; line-height: 1.2;
    text-transform: none; letter-spacing: 0; box-shadow: none;
    transition: background var(--acct-dur) var(--acct-ease), border-color var(--acct-dur) var(--acct-ease), color var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 h2 a.btn-outline-dark.rounded-xxxl:hover {
    background: var(--acct-surface-2) !important;
    border-color: #b0b6bc !important;
    color: var(--acct-text) !important;
    text-decoration: none;
}
#enttec-account.acct-ds2 h2 a.btn-outline-dark.rounded-xxxl:focus-visible {
    outline: none; box-shadow: var(--acct-ring-soft) !important;
}

/* ============================================================================
 * DS BRIDGES: auto-adopt common non-DS markup across the account pages. Rather
 * than rewrite every template, map the common Bootstrap/WooCommerce patterns
 * onto the DS look, the same tactic as the .shop_table table standard.
 * ==========================================================================*/

/* Bridge 1: WooCommerce notices adopt the DS alert look. */
#enttec-account.acct-ds2 .woocommerce-info,
#enttec-account.acct-ds2 .woocommerce-message,
#enttec-account.acct-ds2 .woocommerce-error {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 14px 16px !important; margin: 0 0 20px;
    border: 1px solid !important; border-left-width: 2px !important; border-radius: var(--acct-radius-lg) !important;
    font-size: 14px !important; line-height: 1.5; list-style: none; box-shadow: none !important;
}
#enttec-account.acct-ds2 .woocommerce-info { background: var(--acct-info-tint) !important; border-color: var(--acct-info-line) !important; color: var(--acct-info) !important; }
#enttec-account.acct-ds2 .woocommerce-message { background: var(--acct-success-tint) !important; border-color: var(--acct-success-line) !important; color: var(--acct-success-text) !important; }
#enttec-account.acct-ds2 .woocommerce-error { background: var(--acct-danger-tint) !important; border-color: var(--acct-danger-line) !important; color: var(--acct-danger-text) !important; }
#enttec-account.acct-ds2 .woocommerce-info::before,
#enttec-account.acct-ds2 .woocommerce-message::before,
#enttec-account.acct-ds2 .woocommerce-error::before { content: none !important; }

/* Bridge 2: Bootstrap / WC action buttons adopt the DS button look at the sm
 * size (32px). Kept at low specificity so the higher-specificity .shop_table td
 * row-action pills (18px) are unaffected. */
#enttec-account.acct-ds2 .btn-primary,
#enttec-account.acct-ds2 .btn-outline-dark,
#enttec-account.acct-ds2 .btn-dark,
#enttec-account.acct-ds2 .btn-outline-secondary,
#enttec-account.acct-ds2 .btn-outline-danger,
#enttec-account.acct-ds2 .btn-danger,
#enttec-account.acct-ds2 .woocommerce-Button {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--btn-gap-sm);
    min-height: var(--btn-h-sm); padding: 0 var(--btn-px-sm);
    border: 1.5px solid transparent; border-radius: var(--acct-radius) !important;
    font-family: var(--acct-font-body) !important; font-size: var(--btn-fs-sm) !important; font-weight: 600; line-height: 1.2;
    text-transform: none !important; letter-spacing: 0; box-shadow: none;
    transition: background var(--acct-dur) var(--acct-ease), border-color var(--acct-dur) var(--acct-ease), color var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 .btn-block { display: flex !important; width: 100%; }
#enttec-account.acct-ds2 .btn-primary,
#enttec-account.acct-ds2 .woocommerce-Button { background: var(--acct-blue) !important; color: #fff !important; border-color: var(--acct-blue) !important; }
#enttec-account.acct-ds2 .btn-primary:hover,
#enttec-account.acct-ds2 .woocommerce-Button:hover { background: var(--acct-blue-hover) !important; color: #fff !important; }
#enttec-account.acct-ds2 .btn-outline-dark,
#enttec-account.acct-ds2 .btn-dark,
#enttec-account.acct-ds2 .btn-outline-secondary { background: #fff !important; color: var(--acct-text-2) !important; border-color: var(--acct-border) !important; }
#enttec-account.acct-ds2 .btn-outline-dark:hover,
#enttec-account.acct-ds2 .btn-dark:hover,
#enttec-account.acct-ds2 .btn-outline-secondary:hover { background: var(--acct-surface-2) !important; border-color: #b0b6bc !important; color: var(--acct-text) !important; }
#enttec-account.acct-ds2 .btn-outline-danger,
#enttec-account.acct-ds2 .btn-danger { background: #fff !important; color: var(--acct-danger-text) !important; border-color: var(--acct-danger-line) !important; }
#enttec-account.acct-ds2 .btn-outline-danger:hover,
#enttec-account.acct-ds2 .btn-danger:hover { background: var(--acct-danger-tint) !important; color: var(--acct-danger) !important; border-color: var(--acct-danger) !important; }

/* Bridge 2b: WooCommerce's bare `.button` action links that carry no Bootstrap
 * .btn-* or .woocommerce-Button class (e.g. "Order again" on view-order) render
 * as the theme's dark default. Style them as the DS neutral secondary. Scoped
 * to the known standalone cases (.order-again) so the higher-specificity
 * .shop_table td row-action pills and the blue empty-state CTAs are untouched. */
#enttec-account.acct-ds2 .order-again .button {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--btn-gap-sm);
    min-height: var(--btn-h-sm); padding: 0 var(--btn-px-sm);
    border: 1.5px solid var(--acct-border) !important; border-radius: var(--acct-radius) !important;
    background: #fff !important; color: var(--acct-text-2) !important;
    font-family: var(--acct-font-body) !important; font-size: var(--btn-fs-sm) !important; font-weight: 600; line-height: 1.2;
    text-transform: none !important; letter-spacing: 0; box-shadow: none;
    transition: background var(--acct-dur) var(--acct-ease), border-color var(--acct-dur) var(--acct-ease), color var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 .order-again .button:hover {
    background: var(--acct-surface-2) !important; border-color: #b0b6bc !important; color: var(--acct-text) !important; text-decoration: none;
}

/* Bridge 3: order / subscription status <mark> becomes a badge (view-order). */
#enttec-account.acct-ds2 mark.order-status {
    background: var(--acct-badge-success-bg); color: var(--acct-badge-success-text); padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
}

/* Bridge 4: form controls. WC/native inputs, textareas, selects and checkboxes
 * adopt the DS field look. Targets the WC classes so the licenses-redesign
 * inputs (.section-search/.hero-search) are not touched. */
#enttec-account.acct-ds2 .woocommerce-Input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
#enttec-account.acct-ds2 input.input-text,
#enttec-account.acct-ds2 textarea.woocommerce-Input,
#enttec-account.acct-ds2 textarea.input-text {
    font-family: var(--acct-font-body) !important; font-size: 14px !important; color: var(--acct-text-2) !important; background: #fff !important;
    border: 1px solid var(--acct-border) !important; border-radius: var(--acct-radius) !important;
    padding: 0 14px !important; min-height: 42px !important; box-shadow: none !important;
    -webkit-appearance: none; appearance: none;
    transition: border-color var(--acct-dur) var(--acct-ease), box-shadow var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 textarea.woocommerce-Input,
#enttec-account.acct-ds2 textarea.input-text { padding: 10px 14px !important; min-height: 92px !important; line-height: 1.5; }
#enttec-account.acct-ds2 .woocommerce-Input:focus,
#enttec-account.acct-ds2 .input-text:focus { outline: none !important; border-color: var(--acct-blue) !important; box-shadow: var(--acct-ring-soft) !important; }
#enttec-account.acct-ds2 select:not([multiple]) {
    font-family: var(--acct-font-body) !important; font-size: 14px !important; color: var(--acct-text-2) !important; background: #fff !important;
    border: 1px solid var(--acct-border) !important; border-radius: var(--acct-radius) !important;
    padding: 0 12px !important; min-height: 42px !important; box-shadow: none !important;
}
#enttec-account.acct-ds2 select:not([multiple]):focus { outline: none !important; border-color: var(--acct-blue) !important; box-shadow: var(--acct-ring-soft) !important; }
/* Native checkboxes / radios drawn as the DS control (matches .enttec-check).
 * .enttec-check's own hidden input is protected above, so this only hits bare
 * native controls (login remember-me, payment radios, etc.). */
#enttec-account.acct-ds2 input[type="checkbox"],
#enttec-account.acct-ds2 input[type="radio"] {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    flex: 0 0 auto; width: 20px; height: 20px; margin: 0; vertical-align: middle;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--acct-border); background: #fff; color: #fff; font-size: 11px; cursor: pointer;
    transition: background var(--acct-dur) var(--acct-ease), border-color var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 input[type="checkbox"] { border-radius: 5px; }
#enttec-account.acct-ds2 input[type="radio"] { border-radius: 50%; }
#enttec-account.acct-ds2 input[type="checkbox"]:checked,
#enttec-account.acct-ds2 input[type="radio"]:checked { background: var(--acct-blue); border-color: var(--acct-blue); }
/* fa-check glyph, same tick as .enttec-check (both doc + live load Font Awesome 6). */
#enttec-account.acct-ds2 input[type="checkbox"]:checked::after {
    content: "\f00c"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free"; font-weight: 900;
}
#enttec-account.acct-ds2 input[type="radio"]:checked::after {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff;
}
#enttec-account.acct-ds2 input[type="checkbox"]:focus-visible,
#enttec-account.acct-ds2 input[type="radio"]:focus-visible { outline: none; border-color: var(--acct-blue); box-shadow: var(--acct-ring-soft); }
#enttec-account.acct-ds2 input[type="checkbox"]:disabled,
#enttec-account.acct-ds2 input[type="radio"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* Bridge 5: WooCommerce Subscriptions auto-renew toggle -> DS switch.
 * The widget is <a class="subscription-auto-renew-toggle --on/--off/--disabled">
 * (the track) with an <i class="__i"> (the knob). Neutralise WC's own
 * pseudo-drawn parts and redraw the DS switch (42x24 track, 20px knob). */
#enttec-account.acct-ds2 .subscription-auto-renew-toggle {
    position: relative; display: inline-block; width: 42px; height: 24px;
    background: var(--acct-disabled) !important; border: 0 !important; border-radius: 24px !important;
    text-indent: -9999px; overflow: hidden; box-shadow: none !important;
    transition: background var(--acct-dur) var(--acct-ease); cursor: pointer;
}
#enttec-account.acct-ds2 .subscription-auto-renew-toggle::before,
#enttec-account.acct-ds2 .subscription-auto-renew-toggle::after { content: none !important; }
#enttec-account.acct-ds2 .subscription-auto-renew-toggle .subscription-auto-renew-toggle__i {
    position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; margin: 0;
    background: #fff !important; border-radius: 50% !important; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    text-indent: 0; transition: transform var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 .subscription-auto-renew-toggle .subscription-auto-renew-toggle__i::before,
#enttec-account.acct-ds2 .subscription-auto-renew-toggle .subscription-auto-renew-toggle__i::after { content: none !important; }
#enttec-account.acct-ds2 .subscription-auto-renew-toggle--on { background: var(--acct-blue) !important; }
#enttec-account.acct-ds2 .subscription-auto-renew-toggle--on .subscription-auto-renew-toggle__i { transform: translateX(18px); }
#enttec-account.acct-ds2 .subscription-auto-renew-toggle--disabled { opacity: 0.5; pointer-events: none; }

/* ============================================================================
 * TABLES that bypass .shop_table (two remaining non-standard tables), bridged
 * to the account table look. Scoped bridges, no template markup changes.
 * ==========================================================================*/

/* Bridge 6: .tablepress tables (subscription-totals.php voucher + licence
 * tables). One carries an inline style="border...box-shadow..." on the <table>,
 * so the card chrome uses !important to defeat that inline rule. */
#enttec-account.acct-ds2 table.tablepress {
    width: 100%; margin: 0 0 32px;
    border-collapse: separate !important; border-spacing: 0;
    background: #fff !important;
    border: 1px solid var(--acct-table-border) !important;
    border-radius: var(--acct-radius-lg) !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05) !important;
    overflow: hidden;
    font-family: var(--acct-font-body); color: var(--acct-text-2); font-size: 14px;
}
/* First row of the no-thead voucher table doubles as the header band; the
 * licence table has a real <thead>. Treat both the leading .odd row and thead
 * cells as the header. */
#enttec-account.acct-ds2 table.tablepress thead td,
#enttec-account.acct-ds2 table.tablepress thead th,
#enttec-account.acct-ds2 table.tablepress > tbody > tr.odd:first-child > td,
#enttec-account.acct-ds2 table.tablepress > tr.odd:first-child > td {
    background: var(--acct-table-head-bg) !important; color: var(--acct-table-head-text) !important;
    padding: 13px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px;
    border: 0 !important; border-bottom: 1px solid var(--acct-border-soft) !important; text-align: left;
}
#enttec-account.acct-ds2 table.tablepress td {
    padding: 12px 16px; font-size: 14px; color: var(--acct-text-2);
    border: 0 !important; border-top: 1px solid var(--acct-table-row-line); vertical-align: middle;
}
#enttec-account.acct-ds2 table.tablepress tr:first-child td { border-top: 0; }
#enttec-account.acct-ds2 table.tablepress a { color: var(--acct-blue); text-decoration: none; font-weight: 600; }
#enttec-account.acct-ds2 table.tablepress a:hover { color: var(--acct-blue-hover); text-decoration: underline; }
#enttec-account.acct-ds2 table.tablepress .button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 0; padding: 6px 14px;
    border: 1px solid var(--acct-danger-line); border-radius: 18px;
    background: #fff; color: var(--acct-danger-text);
    font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer;
    transition: background var(--acct-dur) var(--acct-ease), color var(--acct-dur) var(--acct-ease), border-color var(--acct-dur) var(--acct-ease);
}
#enttec-account.acct-ds2 table.tablepress .button:hover { background: var(--acct-danger-tint); color: var(--acct-danger); border-color: var(--acct-danger); }

/* Bridge 7: .table.table-borderless label/value tables (my-account-details.php
 * personal-info + address cards). First cell reads as a muted label. */
#enttec-account.acct-ds2 table.table.table-borderless { width: 100%; margin: 0; color: var(--acct-text-2); font-family: var(--acct-font-body); }
#enttec-account.acct-ds2 table.table.table-borderless td {
    padding: 8px 0; font-size: 14px; border: 0; vertical-align: top;
}
#enttec-account.acct-ds2 table.table.table-borderless tr + tr td { border-top: 1px solid var(--acct-table-row-line); }
#enttec-account.acct-ds2 table.table.table-borderless td:first-child {
    width: 42%; color: var(--acct-text-muted); font-weight: 500; padding-right: 16px;
}
#enttec-account.acct-ds2 table.table.table-borderless td:last-child { color: var(--acct-text); font-weight: 500; }

/* ============================================================================
 * LOCALE SWITCHER (account header language dropdown).
 *
 * style/locale-switcher.css loads GLOBALLY and is reverted to its pre-v2
 * grey/Bootstrap look, which is what prod shows. The switcher only ever renders
 * inside .acct-header, which carries .acct-ds2 when active, so these DS-blue
 * overrides fully restyle it on test/local and leave prod untouched. They win
 * over the base via the extra .acct-ds2 class (+1 specificity, and the toggle
 * selector reaches 3 classes to beat the base's `body ...` rule) plus later
 * load order. Pairs with the flag-gated FA chevron in i18n.php: prod keeps the
 * SVG chevron + base CSS; test gets the FA `<i>` styled here.
 * ==========================================================================*/
/* Toggle: ghost control, DS radius, muted label (3-class scope beats base
 * `body .enttec-locale-switcher .enttec-locale-switcher__toggle`). */
.acct-ds2 .enttec-locale-switcher .enttec-locale-switcher__toggle {
    gap: 0.5rem !important;
    border: 1px solid transparent !important;   /* ghost: no chrome until hover/open */
    border-radius: var(--acct-radius) !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 13px !important; font-weight: 600 !important;
    color: var(--acct-text-muted) !important;
    transition: background-color .17s var(--acct-ease), color .17s var(--acct-ease), border-color .17s var(--acct-ease);
}
.acct-ds2 .enttec-locale-switcher .enttec-locale-switcher__toggle:hover {
    background-color: var(--acct-surface-2) !important;
    color: var(--acct-text) !important;
    border-color: var(--acct-border-soft) !important;
}
.acct-ds2 .enttec-locale-switcher .enttec-locale-switcher__toggle[aria-expanded="true"] {
    background-color: var(--acct-surface-2) !important;
    color: var(--acct-text) !important;
    border-color: var(--acct-blue) !important;   /* signals the open panel */
}
.acct-ds2 .enttec-locale-switcher .enttec-locale-switcher__toggle:focus-visible {
    box-shadow: var(--acct-ring-soft) !important;
}
.acct-ds2 .enttec-locale-switcher .enttec-locale-switcher__toggle:focus:not(:focus-visible) {
    box-shadow: none !important;
}
/* Chevron: flips to signal the open panel; size the FA glyph shown when active. */
.acct-ds2 .enttec-locale-switcher__chevron { transition: transform .17s var(--acct-ease); }
.acct-ds2 .enttec-locale-switcher__toggle[aria-expanded="true"] .enttec-locale-switcher__chevron { transform: rotate(180deg); opacity: 1; }
.acct-ds2 .enttec-locale-switcher__chevron i { display: block; font-size: 10px; line-height: 1; }
/* Dropdown panel: DS card. Cap the tall (16-locale) list with a scroll instead
 * of a ~620px panel. */
.acct-ds2 .enttec-locale-switcher__menu {
    min-width: 180px; max-height: 320px; overflow-y: auto;
    border: 1px solid var(--acct-table-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16,24,40,0.10), 0 2px 6px rgba(16,24,40,0.06);
}
/* Rows: fixed height, text vertically centred, labels left-aligned so RTL
 * locales (Arabic) don't right-align and read ragged against the LTR list. */
.acct-ds2 .enttec-locale-switcher__option {
    display: flex; align-items: center; justify-content: flex-start;
    min-height: 38px; padding: 0 16px !important; color: var(--acct-text-2);
    text-align: left; line-height: 1.3;
    transition: background-color .12s ease, color .12s ease;
}
.acct-ds2 .enttec-locale-switcher__option-label { text-align: left; }
.acct-ds2 .enttec-locale-switcher__option:hover,
.acct-ds2 .enttec-locale-switcher__option:focus { background-color: #f0f8fb; color: var(--acct-blue); }
/* Selected reads via colour + check; kill the base grey background fill. */
.acct-ds2 .enttec-locale-switcher__option[aria-selected="true"] {
    background-color: transparent; color: var(--acct-blue); font-weight: 600;
}
.acct-ds2 .enttec-locale-switcher__option[aria-selected="true"]::after {
    content: "\2713"; margin-left: auto; padding-left: 0.75rem; color: var(--acct-blue); font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
    .acct-ds2 .enttec-locale-switcher .enttec-locale-switcher__toggle,
    .acct-ds2 .enttec-locale-switcher__chevron,
    .acct-ds2 .enttec-locale-switcher__option { transition: none !important; }
}

/* ============================================================================
 * DASHBOARD promo cards (new-dashboard.php).
 *
 * The template builds each card from three flat <p> siblings (title / subtext /
 * button) styled with Bootstrap utilities (pt-4, py-4, mt-auto, w-75). Fixes,
 * all CSS so the markup stays untouched (prod-safe):
 *  - card title uses the heading font (it is a bold <p>, so it was body font);
 *  - the CTA is sized as a real primary button (Bridge 2's sm size is too small
 *    and the theme's weight too heavy for a hero CTA);
 *  - spacing follows proximity: title + subtext are one tight group (~6px), the
 *    button sits ~12px below and spans the full text width (killing w-75 +
 *    mt-auto, which pushed it to the card bottom with a big disconnected gap).
 * ==========================================================================*/
/* Card title: heading font (Montserrat), not bold body text. min-height
 * reserves two lines so a title that wraps (card 1) doesn't push its button
 * below the others: the three CTAs stay aligned in the row while each still
 * sits close to its own text. */
#enttec-account.acct-ds2 .dashboard-widget .col section > p.not-found.font-weight-bold {
    font-family: var(--acct-font-head); font-size: 16px; font-weight: 600;
    color: var(--acct-text); line-height: 1.3; min-height: calc(1.25rem + 2.6em);
    padding-top: 1.25rem; padding-bottom: 0; margin-bottom: 0;
}
/* Subtext: tight under the title (one perceptual group), no oversized padding. */
#enttec-account.acct-ds2 .dashboard-widget .col section > p.not-found:not(.font-weight-bold) {
    padding-top: 6px !important; padding-bottom: 0 !important; margin: 0;
    color: var(--acct-text-3); font-size: 14px; line-height: 1.5;
}
/* Button wrapper: full content width (kill w-75), 12px below the text (kill
 * mt-auto's bottom-push), aligned to the px-5 text gutter. */
#enttec-account.acct-ds2 .dashboard-widget .col section > p:last-child {
    width: auto !important; max-width: none !important;
    margin: 12px 3rem 0 !important;
}
/* Promo-card CTA: real primary size + weight (overrides the sm Bridge 2 size). */
#enttec-account.acct-ds2 .dashboard-widget .col section .btn-primary {
    min-height: 44px !important; padding: 0 20px !important;
    font-size: 15px !important; font-weight: 600 !important;
    border-radius: var(--acct-radius) !important;
}
/* Quick Actions: tertiary (ghost) buttons. These are low-emphasis shortcuts
 * below the primary cards, so drop the neutral-outline chrome to transparent +
 * muted label; a subtle surface appears on hover. Only the dashboard's
 * quick-action links (not inside a .col card) are hit. */
#enttec-account.acct-ds2 .dashboard-widget > a.btn-outline-secondary {
    background: transparent !important; border: 1px solid transparent !important;
    color: var(--acct-text-2) !important;
}
#enttec-account.acct-ds2 .dashboard-widget > a.btn-outline-secondary:hover {
    background: var(--acct-surface-2) !important; border-color: transparent !important; color: var(--acct-text) !important;
}
#enttec-account.acct-ds2 .dashboard-widget > a.btn-outline-secondary i { color: var(--acct-text-muted); }
#enttec-account.acct-ds2 .dashboard-widget > a.btn-outline-secondary:hover i { color: var(--acct-blue); }

/* ============================================================================
 * AUTH FORMS (login / register / lost-password / reset), now wrapped in
 * #enttec-account.acct-ds2 so the bridges apply. These tune the auth-specific
 * bits. Scoped to #customer_login (only present on the auth pages).
 * ==========================================================================*/
/* Breathing room between the account header and the login/register cards. */
#enttec-account.acct-ds2 #customer_login { margin-top: 40px; }
/* Submit buttons: one size up + regular weight (defeats the template's
 * .font-weight-bold and rounded-pill). */
#enttec-account.acct-ds2 #customer_login button[type="submit"] {
    min-height: 44px !important; padding: 0 26px !important;
    font-size: 15px !important; font-weight: 600 !important;
}
/* One consistent type size for labels + helper + lost-password text. */
#enttec-account.acct-ds2 #customer_login label,
#enttec-account.acct-ds2 #customer_login p,
#enttec-account.acct-ds2 #customer_login .woocommerce-LostPassword a { font-size: 14px; }
#enttec-account.acct-ds2 #customer_login .woocommerce-form-row > label {
    display: inline-block; margin-bottom: 6px; font-weight: 500; color: var(--acct-text-3);
}
/* Remember-me: DS checkbox row (the box itself is drawn by the native-checkbox
 * bridge); align the box + label like .enttec-check. */
#enttec-account.acct-ds2 #customer_login .woocommerce-form__label-for-checkbox {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 400; color: var(--acct-text-2); cursor: pointer; margin: 0;
}
/* Privacy fine-print: smaller. */
#enttec-account.acct-ds2 #customer_login .woocommerce-privacy-policy-text {
    font-size: 12px; color: var(--acct-text-muted); line-height: 1.5;
}

/* ============================================================================
 * REDUCED MOTION (house rule): the nav icon nudge is motion-only decoration;
 * the colour change carries the state. The base file already zeroes the shared
 * transitions/animations; this only covers the ds2 nav icon transforms.
 * ==========================================================================*/
@media (prefers-reduced-motion: reduce) {
    #enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li:hover .fa,
    #enttec-account.acct-ds2 .woocommerce-MyAccount-navigation li:active { transform: none !important; }
}
