:root {
    --cartola-primary: #ae2828;
    --cartola-gold: #ffc437;
    --cartola-dark: #262b2e;
}

.fi-topbar-ctn .fi-topbar {
    position: relative;
    background-color: var(--cartola-primary) !important;
    border-bottom: 0;
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-topbar-ctn .fi-topbar .fi-icon-btn,
.fi-topbar-ctn .fi-topbar .fi-topbar-item-btn,
.fi-topbar-ctn .fi-topbar .fi-topbar-item-label {
    color: #fff !important;
}

.fi-topbar-ctn .fi-topbar .fi-icon-btn:hover,
.fi-topbar-ctn .fi-topbar .fi-topbar-item-btn:hover {
    background-color: rgb(255 255 255 / 0.12) !important;
}

/*
 * Filament no desktop esconde o X (close-sidebar) e usa o chevron ao lado do logo.
 * Com o logo centralizado + pointer-events none, o chevron some/não clica.
 * Mantemos hamburger + X no canto, como no mobile / produção.
 */
@media (min-width: 64rem) {
    /* Sem !important: o x-show do Alpine (style inline) continua escondendo quando fechado. */
    .fi-topbar-ctn .fi-topbar .fi-topbar-close-sidebar-btn {
        display: inline-flex;
    }

    .fi-topbar-ctn .fi-topbar .fi-topbar-collapse-sidebar-btn-ctn {
        display: none !important;
    }
}

/* Filament esconde o logo no topbar abaixo de lg — forçamos visível e centralizado. */
.fi-topbar-ctn .fi-topbar .fi-topbar-start {
    display: flex !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-inline-end: 0;
    align-items: center;
    justify-content: center;
    max-width: min(240px, calc(100% - 6rem));
    pointer-events: none;
}

.fi-topbar-ctn .fi-topbar .fi-topbar-start a {
    pointer-events: auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

.fi-topbar-ctn .fi-topbar .fi-logo {
    display: block !important;
    margin-inline-start: 0 !important;
    max-height: 2.5rem;
    height: 2.5rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

@media (max-width: 640px) {
    .fi-topbar-ctn .fi-topbar .fi-logo {
        max-height: 2.1rem;
        height: 2.1rem;
    }
}

.fi-topbar-ctn .fi-topbar .fi-user-menu {
    display: none !important;
}

/*
 * O logo tem “CARTOLA FC” em branco — some no fundo claro do sidebar.
 * Fundo vermelho deixa o logo legível, igual ao header do site.
 */
.fi-sidebar-header-ctn,
.fi-sidebar-header {
    background-color: var(--cartola-primary) !important;
    border-bottom: 0 !important;
}

.fi-sidebar-header .fi-logo img,
.fi-sidebar-header-logo-ctn img {
    display: block;
    max-height: 2.5rem;
    height: 2.5rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.fi-sidebar-header .fi-icon-btn {
    color: #fff !important;
}

.fi-sidebar-header .fi-icon-btn:hover {
    background-color: rgb(255 255 255 / 0.12) !important;
}

/* Sidebar do site só via hamburger — evita 2 painéis com o submenu da conta */
.fi-body-has-sidebar-fully-collapsible-on-desktop .fi-main-ctn:not(.fi-main-ctn-sidebar-open) {
    margin-inline-start: 0 !important;
}

/* Em Minha Conta: layout = hamburger + submenu + conteúdo (como produção) */
.fi-body:has(.member-account-nav) .fi-main-ctn:not(.fi-main-ctn-sidebar-open) {
    margin-inline-start: 0 !important;
    max-width: none;
}

.fi-body:has(.member-account-nav) .fi-main > .fi-page {
    max-width: 1140px;
}

.member-account-sidebar-sync {
    display: none !important;
}

.cartola-member-accent-bar {
    height: 4px;
    background: var(--cartola-gold);
}

/* Área autenticada: fundo cinza claro como produção */
.fi-body:not(:has(.fi-simple-layout)) .fi-layout,
.fi-body:not(:has(.fi-simple-layout)) .fi-main,
.fi-body:not(:has(.fi-simple-layout)) .fi-main-ctn {
    background: #f7f7f7 !important;
}

.fi-body:not(:has(.fi-simple-layout)) .fi-main > .fi-page {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.fi-sidebar-nav .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: rgb(174 40 40 / 0.08);
}

.member-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 3.5rem;
}

.fi-main .fi-page > .fi-page-content {
    padding-bottom: 3rem;
}

.member-dashboard-benefits-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.member-dashboard-actions {
    margin-top: 1.25rem;
}

.member-dashboard-empty {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    background: #fff;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    color: var(--cartola-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}

.member-dashboard-empty p {
    margin: 0;
}

.member-dashboard-empty__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border-radius: 9999px;
    background: var(--cartola-primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
}

.member-dashboard-empty__cta:hover {
    filter: brightness(1.05);
}

.member-account-details {
    display: grid;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.member-subscription-card {
    border-radius: 0.75rem;
    border: 1px solid rgb(229 231 235);
    padding: 1rem;
}

.member-subscription-card--spaced {
    margin-bottom: 1rem;
}

.member-benefits-content {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--cartola-dark);
}

.member-benefits-content p {
    margin: 0 0 1.25rem;
}

.member-benefits-content > :last-child {
    margin-bottom: 0;
}

.member-benefits-content figure + p,
.member-benefits-content .wp-block-image + p {
    margin-top: 1.25rem;
}

.member-benefits-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.member-benefits-content .wp-block-image {
    margin: 0 0 1.25rem;
    text-align: center;
}

.member-benefits-content .wp-block-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.member-benefits-content .wp-block-button__link {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 9999px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.35;
    transition: opacity 0.15s ease;
}

.member-benefits-content .wp-block-button__link:hover {
    opacity: 0.92;
}

.member-benefits-content .has-vivid-green-cyan-background-color {
    background-color: #00d084 !important;
    color: #fff !important;
}

.member-benefits-content .has-pale-cyan-blue-background-color {
    background-color: #8ed1fc !important;
    color: #000 !important;
    border: 2px solid #000;
}

.member-benefits-content .has-vivid-red-background-color {
    background-color: var(--cartola-primary) !important;
    color: #fff !important;
}

.member-benefits-content .has-luminous-vivid-amber-background-color {
    background-color: var(--cartola-gold) !important;
    color: #000 !important;
}

.member-benefits-content .has-luminous-vivid-orange-background-color {
    background-color: #ff6900 !important;
    color: #fff !important;
}

.member-account-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .member-account-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Login */
.fi-simple-layout {
    position: relative;
    min-height: 100vh;
    background: #fff;
    padding-top: 72px;
    padding-bottom: 0;
}

.fi-simple-layout::before,
.fi-simple-layout::after {
    display: none !important;
}

.cartola-site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--cartola-primary);
    padding: 10px 1rem;
    display: flex;
    justify-content: center;
}

.cartola-site-header img {
    max-height: 48px;
    width: auto;
}

.fi-simple-main-ctn {
    position: relative;
    z-index: 1;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding-top: 1.25rem !important;
    padding-bottom: 2rem !important;
    min-height: calc(100vh - 72px);
    background: #fff;
}

.fi-simple-main {
    width: 100%;
    max-width: 28rem;
    margin-top: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-shadow: none !important;
    background: transparent !important;
}

.fi-simple-page {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    border-top: 4px solid var(--cartola-gold);
    box-shadow: none !important;
}

.cartola-password-reset-success {
    margin: 1.25rem 1.25rem 0;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    background: #eaf8ef;
    border: 1px solid #9ad4b0;
    color: #0a7a2f;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

/* Evita o toast flutuante do Filament na área de login após reset */
.fi-simple-layout .fi-no-notification {
    display: none !important;
}

.cartola-reset-sent-copy {
    margin: 0.75rem auto 0;
    max-width: 22rem;
    color: #6c767c;
    font-size: 0.95rem;
    line-height: 1.5;
}

.fi-simple-layout:has(.cartola-reset-sent-copy) #form,
.fi-simple-layout:has(.cartola-reset-sent-copy) .fi-sc-form,
.fi-simple-layout:has(.cartola-reset-sent-copy) .fi-fo-field-wrp,
.fi-simple-layout:has(.cartola-reset-sent-copy) .fi-form-actions,
.fi-simple-layout:has(.cartola-reset-sent-copy) .fi-ac,
.fi-simple-layout:has(.cartola-reset-sent-copy) button[type="submit"] {
    display: none !important;
}

.fi-simple-page-content {
    padding: 2rem 2rem 1.5rem;
}

.fi-simple-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.fi-simple-layout .fi-simple-header .fi-logo {
    display: none;
}

.fi-simple-header .fi-logo img {
    max-height: 3.5rem;
    width: auto;
    margin: 0 auto 1rem;
}

.fi-simple-header-heading {
    color: var(--cartola-dark);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.fi-simple-header-subheading {
    margin-top: 0.5rem;
    color: #6c767c;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

.fi-simple-page .fi-fo-field-wrp-label,
.fi-simple-page .fi-fo-field-label,
.fi-simple-page .fi-fo-field-label-content {
    color: var(--cartola-dark) !important;
    font-weight: 600;
}

.fi-simple-page .fi-input-wrp {
    border-radius: 0.5rem;
}

.fi-simple-page .fi-btn.fi-color-primary {
    background-color: var(--cartola-primary) !important;
    border-color: var(--cartola-primary) !important;
    color: #fff !important;
    font-weight: 600;
    padding-block: 0.7rem;
    border-radius: 0.5rem;
    width: 100%;
    justify-content: center;
}

.fi-simple-page .fi-btn.fi-color-primary:hover {
    background-color: #962020 !important;
    border-color: #962020 !important;
}

.cartola-login-footer {
    margin: 1.25rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.875rem;
}

.cartola-login-footer a {
    color: var(--cartola-primary);
    font-weight: 600;
    text-decoration: none;
}

.cartola-login-footer a:hover {
    text-decoration: underline;
}

.member-payments {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.member-payments-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.member-payments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.member-payments-table th,
.member-payments-table td {
    padding: 0.85rem 0.5rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgb(229 231 235);
    white-space: nowrap;
}

.member-payments-table th:first-child,
.member-payments-table td:first-child {
    padding-left: 0;
}

.member-payments-table th:last-child,
.member-payments-table td:last-child {
    padding-right: 0;
}

.member-payments-table th {
    color: rgb(107 114 128);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: normal;
}

.member-payments-table tbody tr:last-child th,
.member-payments-table tbody tr:last-child td {
    border-bottom: none;
}

.member-payments-table__plan {
    font-weight: 600;
    color: var(--cartola-dark);
    white-space: normal;
    min-width: 120px;
}

.member-payments-table__action {
    width: 1%;
    text-align: right;
}

.member-payment-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.member-payment-badge--pending {
    background: rgb(255 196 55 / 0.25);
    color: #8a6200;
}

.member-payment-badge--paid {
    background: rgb(0 208 138 / 0.2);
    color: #0a7a2f;
}

.member-payment-badge--cancelled {
    background: rgb(108 118 124 / 0.18);
    color: #4b5563;
}

.member-pending-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgb(255 196 55 / 0.18);
    border: 1px solid rgb(255 196 55 / 0.55);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}

.member-pending-alert__title {
    margin: 0 0 0.25rem;
    font-weight: 700;
    color: #8a6200;
}

.member-pending-alert__text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--cartola-dark);
}

.member-pending-alert__content {
    min-width: 0;
    flex: 1;
}

.impersonation-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--cartola-gold);
    color: var(--cartola-dark);
    border-radius: 0.5rem;
}

.impersonation-banner__text {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.impersonation-banner__button {
    appearance: none;
    border: 0;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    background: var(--cartola-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.impersonation-banner__button:hover {
    filter: brightness(0.95);
}

/* Mobile: chips + espaço abaixo do header */
.member-account-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 1.25rem;
    padding: 0;
    background: transparent;
    border: 0;
}

.fi-page:has(.member-account-nav) {
    padding-top: 1.25rem;
}

.member-account-nav a {
    display: inline-flex;
    align-items: center;
    color: #3b3a3a !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    white-space: nowrap;
    background: #bebebe;
    border-radius: 4px;
    padding: 4px 10px;
    line-height: 1.3;
}

.member-account-nav a:hover {
    color: #fff !important;
    background: #34b5d7;
}

.member-account-nav a.is-active {
    color: #fff !important;
    background: #34b5d7;
}

/* Desktop: submenu à esquerda + conteúdo à direita (como produção) */
@media (min-width: 992px) {
    .fi-page:has(.member-account-nav) {
        display: grid;
        grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
        align-items: start;
        gap: 1.5rem;
        padding-top: 1.5rem;
        padding-bottom: 2rem;
    }

    .fi-page:has(.member-account-nav) > .impersonation-banner {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav {
        grid-column: 1;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 30px;
        background: #fff;
        border-radius: 8px;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav a {
        display: block;
        width: 100%;
        margin: 0 0 2rem;
        padding: 0;
        background: transparent !important;
        border-radius: 0;
        color: #3b3a3a !important;
        line-height: 1.35;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav a:last-child {
        margin-bottom: 0;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav a:hover {
        color: #34b5d7 !important;
        background: transparent !important;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav a.is-active {
        color: #34b5d7 !important;
        background: transparent !important;
    }

    .fi-page:has(.member-account-nav) > .fi-page-header-main-ctn {
        grid-column: 2;
        min-width: 0;
        background: #fff;
        border-radius: 8px;
        padding: 1.5rem 1.75rem 2rem;
    }

    .fi-page:has(.member-account-nav) .fi-header {
        margin-bottom: 1rem;
    }
}

@media (max-width: 991px) {
    .fi-page:has(.member-account-nav) {
        padding-top: 1.5rem;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav {
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 0.25rem;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav::-webkit-scrollbar {
        display: none;
    }

    .fi-page:has(.member-account-nav) > .member-account-nav a {
        flex: 0 0 auto;
        font-size: clamp(12px, 3.6vw, 17px) !important;
        padding: 4px 8px;
    }

    .fi-page:has(.member-account-nav) > .fi-page-header-main-ctn {
        background: #fff;
        border-radius: 8px;
        padding: 1.25rem 1rem 1.5rem;
    }
}

.member-account-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.member-account-form__grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .member-account-form__grid {
        grid-template-columns: 1fr 1fr;
    }

    .member-account-form__full {
        grid-column: 1 / -1;
    }
}

.member-account-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cartola-dark);
}

.member-account-form input {
    width: 100%;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    padding: 0.7rem 0.85rem;
    font-weight: 400;
}

.member-account-form input[readonly] {
    background: #f8f8f8;
}

.member-account-form small {
    font-weight: 400;
    color: #6c767c;
}

@media (max-width: 767px) {
    .member-payments-table,
    .member-payments-table thead,
    .member-payments-table tbody,
    .member-payments-table th,
    .member-payments-table td,
    .member-payments-table tr {
        display: block;
        width: 100%;
    }

    .member-payments-table {
        min-width: 0;
    }

    .member-payments-table thead {
        display: none;
    }

    .member-payments-table tr {
        border: 1px solid rgb(229 231 235);
        border-radius: 0.75rem;
        padding: 0.75rem 1rem;
        margin-bottom: 0.85rem;
    }

    .member-payments-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        border-bottom: 1px solid rgb(243 244 246);
        padding: 0.65rem 0;
        white-space: normal;
    }

    .member-payments-table td:last-child {
        border-bottom: none;
    }

    .member-payments-table td::before {
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: rgb(107 114 128);
        flex: 0 0 42%;
    }

    .member-payments-table__action {
        text-align: right;
    }
}
