/*
 * Tela pública de consulta de saldo (Pages::consulta_saldo).
 * Layout baseado no protótipo GB-6216 (Figma), com personalização white-label
 * por loja aplicada via CSS custom properties injetadas na view:
 *   --page-bg  -> cor de fundo da tela   (Ecommerce.cor_fundo_tela_cupom)
 *   --btn-bg   -> cor do botão principal (Ecommerce.cor_botao_cupom)
 *   --btn-fg   -> cor da fonte do botão  (Ecommerce.cor_fonte_botao_cupom)
 * Fallbacks (Figma) definidos aqui caso a loja não personalize.
 */
:root {
    --cs-font: 'Montserrat', 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/*
 * O layout `ecommerce` envolve o conteúdo em `.j-section__error > .j-section__error-wrapper`,
 * dentro de um flex em coluna com `align-items: center` — o que faz o wrapper encolher pela
 * largura do conteúdo e impede o card de usar seu max-width. Forçamos largura total aqui
 * (regra só carregada nesta página).
 */
.j-section__error-wrapper {
    width: 100%;
    align-self: stretch;
}

.cs-wrap {
    /* fallbacks das cores do Figma caso a view não injete os overrides da loja */
    --page-bg: #F9FAFB;
    --btn-bg: #2D2D2D;
    --btn-fg: #FFFFFF;

    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    min-height: 100vh;
    padding: 48px 16px;
    background-color: var(--page-bg);
    font-family: var(--cs-font);
    color: #374151;
    box-sizing: border-box;
}

.cs-card {
    width: 100%;
    max-width: 840px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    padding: 48px 56px;
    box-sizing: border-box;
}

.cs-logo {
    text-align: center;
    margin-bottom: 28px;
}

.cs-logo img {
    max-width: 220px;
    height: auto;
}

/* ---- Formulário ---- */
/* Prefixados com .cs-wrap para vencer o `.j-section__error p` do layout ecommerce */
.cs-wrap .cs-label {
    font-size: 15px;
    font-weight: 400;
    color: #6B7280;
    text-align: center;
    margin-bottom: 14px;
}

.cs-input-wrap {
    transition: 0.2s all;
}

.cs-input-wrap .input {
    display: block;
    width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 14px 18px;
    font-family: var(--cs-font);
    font-size: 15px;
    font-weight: 400;
    color: #374151;
    background-color: #ffffff;
    outline: none;
    box-sizing: border-box;
    text-align: center;
}

.cs-input-wrap .input:focus {
    border-color: var(--btn-bg);
}

.cs-toggle-wrap {
    text-align: center;
    margin: 10px 0 28px;
    min-height: 22px;
}

#onlyCpf,
#onlyCelular {
    display: inline-block;
    color: var(--btn-bg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.2s;
    margin: 0;
}

#onlyCpf:hover,
#onlyCelular:hover {
    text-decoration-color: var(--btn-bg);
}

.cs-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 8px;
}

/* Prefixados com .cs-wrap para vencer o `.botao_verde` do globals.css do projeto
   (que fixa height/width/margin/line-height só nesse botão). Ambos idênticos. */
.cs-wrap .botao_verde,
.cs-wrap .botao_resgate {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: auto;
    height: 61px;
    margin: 0;
    padding: 0 24px;
    font-family: var(--cs-font);
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    border: 2px solid var(--btn-bg);
    box-sizing: border-box;
    cursor: pointer;
}

.cs-wrap .botao_verde {
    background-color: var(--btn-bg);
    color: var(--btn-fg);
}

.cs-wrap .botao_resgate {
    background-color: transparent;
    color: var(--btn-bg);
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

#pinError {
    text-align: center;
    color: #dc2626;
    font-weight: 600;
    font-size: 13px;
    margin: 12px 0;
}

/* ---- Resultado ---- */
.cs-divider {
    border-top: 1px solid #F3F4F6;
    margin-bottom: 24px;
}

.cs-resumo {
    text-align: center;
    margin-bottom: 24px;
}

.cs-wrap .cs-cliente {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 6px;
}

.cs-wrap .cs-cliente b {
    color: #374151;
    font-weight: 600;
}

.cs-wrap .cs-saldo {
    font-size: 22px;
    font-weight: 400;
    color: #374151;
    margin-bottom: 6px;
}

.cs-wrap .cs-saldo b {
    font-weight: 400;
}

#saldo_disponivel_txt {
    color: var(--btn-bg);
    font-weight: 700;
}

.cs-wrap .cs-apoio {
    font-size: 12px;
    color: #9CA3AF;
    line-height: 1.5;
    margin: 0;
}

/* ---- Tabela ---- */
#contentTable {
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: visible;
    margin: 0 0 32px;
    box-sizing: border-box;
}

#contentTable table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--cs-font);
}

#contentTable table thead th {
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #6B7280;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

#contentTable table thead th:not(:last-child) {
    border-right: 1px solid #E5E7EB;
}

#contentTable table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#contentTable table tbody tr:nth-child(even) {
    background-color: #FAFAFA;
}

#contentTable table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: #6B7280;
    text-align: center;
    border-bottom: 1px solid #F3F4F6;
}

#contentTable table tbody tr:last-child td {
    border-bottom: none;
}

#contentTable table tbody td:not(:last-child) {
    border-right: 1px solid #E5E7EB;
}

/* Primeira coluna (valor) em destaque */
#contentTable table tbody td:first-child {
    color: #374151;
    font-weight: 600;
}

/* ---- Badges de status ---- */
.badge-status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    position: relative;
    cursor: default;
    user-select: none;
}

.badge-ativo {
    background-color: #E6F4EA;
    color: #1E7E34;
}

.badge-a-receber {
    background-color: #FFF8E1;
    color: #B45309;
}

.badge-status .badge-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    padding: 10px 14px;
    border-radius: 6px;
    white-space: normal;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.2s;
}

.badge-status .badge-tooltip::after {
    content: " ";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1a1a1a transparent transparent transparent;
}

.badge-status:hover .badge-tooltip {
    visibility: visible;
    opacity: 1;
}

#conteudo_step2a_semsaldo {
    text-align: center;
    color: #6B7280;
    font-size: 15px;
    padding: 24px 0;
}

#p_frase_acessa_site {
    text-align: center;
    margin-top: 20px;
}

/* ---- App links / rodapé ---- */
.links-app {
    text-align: center;
    margin-top: 8px;
}

.cs-wrap .links-app p {
    font-size: 13px;
    color: #9CA3AF;
    line-height: 1.5;
    margin-bottom: 14px;
}

.links-app img {
    width: 120px;
    height: auto;
}

.app-apple,
.app-android {
    display: inline-block;
    margin: 0 5px;
}

.cs-footer-logo {
    margin-top: 40px;
    text-align: center;
}

.cs-footer-logo img {
    width: 102px;
}

.loading {
    font-size: 30px;
    display: none;
}

.loading-overlay-content:after {
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    -webkit-animation: ellipsis steps(4, end) 1600ms infinite;
    animation: ellipsis steps(4, end) 1600ms infinite;
    content: "\2026";
    width: 0px;
}

@keyframes ellipsis {
    to {
        width: 1.25em;
    }
}

@-webkit-keyframes ellipsis {
    to {
        width: 1.25em;
    }
}

@media only screen and (max-width: 640px) {
    .cs-wrap {
        padding: 24px 12px;
    }

    .cs-card {
        padding: 28px 20px;
    }

    .cs-actions {
        flex-direction: column;
    }

    #contentTable table thead th {
        padding: 9px 8px;
        font-size: 10px;
        letter-spacing: 0.02em;
    }

    #contentTable table tbody td {
        padding: 11px 8px;
        font-size: 11px;
    }

    .badge-status {
        padding: 2px 7px;
        font-size: 10px;
    }

    .badge-status .badge-tooltip {
        min-width: 180px;
        font-size: 11px;
    }
}
