/* ═══════════════════════════════════════════════════════════════════════════
   BARBERPRIME PAYMENTS — CHECKOUT STYLESHEET
   IMPORTANTE: o checkout SEMPRE usa tema claro (cream/dourado) independente
   do tema do site. Isso é prática padrão em páginas de pagamento — gera mais
   confiança e legibilidade para o cliente.
═══════════════════════════════════════════════════════════════════════════ */

.bppay-checkout,
[data-theme="dark"] .bppay-checkout,
[data-theme="light"] .bppay-checkout {
    /* Cores estáveis */
    --bppay-gold:       #D4AF37;
    --bppay-gold-light: #E4C565;
    --bppay-gold-dark:  #B8960C;
    --bppay-gold-text:  #7B6207;  /* dourado AA para texto sobre fundo claro */

    /* Cores SEMPRE claras (independente do tema do site) */
    --bppay-bg:         #FBF8F2;
    --bppay-surface:    #FFFFFF;
    --bppay-surface-2:  #FAFAF7;
    --bppay-text:       #1A1710;
    --bppay-text-muted: #5A5347;
    --bppay-text-soft:  #7A6F5A;
    --bppay-border:     #E8E0D0;
    --bppay-input-bg:   #FFFFFF;

    /* Tokens layout */
    --bppay-r:    12px;
    --bppay-r-lg: 16px;

    /* Aliases legados */
    --bppay-ink:        var(--bppay-text);
    --bppay-ink-500:    var(--bppay-text-muted);
    --bppay-ink-400:    var(--bppay-text-soft);
    --bppay-ink-300:    var(--bppay-text-soft);
    --bppay-cream:      var(--bppay-surface);
    --bppay-cream-soft: var(--bppay-surface-2);
}

.bppay-checkout {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--bppay-text);
    line-height: 1.55;

    /* Force background — caso o tema escuro do site domine */
    background: var(--bppay-bg);
    border-radius: var(--bppay-r-lg);
    padding: 32px 24px;
}

/* ═══ GRID ════════════════════════════════════════════════════════════ */
.bppay-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: flex-start;
}
@media (max-width: 820px) {
    .bppay-checkout-grid { grid-template-columns: 1fr; }
    .bppay-summary { order: -1; }
}

/* ═══ SUMMARY (right column) ══════════════════════════════════════════ */
.bppay-summary {
    background: var(--bppay-cream-soft);
    border: 1px solid var(--bppay-border);
    border-radius: var(--bppay-r-lg);
    padding: 24px;
    position: sticky;
    top: 16px;
}
.bppay-summary h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--bppay-ink);
}
.bppay-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bppay-border);
}
.bppay-summary-item strong {
    display: block;
    font-size: 1rem;
    color: var(--bppay-ink);
    margin-bottom: 2px;
}
.bppay-summary-item small {
    display: block;
    font-size: 0.78rem;
    color: var(--bppay-ink-500);
}
.bppay-summary-price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--bppay-ink);
    white-space: nowrap;
}
.bppay-summary-features {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    font-size: 0.84rem;
    color: var(--bppay-ink-500);
}
.bppay-summary-features li {
    padding: 4px 0;
}
.bppay-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 14px;
    border-top: 2px solid var(--bppay-ink);
    margin-top: 10px;
}
.bppay-summary-total span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bppay-ink-500);
}
.bppay-summary-total strong {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bppay-gold-dark);
}
.bppay-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 18px;
    font-size: 0.8rem;
    color: var(--bppay-ink-500);
}

/* ═══ FORM (left column) ══════════════════════════════════════════════ */
.bppay-form {
    background: var(--bppay-cream-soft);
    border: 1px solid var(--bppay-border);
    border-radius: var(--bppay-r-lg);
    padding: 28px;
}

.bppay-step { margin-bottom: 28px; }
.bppay-step:last-child { margin-bottom: 0; }
.bppay-step h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--bppay-ink);
}
.bppay-logged p {
    background: var(--bppay-cream);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--bppay-border);
    margin: 0;
    color: var(--bppay-ink-500);
    font-size: 0.9rem;
}

.bppay-field { margin-bottom: 14px; }
.bppay-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--bppay-ink);
}
.bppay-field input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid var(--bppay-border);
    border-radius: 10px;
    background: var(--bppay-input-bg);
    color: var(--bppay-text);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bppay-field input::placeholder {
    color: var(--bppay-text-soft);
    opacity: 1;
}
.bppay-field input:focus {
    border-color: var(--bppay-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
    outline: none;
}

/* ═══ GATEWAY SELECTION ═══════════════════════════════════════════════ */
.bppay-gateways {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bppay-gateway-card {
    display: block;
    cursor: pointer;
    padding: 16px 18px;
    background: var(--bppay-cream);
    border: 2px solid var(--bppay-border);
    border-radius: var(--bppay-r);
    transition: all 0.2s;
}
.bppay-gateway-card:hover {
    border-color: var(--bppay-gold);
}
.bppay-gateway-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.bppay-gateway-card:has(input:checked) {
    border-color: var(--bppay-gold);
    background: rgba(212, 175, 55, 0.06);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.12);
}
.bppay-gateway-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.bppay-gateway-icon {
    width: 44px;
    height: 44px;
    background: var(--bppay-cream-soft);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.bppay-gateway-card strong {
    display: block;
    font-size: 0.98rem;
    color: var(--bppay-ink);
}
.bppay-gateway-card small {
    display: block;
    font-size: 0.8rem;
    color: var(--bppay-ink-500);
    margin-top: 2px;
}
.bppay-gateway-methods {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.bppay-method-tag {
    font-size: 0.68rem;
    background: var(--bppay-cream-soft);
    color: var(--bppay-ink-500);
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
}

/* ═══ SUBMIT ═════════════════════════════════════════════════════════ */
.bppay-submit { text-align: center; }
.bppay-small {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--bppay-ink-500);
}

/* ═══ BUTTONS ═════════════════════════════════════════════════════════ */
.bppay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    line-height: 1;
}
.bppay-btn-lg { padding: 16px 36px; font-size: 1.05rem; width: 100%; }
.bppay-btn-primary {
    background: linear-gradient(135deg, var(--bppay-gold-light), var(--bppay-gold) 50%, var(--bppay-gold-dark));
    color: var(--bppay-ink);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}
.bppay-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(212, 175, 55, 0.45);
    color: var(--bppay-ink);
}

/* ═══ PLAN PICKER ═════════════════════════════════════════════════════ */
.bppay-page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    text-align: center;
    margin: 0 0 32px;
}
.bppay-plan-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.bppay-plan-card {
    position: relative;
    background: var(--bppay-cream-soft);
    border: 2px solid var(--bppay-border);
    border-radius: var(--bppay-r-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
}
.bppay-plan-card:hover {
    border-color: var(--bppay-gold);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.bppay-plan-card.is-featured {
    border-color: var(--bppay-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), transparent);
}
.bppay-plan-ribbon {
    position: absolute;
    top: -12px;
    left: 24px;
    background: var(--bppay-gold);
    color: var(--bppay-ink);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
}
.bppay-plan-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    margin: 0 0 6px;
}
.bppay-plan-price {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--bppay-gold-dark);
    margin: 14px 0 6px;
}
.bppay-plan-card p {
    font-size: 0.88rem;
    color: var(--bppay-ink-500);
    margin: 0 0 14px;
}
.bppay-plan-cta {
    display: inline-block;
    color: var(--bppay-gold-dark);
    font-weight: 600;
    font-size: 0.88rem;
}

/* ═══ MANUAL INSTRUCTIONS ═════════════════════════════════════════════ */
.bppay-manual-instructions {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bppay-cream-soft);
    border: 1px solid var(--bppay-border);
    border-radius: var(--bppay-r-lg);
    padding: 32px;
}
.bppay-manual-instructions h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    margin: 0 0 12px;
    color: var(--bppay-ink);
}
.bppay-payment-method {
    margin: 20px 0;
    padding: 18px 20px;
    background: var(--bppay-cream);
    border: 1px solid var(--bppay-border);
    border-radius: 10px;
}
.bppay-payment-method h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 10px;
}
.bppay-pix-key {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bppay-cream-soft);
    padding: 10px 14px;
    border-radius: 8px;
}
.bppay-pix-value {
    font-family: 'JetBrains Mono', monospace;
    flex: 1;
    word-break: break-all;
    font-size: 0.9rem;
}
.bppay-copy-btn {
    padding: 6px 14px;
    background: var(--bppay-ink);
    color: var(--bppay-gold);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.bppay-copy-btn:hover { background: var(--bppay-ink-500); }
.bppay-payment-method pre {
    background: var(--bppay-cream-soft);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: pre-wrap;
    margin: 0;
}

.bppay-manual-extra {
    margin: 20px 0;
    padding: 16px 18px;
    background: var(--bppay-cream);
    border-radius: 10px;
    font-size: 0.9rem;
}

.bppay-notice {
    padding: 14px 18px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 0.88rem;
}
.bppay-notice-warning { background: #fff8e1; color: #ef6c00; border-left: 4px solid #ef6c00; }
.bppay-notice-danger  { background: #ffebee; color: #8b0000; border-left: 4px solid #c62828; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bppay-checkout * { transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Campos novos: Dados de cobrança (CPF/CNPJ, endereço)
═══════════════════════════════════════════════════════════════════════════ */

.bppay-help-text {
    display: block;
    color: var(--bppay-text-soft);
    font-size: 0.82rem;
    margin: -4px 0 14px;
    line-height: 1.5;
}

.bppay-substep {
    margin: 22px 0 12px;
    color: var(--bppay-text);
    font-size: 0.95rem;
    font-weight: 600;
    border-top: 1px solid var(--bppay-border);
    padding-top: 18px;
}

.bppay-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.bppay-grid-3 {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 14px;
}
.bppay-grid-zip {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 14px;
}

@media (max-width: 540px) {
    .bppay-grid-2,
    .bppay-grid-3,
    .bppay-grid-zip {
        grid-template-columns: 1fr;
    }
}

.bppay-zip-status {
    display: block;
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.5);
    margin-top: 4px;
    min-height: 1em;
}
.bppay-zip-status.is-loading {
    color: var(--bppay-gold, #D4AF37);
}
.bppay-zip-status.is-success {
    color: #66bb6a;
}
.bppay-zip-status.is-error {
    color: #ef5350;
}

.bppay-form select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bppay-input-bg);
    border: 1.5px solid var(--bppay-border);
    border-radius: 10px;
    color: var(--bppay-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.bppay-form select:focus {
    outline: none;
    border-color: var(--bppay-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}
.bppay-zip-status {
    color: var(--bppay-text-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORCE LIGHT THEME — vence regras herdadas do tema escuro do site
═══════════════════════════════════════════════════════════════════════════ */

.bppay-checkout,
.bppay-checkout * {
    /* O texto base sempre escuro */
    color: inherit;
}

.bppay-checkout {
    color: #1A1710 !important;
}

.bppay-checkout .bppay-form,
.bppay-checkout .bppay-summary,
.bppay-checkout .bppay-form-card {
    background: #FAFAF7 !important;
    color: #1A1710 !important;
}

.bppay-checkout h2,
.bppay-checkout h3,
.bppay-checkout h4,
.bppay-checkout label,
.bppay-checkout .bppay-substep {
    color: #1A1710 !important;
}

.bppay-checkout input[type="text"],
.bppay-checkout input[type="email"],
.bppay-checkout input[type="tel"],
.bppay-checkout input[type="date"],
.bppay-checkout input[type="number"],
.bppay-checkout select,
.bppay-checkout textarea {
    background: #FFFFFF !important;
    color: #1A1710 !important;
    border: 1.5px solid #E8E0D0 !important;
}

.bppay-checkout input::placeholder,
.bppay-checkout textarea::placeholder {
    color: #A99C7E !important;
}

.bppay-checkout input:focus,
.bppay-checkout select:focus,
.bppay-checkout textarea:focus {
    border-color: #D4AF37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18) !important;
}

.bppay-checkout .bppay-help-text,
.bppay-checkout small {
    color: #5A5347 !important;
}

.bppay-checkout .bppay-gateway-card {
    background: #FFFFFF !important;
    color: #1A1710 !important;
    border: 2px solid #E8E0D0 !important;
}

.bppay-checkout .bppay-gateway-card:has(input:checked) {
    border-color: #D4AF37 !important;
    background: #FFFBEC !important;
}

.bppay-checkout .bppay-zip-status {
    color: #5A5347 !important;
}
.bppay-checkout .bppay-zip-status.is-success { color: #2e7d32 !important; }
.bppay-checkout .bppay-zip-status.is-error   { color: #c62828 !important; }
.bppay-checkout .bppay-zip-status.is-loading { color: #B8960C !important; }

/* Page wrapper background — caso o tema esteja com BG escuro envolvendo o checkout */
body:has(.bppay-checkout) main,
body:has(.bppay-checkout) .bpsaas-main,
body:has(.bppay-checkout) #content {
    background: #FBF8F2 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PÁGINA DE CHECKOUT — força tema CLARO em toda a página, vencendo o tema
   do site (que pode estar em dark e tornar texto invisível).
═══════════════════════════════════════════════════════════════════════════ */

/* H1 e H2 da página (incluindo "Checkout" do tema WP) */
body:has(.bppay-checkout) main h1,
body:has(.bppay-checkout) main h2,
body:has(.bppay-checkout) main h3,
body:has(.bppay-checkout) .bpsaas-page-title,
body:has(.bppay-checkout) .bpsaas-article-title,
body:has(.bppay-checkout) .entry-title {
    color: #1A1710 !important;
}

/* Texto comum dentro da área do checkout */
body:has(.bppay-checkout) main p,
body:has(.bppay-checkout) main li,
body:has(.bppay-checkout) main span:not([class*="bppay-tag"]) {
    color: #1A1710 !important;
}

/* Page features (compra segura, garantia, SSL) — estavam ficando cinza claro */
.bppay-checkout .bppay-summary-features li,
.bppay-checkout .bppay-summary-features {
    color: #5A5347 !important;
}

/* Lista de features do plano (✓ Sistema completo, ✓ Agendamentos…) */
.bppay-checkout .bppay-summary-plan-features li {
    color: #1A1710 !important;
    opacity: 0.85;
}

/* Body completo da página */
body:has(.bppay-checkout) {
    background: #FBF8F2 !important;
    color: #1A1710 !important;
}

/* Header/footer mantém o tema do site */
body:has(.bppay-checkout) .bpsaas-header,
body:has(.bppay-checkout) .bpsaas-footer,
body:has(.bppay-checkout) header,
body:has(.bppay-checkout) footer {
    background: revert !important;
    color: revert !important;
}

/* Botão "Processando…" continua dourado pra dar feedback */
.bppay-checkout button[disabled],
.bppay-checkout .bppay-btn-primary {
    color: #0a0907 !important;
}
