/* ============================================================
   Modal de Cadastro de Lojista — Landing Page
   Fluxo: Dados → Pagamento PIX → Sucesso
   ============================================================ */

/* Overlay full-screen */
.cl-cad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 32, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem 1rem;
}
.cl-cad-overlay.is-open { display: flex; }
@media (max-width: 640px) { .cl-cad-overlay { padding: 0; } }

/* Card central */
.cl-cad-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.40);
    overflow: hidden;
    position: relative;
    animation: clCadIn .35s ease-out;
}
@keyframes clCadIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
html.cl-theme-dark .cl-cad-modal { background: #1e293b; color: #f8fafc; }
@media (max-width: 640px) {
    .cl-cad-modal { border-radius: 0; min-height: 100vh; max-width: 100%; }
}

/* Cabeçalho com gradient + plano selecionado */
.cl-cad-head {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: #fff;
    padding: 1.5rem;
    position: relative;
}
.cl-cad-head__close {
    position: absolute;
    top: .85rem; right: .85rem;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s ease;
    display: grid; place-items: center;
}
.cl-cad-head__close:hover { background: rgba(255, 255, 255, 0.30); }
.cl-cad-head__eyebrow {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .85;
    margin-bottom: .35rem;
}
.cl-cad-head__title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
}
.cl-cad-head__plano {
    margin-top: .9rem;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: .75rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
    font-size: .92rem;
}
.cl-cad-head__plano strong { font-weight: 700; }
.cl-cad-head__plano-preco { font-weight: 800; font-size: 1.05rem; }

/* Stepper */
.cl-cad-stepper {
    display: flex; align-items: center; justify-content: center;
    gap: 0;
    padding: 1rem 1.5rem .5rem;
    background: #f9fafb;
}
html.cl-theme-dark .cl-cad-stepper { background: #14202d; }
.cl-cad-stepper__dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    font-size: .78rem;
    font-weight: 700;
    display: grid; place-items: center;
    transition: background .25s ease, color .25s ease;
}
.cl-cad-stepper__dot.is-active { background: #047857; color: #fff; }
.cl-cad-stepper__dot.is-done   { background: #10b981; color: #fff; }
.cl-cad-stepper__line {
    width: 44px; height: 2px;
    background: #e5e7eb;
    transition: background .25s ease;
}
.cl-cad-stepper__line.is-done { background: #10b981; }
.cl-cad-stepper__labels {
    display: flex; justify-content: space-between;
    padding: .25rem 1.5rem 1rem;
    background: #f9fafb;
    font-size: .72rem;
    color: #6b7280;
}
html.cl-theme-dark .cl-cad-stepper__labels { background: #14202d; color: #94a3b8; }
.cl-cad-stepper__labels span { width: 28px; text-align: center; }

/* Corpo */
.cl-cad-body { padding: 1.5rem; }
.cl-cad-step { display: none; }
.cl-cad-step.is-active { display: block; }

/* Form */
.cl-cad-field { margin-bottom: 1rem; }
.cl-cad-field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .35rem;
}
html.cl-theme-dark .cl-cad-field label { color: #e2e8f0; }
.cl-cad-field input,
.cl-cad-field select {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}
html.cl-theme-dark .cl-cad-field input,
html.cl-theme-dark .cl-cad-field select {
    background: #0f1c29;
    border-color: #475569;
    color: #f8fafc;
}
.cl-cad-field input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.cl-cad-field input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.cl-cad-field__err {
    color: #ef4444;
    font-size: .82rem;
    margin-top: .25rem;
    display: none;
}
.cl-cad-field.is-invalid .cl-cad-field__err { display: block; }
.cl-cad-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
@media (max-width: 480px) { .cl-cad-row { grid-template-columns: 1fr; } }

/* Mensagem de erro geral */
.cl-cad-msg {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
    display: none;
}
.cl-cad-msg.is-visible { display: block; }

/* Botão principal */
.cl-cad-btn {
    width: 100%;
    padding: .95rem 1.25rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #047857, #10b981);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.25);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    font-family: inherit;
}
.cl-cad-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(4, 120, 87, 0.35);
}
.cl-cad-btn:disabled { opacity: .55; cursor: not-allowed; }
.cl-cad-btn .fas { margin-right: .5rem; }

/* Botão "Voltar" — estilo link sutil, sem competir com o CTA principal */
.cl-cad-btn-link {
    width: 100%;
    padding: .7rem 1rem;
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.cl-cad-btn-link:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}
.cl-cad-btn-link .fas { margin-right: .5rem; }
html.cl-theme-dark .cl-cad-btn-link {
    color: #cbd5e1;
    border-color: #475569;
}
html.cl-theme-dark .cl-cad-btn-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    border-color: #64748b;
}

/* ===== Step 2 — Tabs PIX/Cartao ===== */
.cl-cad-tabs {
    display: flex;
    gap: .5rem;
    background: #f3f4f6;
    padding: .35rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}
html.cl-theme-dark .cl-cad-tabs { background: #0f1c29; }
.cl-cad-tab {
    flex: 1;
    padding: .6rem .8rem;
    border-radius: 9px;
    background: transparent;
    border: none;
    font-size: .92rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
    font-family: inherit;
    display: flex; align-items: center; justify-content: center;
    gap: .4rem;
}
.cl-cad-tab:hover { color: #047857; }
.cl-cad-tab.is-active {
    background: #fff;
    color: #047857;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
}
html.cl-theme-dark .cl-cad-tab.is-active {
    background: #1e293b;
    color: #34d399;
}
html.cl-theme-dark .cl-cad-tab { color: #94a3b8; }
html.cl-theme-dark .cl-cad-tab:hover { color: #34d399; }

.cl-cad-pane { display: none; }
.cl-cad-pane.is-active { display: block; }

/* Container do Brick MP — largura total + respiro */
#cl-cad-cartao-brick {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: .5rem;
    min-height: 200px;
    box-sizing: border-box;
}
/* Sobrescreve variavel CSS do Brick pra combinar com identidade verde */
:root {
    --mp-button-bg: #10b981;
    --mp-button-color: #ffffff;
}

/* Forca TODOS wrappers internos do Brick a esticar (form, divs, etc).
   O Brick MP empilha varios containers, e basta um deles ter width auto pra
   o botao ficar pequeno. Por isso bruteforce em todos os descendentes. */
#cl-cad-cartao-brick,
#cl-cad-cartao-brick > *,
#cl-cad-cartao-brick > * > *,
#cl-cad-cartao-brick form,
#cl-cad-cartao-brick form > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Botao "Pagar" — full width + estilo igual ao "Voltar e ajustar dados" abaixo,
   pra haver simetria visual. */
#cl-cad-cartao-brick button,
#cl-cad-cartao-brick button[type="submit"],
#cl-cad-cartao-brick [class*="button"] {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 1.25rem 0 0 0 !important;
    padding: .85rem 1rem !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
    text-align: center !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25) !important;
}

/* Remove o card branco com sombra que o Brick MP coloca em volta APENAS do
   container do botao Pagar. Usa :has() pra mirar so o wrapper imediato do
   button[type="submit"], sem afetar os inputs (cartao, validade, CVV).
   Box-shadow tambem zerado pra evitar dois glows sobrepostos. */
#cl-cad-cartao-brick *:has(> button[type="submit"]) {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ===== Step 2 (Pagamento PIX) ===== */
.cl-cad-pix-info {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    padding: .85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
    color: #064e3b;
    line-height: 1.5;
}
html.cl-theme-dark .cl-cad-pix-info {
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
}
.cl-cad-pix-valor {
    text-align: center;
    margin-bottom: 1rem;
}
.cl-cad-pix-valor__lbl {
    font-size: .82rem;
    color: #6b7280;
    margin-bottom: .25rem;
}
html.cl-theme-dark .cl-cad-pix-valor__lbl { color: #94a3b8; }
.cl-cad-pix-valor__val {
    font-size: 2rem;
    font-weight: 800;
    color: #047857;
}
html.cl-theme-dark .cl-cad-pix-valor__val { color: #34d399; }

.cl-cad-pix-qr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}
.cl-cad-pix-qr img {
    max-width: 240px;
    height: auto;
    image-rendering: pixelated;
}
.cl-cad-pix-copia {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: .25rem;
    margin-bottom: 1rem;
}
html.cl-theme-dark .cl-cad-pix-copia { background: #0f1c29; }
.cl-cad-pix-copia input {
    flex: 1;
    background: transparent;
    border: none;
    padding: .65rem .85rem;
    font-family: monospace;
    font-size: .82rem;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
}
html.cl-theme-dark .cl-cad-pix-copia input { color: #cbd5e1; }
.cl-cad-pix-copia button {
    padding: .65rem 1rem;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    white-space: nowrap;
}
.cl-cad-pix-copia button:hover { background: #047857; }

.cl-cad-pix-status {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
    font-size: .9rem;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
}
html.cl-theme-dark .cl-cad-pix-status { color: #94a3b8; }
.cl-cad-pix-status__dot {
    width: 10px; height: 10px;
    background: #f59e0b;
    border-radius: 50%;
    animation: pulse-orange 1.8s ease-in-out infinite;
}
@keyframes pulse-orange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
    70%      { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}

/* ===== Step 3 (Sucesso) ===== */
.cl-cad-sucesso {
    text-align: center;
    padding: 1rem .5rem;
}
.cl-cad-sucesso__icon {
    width: 80px; height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    font-size: 2.2rem;
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.40);
    animation: bounceIn .6s ease;
}
@keyframes bounceIn {
    0% { transform: scale(.3); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.cl-cad-sucesso__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 .5rem;
    color: #064e3b;
}
html.cl-theme-dark .cl-cad-sucesso__title { color: #a7f3d0; }
.cl-cad-sucesso__msg {
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}
html.cl-theme-dark .cl-cad-sucesso__msg { color: #cbd5e1; }
.cl-cad-sucesso__email {
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    padding: .85rem 1rem;
    margin-bottom: 1.5rem;
    font-size: .9rem;
    color: #064e3b;
}
html.cl-theme-dark .cl-cad-sucesso__email {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.30);
    color: #a7f3d0;
}
.cl-cad-sucesso__email strong { display: block; margin-top: .25rem; }

/* Toast (cópia ok) */
.cl-cad-toast {
    position: fixed;
    bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    background: #064e3b;
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.cl-cad-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}
