@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ===== Portal Wrapper ===== */
.dm-portal-wrap {
    max-width: 940px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Manrope', sans-serif;
    box-sizing: border-box;
    background: transparent;
}

/* ===== Split Layout (quando não logado) ===== */
.dm-portal-split-layout {
    max-width: 1200px;
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
}

.dm-portal-left {
    flex: 1;
    max-width: 500px;
}

.dm-portal-divider {
    width: 2px;
    height: 400px;
    background: linear-gradient(to bottom, transparent, #1D185E 20%, #1D185E 80%, transparent);
    flex-shrink: 0;
}

.dm-portal-right {
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-portal-qr-section {
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
}

.dm-portal-phrase {
    font-size: 20px;
    font-weight: 600;
    color: #1D185E;
    margin-bottom: 30px;
    line-height: 1.4;
}

.dm-portal-phrase p {
    margin: 0;
}

.dm-portal-qr-image img {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    border-radius: 12px;
}

/* ===== PIX Copy Section ===== */
.dm-portal-pix-copy {
    margin-top: 20px;
}

.dm-portal-pix-copy label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #535353;
    margin-bottom: 8px;
    text-align: left;
}

.dm-pix-copy-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.dm-pix-copy-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Manrope', sans-serif;
    background: #f9f9f9;
    color: #333;
}

/* Botão copiar desktop - FORÇAR ESTILO ROXO */
button.dm-pix-copy-desktop,
.dm-pix-copy-desktop,
.dm-portal-qr-section button.dm-pix-copy-desktop,
.dm-portal-qr-section .dm-pix-copy-desktop,
.dm-pix-copy-wrapper button.dm-pix-copy-desktop,
.dm-pix-copy-wrapper .dm-pix-copy-desktop,
button[class*="dm-pix-copy-desktop"],
.dm-portal-right button.dm-pix-copy-desktop {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 12px 20px !important;
    background-color: #1D185E !important;
    background: #1D185E !important;
    color: #ffffff !important;
    border: none !important;
    border-color: #1D185E !important;
    border-radius: 0px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'Manrope', sans-serif !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

button.dm-pix-copy-desktop:hover,
.dm-pix-copy-desktop:hover,
.dm-portal-qr-section button.dm-pix-copy-desktop:hover,
.dm-portal-qr-section .dm-pix-copy-desktop:hover,
.dm-pix-copy-wrapper button.dm-pix-copy-desktop:hover,
.dm-pix-copy-wrapper .dm-pix-copy-desktop:hover,
button[class*="dm-pix-copy-desktop"]:hover,
.dm-portal-right button.dm-pix-copy-desktop:hover {
    background-color: #2a2275 !important;
    background: #2a2275 !important;
    color: #ffffff !important;
    border-color: #2a2275 !important;
}

button.dm-pix-copy-desktop.dm-copied,
.dm-pix-copy-desktop.dm-copied,
.dm-portal-qr-section button.dm-pix-copy-desktop.dm-copied,
.dm-portal-qr-section .dm-pix-copy-desktop.dm-copied,
.dm-pix-copy-wrapper button.dm-pix-copy-desktop.dm-copied,
.dm-pix-copy-wrapper .dm-pix-copy-desktop.dm-copied,
button[class*="dm-pix-copy-desktop"].dm-copied,
.dm-portal-right button.dm-pix-copy-desktop.dm-copied {
    background-color: #1D185E !important;
    background: #1D185E !important;
    color: #ffffff !important;
    border-color: #1D185E !important;
}

button.dm-pix-copy-desktop svg,
.dm-pix-copy-desktop svg,
button[class*="dm-pix-copy-desktop"] svg {
    flex-shrink: 0 !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* Override any theme button styles that might interfere */
.dm-portal-qr-section button,
.dm-pix-copy-wrapper button {
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Force purple color on all button states */
.dm-portal-right .dm-pix-copy-desktop,
.dm-portal-qr-section .dm-pix-copy-desktop {
    background-color: #1D185E !important;
    background: #1D185E !important;
    border: 1px solid #1D185E !important;
}

.dm-portal-right .dm-pix-copy-desktop:hover,
.dm-portal-qr-section .dm-pix-copy-desktop:hover {
    background-color: #2a2275 !important;
    background: #2a2275 !important;
    border: 1px solid #2a2275 !important;
}

/* ===== Anonymous Donation Section (Mobile Only) ===== */
.dm-portal-anonymous-mobile {
    display: block !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid #f0f0f0 !important;
    text-align: center !important;
}

/* Ocultar no desktop */
@media (min-width: 641px) {
    .dm-portal-anonymous-mobile {
        display: none !important;
    }
}

.dm-portal-anonymous-link {
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #6d5fc7 !important;
    font-family: 'Manrope', sans-serif !important;
    text-decoration: underline !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: color 0.2s !important;
    padding: 8px 0 !important;
}

.dm-portal-anonymous-link:hover {
    color: #4938A5 !important;
}

/* ===== Modal/Pop-up Styles (MOBILE ONLY) ===== */
.dm-anonymous-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Classe para mostrar modal via JavaScript */
.dm-anonymous-modal-overlay.dm-show {
    display: flex !important;
}

/* SEMPRE ocultar no desktop */
@media (min-width: 641px) {
    .dm-anonymous-modal-overlay,
    .dm-anonymous-modal-overlay.dm-show {
        display: none !important;
    }
}

.dm-anonymous-modal-overlay * {
    box-sizing: border-box !important;
}

.dm-anonymous-modal {
    position: relative !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 32px 24px !important;
    max-width: 380px !important;
    width: 90% !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    margin: auto !important;
    transform: translateY(0) !important;
    border: none !important;
    outline: none !important;
}

.dm-anonymous-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 24px !important;
    line-height: 1 !important;
    color: #888 !important;
    cursor: pointer !important;
    transition: color 0.2s !important;
    padding: 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    z-index: 1000000 !important;
}

.dm-anonymous-modal-close:hover {
    color: #333 !important;
    background: transparent !important;
    transform: none !important;
}

.dm-modal-phrase {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1D185E !important;
    margin-bottom: 24px !important;
    line-height: 1.4 !important;
    text-align: center !important;
    font-family: 'Manrope', sans-serif !important;
}

.dm-modal-phrase p {
    margin: 0 !important;
}

.dm-modal-qr {
    text-align: center !important;
    margin-bottom: 24px !important;
}

.dm-modal-qr img {
    max-width: 240px !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 12px !important;
}

.dm-modal-pix {
    margin-top: 20px !important;
}

.dm-modal-pix label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #888888 !important;
    margin-bottom: 8px !important;
    text-align: left !important;
    font-family: 'Manrope', sans-serif !important;
}

.dm-modal-pix-wrapper {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
}

.dm-modal-pix-wrapper input {
    flex: 1 !important;
    padding: 12px 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: 'Manrope', sans-serif !important;
    background: #ffffff !important;
    color: #333 !important;
    box-sizing: border-box !important;
}

.dm-pix-copy-btn-modal {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 12px 20px !important;
    background: #1D185E !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'Manrope', sans-serif !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.dm-pix-copy-btn-modal:hover {
    background: #2a2275 !important;
}

.dm-pix-copy-btn-modal.dm-copied {
    background: #1D185E !important;
    color: #ffffff !important;
}

.dm-pix-copy-btn-modal svg {
    flex-shrink: 0 !important;
}

/* Prevent body scroll when modal is open */
body.dm-modal-open {
    overflow: hidden !important;
}

/* Classe para mostrar modal via JavaScript */
.dm-anonymous-modal-overlay.dm-show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 999999 !important;
}

/* Forçar exibição quando tiver a classe dm-show */
#dm-anonymous-modal.dm-show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 640px) {
    .dm-anonymous-modal-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* ===== Login Box ===== */
.dm-portal-login-box {
    max-width: 420px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    text-align: center;
}

.dm-portal-logo {
    margin-bottom: 20px;
    line-height: 1;
}

.dm-portal-logo-img {
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.dm-portal-login-box h2 {
    font-size: 24px;
    font-weight: 400;
    color: #000000;
    margin: 0 0 8px;
    font-family: 'Manrope', sans-serif;
    text-transform: uppercase;
}

.dm-portal-login-box > p {
    font-size: 16px;
    color: #888888;
    margin-bottom: 28px;
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
    line-height: 1.4em;
}

.dm-portal-field {
    margin-bottom: 18px;
    text-align: left;
}

.dm-portal-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 300;
    color: #535353;
    font-family: 'Manrope', sans-serif;
}

.dm-portal-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
}

.dm-portal-field input:focus {
    border-color: #1D185E;
}

.dm-portal-btn-primary {
    display: block !important;
    width: 100% !important;
    padding: 20px 40px !important;
    background: #1D185E !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    font-family: 'Manrope', sans-serif !important;
    cursor: pointer !important;
    margin-top: 8px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background 0.2s;
    -webkit-appearance: none;
    appearance: none;
    text-align: center !important;
}

.dm-portal-btn-primary:hover {
    background: #2a2275 !important;
    color: #ffffff !important;
}

.dm-portal-hint {
    font-size: 13px;
    color: #aaaaaa;
    margin-top: 20px;
    font-family: 'Manrope', sans-serif;
}

.dm-portal-error {
    background: #fff0f0;
    color: #c0392b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    font-family: 'Manrope', sans-serif;
    text-align: left;
}

/* ===== Dashboard Header ===== */
.dm-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 12px;
}

.dm-portal-greeting h2 {
    font-size: 26px;
    font-weight: 400;
    color: #000000;
    margin: 0 0 4px;
    font-family: 'Manrope', sans-serif;
    text-transform: uppercase;
}

.dm-portal-greeting span {
    font-size: 16px;
    color: #535353;
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
}

.dm-portal-btn-outline {
    padding: 12px 28px;
    background: transparent !important;
    color: #1D185E !important;
    border: 2px solid #1D185E !important;
    border-radius: 0;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Manrope', sans-serif;
    text-decoration: none !important;
    transition: all 0.2s;
    display: inline-block;
}

.dm-portal-btn-outline:hover {
    background: #1D185E !important;
    color: #ffffff !important;
}

/* ===== Summary Stats ===== */
.dm-portal-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.dm-portal-stat {
    flex: 1;
    min-width: 130px;
    background: #f7f7fb;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 4px solid #1D185E;
}

.dm-portal-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #1D185E;
    font-family: 'Manrope', sans-serif;
}

.dm-portal-stat-label {
    font-size: 13px;
    color: #888888;
    font-family: 'Manrope', sans-serif;
}

/* ===== Table ===== */
.dm-portal-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
}

.dm-portal-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Manrope', sans-serif;
    min-width: 520px;
    table-layout: auto;
}

.dm-portal-table th {
    background: #f9f9f9;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #535353;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.dm-portal-table td {
    padding: 10px 12px;
    font-size: 13px;
    color: #333333;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    white-space: nowrap;
}

.dm-portal-table td:first-child {
    white-space: normal;
    max-width: 140px;
}

.dm-portal-table tbody tr:last-child td {
    border-bottom: none;
}

.dm-portal-table tbody tr:hover {
    background: #fafafa;
}

.dm-portal-amount {
    font-weight: 700;
    color: #1D185E;
}

/* ===== Status Badges ===== */
.dm-portal-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    white-space: nowrap;
}

.dm-badge-active          { background: #e8f5e9; color: #2e7d32; }
.dm-badge-pending,
.dm-badge-pending_payment { background: #fff8e1; color: #f57f17; }
.dm-badge-completed       { background: #e3f2fd; color: #1565c0; }
.dm-badge-cancelled       { background: #fce4ec; color: #c62828; }
.dm-badge-failed          { background: #fce4ec; color: #c62828; }

/* ===== Cancel Button ===== */
.dm-portal-btn-danger {
    padding: 6px 14px;
    background: transparent;
    color: #c62828 !important;
    border: 1.5px solid #c62828;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s;
}

.dm-portal-btn-danger:hover {
    background: #c62828;
    color: #ffffff !important;
}

/* ===== Empty State ===== */
.dm-portal-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaaaaa;
}

.dm-portal-empty span {
    display: block;
    font-size: 52px;
    margin-bottom: 16px;
    line-height: 1;
}

.dm-portal-empty p {
    font-size: 16px;
    font-family: 'Manrope', sans-serif;
    color: #888888;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .dm-portal-split-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .dm-portal-left,
    .dm-portal-right {
        max-width: 100%;
        width: 100%;
    }
    
    /* Ocultar linha divisória no mobile */
    .dm-portal-divider {
        display: none;
    }
    
    /* Ocultar seção direita (desktop) no mobile */
    .dm-portal-right {
        display: none;
    }
    
    /* Seção de doação anônima já está visível via .dm-portal-anonymous-mobile display: block */
    
    .dm-portal-login-box {
        padding: 32px 20px;
    }
    .dm-portal-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dm-portal-stat {
        min-width: 100%;
    }
    .dm-portal-table th,
    .dm-portal-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}
