/* ==========================================================================
   PORTAL DE REGULARIZAÇÃO DE DÉBITOS (GOV.BR) - ESTILOS GERAIS
   Mobile-First Design
   ========================================================================== */

:root {
    --primary-color: #004b82;
    --primary-dark: #002d54;
    --chat-blue: #00508f;
    --success-color: #13a04b;
    --success-light: #d1ebd8;
    --success-dark: #0e6c33;
    --warning-color: #f59e0b;
    --danger-color: #df2a2a;
    --danger-light: #fdf0f0;
    --text-color: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --font-family: 'Rawline', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #ffffff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.gov-container {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   CABEÇALHO GOV.BR
   ========================================================================== */

.gov-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gov-logo {
    text-decoration: none;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1.5px;
    display: flex;
    align-items: center;
}

.custom-logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.gov-logo .gov-gov {
    color: var(--primary-color);
}

.gov-logo .gov-br {
    color: var(--warning-color);
}

.gov-header-actions {
    display: flex;
    gap: 8px;
}

.gov-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.gov-icon-btn:hover,
.gov-icon-btn:active {
    background-color: #f1f3f5;
}

.gov-icon-btn .icon {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
}

/* Sub-barra azul */
.gov-sub-bar {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 6px 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sub-bar-title {
    opacity: 0.9;
    font-size: 10px;
}

.gov-sub-links {
    display: flex;
    gap: 10px;
}

.gov-sub-links a {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-size: 9px;
}

.gov-sub-links a:hover {
    opacity: 1;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (TELA 1)
   ========================================================================== */

.gov-main-content {
    display: none;
    padding: 16px 0 40px 0;
    background-color: #ffffff;
    animation: fadeIn 0.4s ease-in-out;
}

.gov-main-content.active-panel {
    display: block;
}

/* Documento Oficial */
.documento-oficial-box {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px 16px;
    margin-bottom: 20px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    text-align: center;
}

.doc-header {
    margin-bottom: 16px;
}

.brasao-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.brasao-container svg {
    width: 50px;
    height: 50px;
}

.doc-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: #003554;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.doc-header h3 {
    font-size: 11px;
    font-weight: 600;
    color: #555555;
    letter-spacing: 2px;
}

.doc-body {
    text-align: justify;
    font-size: 13px;
    color: #444444;
    line-height: 1.6;
    margin-bottom: 20px;
}

.doc-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 16px;
}

.doc-footer .cargo {
    font-size: 11px;
    font-weight: 600;
    color: #666666;
    margin-bottom: 4px;
}

.doc-footer .assinatura {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 16px;
    color: #222222;
    margin-bottom: 8px;
}

.linha-assinatura {
    width: 200px;
    height: 1px;
    background-color: #bbbbbb;
}

/* Dados do Débito */
.dados-devedor-box {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.secao-titulo {
    font-size: 14px;
    font-weight: 700;
    color: #003554;
    border-bottom: 2px solid #003554;
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.devedor-info {
    margin-bottom: 16px;
    font-size: 14px;
}

.devedor-info p {
    margin-bottom: 6px;
}

/* Divergências e Valores */
.divergencias-container h5 {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 10px;
}

.valores-card {
    display: flex;
    background-color: #f0f5fa;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;
}

.barra-azul-lateral {
    width: 5px;
    background-color: #003554;
    flex-shrink: 0;
}

.valores-content {
    padding: 14px;
    flex: 1;
}

.valor-original {
    font-size: 12px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-bottom: 4px;
}

.valor-desconto {
    font-size: 14px;
    color: #1e3a5f;
}

.valor-desconto strong {
    font-size: 18px;
    color: #002d54;
}

.tags-valores {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tag-irpf {
    background-color: #f1f3f5;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #495057;
    flex-shrink: 0;
}

.input-desabilitado {
    flex-grow: 1;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    color: #495057;
    height: 36px;
    display: flex;
    align-items: center;
}

/* Notificação Urgente */
.notificacao-urgente-box {
    background-color: var(--danger-light);
    border: 1.5px solid var(--danger-color);
    border-left-width: 5px;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.alerta-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.alerta-icone {
    font-size: 18px;
}

.alerta-header h4 {
    color: #721c24;
    font-size: 13px;
    font-weight: 700;
}

.alerta-body p {
    font-size: 13px;
    color: #721c24;
    margin-bottom: 14px;
}

.lista-penalidades {
    list-style: none;
}

.lista-penalidades li {
    margin-bottom: 10px;
    font-size: 12.5px;
    color: #721c24;
}

.lista-penalidades li strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

/* Ação e Botão Principal */
.acao-regularizacao-box {
    text-align: center;
    margin-bottom: 32px;
}

.acao-regularizacao-box p {
    font-size: 13px;
    color: #444444;
    margin-bottom: 16px;
    text-align: justify;
}

.btn-regularizar-principal {
    background-color: var(--success-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 14px 24px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(19, 160, 75, 0.25);
    transition: background-color 0.2s, transform 0.1s;
    -webkit-appearance: none;
}

.btn-regularizar-principal:hover {
    background-color: #0f8b3f;
}

.btn-regularizar-principal:active {
    transform: scale(0.97);
    background-color: #0d7a36;
}

/* Relatos de Contribuintes */
.relatos-contribuintes-box {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.relatos-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.relatos-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: #003554;
}

.relatos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.relato-card {
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-radius: 6px;
    padding: 14px;
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.relato-card.devedor-atrasado {
    border-left-color: var(--danger-color);
}

.relato-card.devedor-regularizado {
    border-left-color: var(--success-color);
}

.relato-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-red {
    background-color: var(--danger-color);
}

.avatar-green {
    background-color: var(--success-color);
}

.user-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #333333;
}

.relato-time {
    font-size: 10px;
    color: var(--text-light);
}

.relato-text {
    font-size: 12.5px;
    line-height: 1.55;
    color: #444444;
}

.relatos-footer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #e7f3fc;
    border-left: 4px solid #0066cc;
    padding: 10px 14px;
    border-radius: 4px;
    margin-top: 16px;
}

.info-icon {
    background-color: #0066cc;
    color: white;
    font-weight: 800;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.relatos-footer-info p {
    font-size: 12px;
    color: #004b82;
    font-weight: 600;
}

/* ==========================================================================
   TELA DE CHAT (TELA 2)
   ========================================================================== */

.gov-container-chat {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background-color: #f4f6f9;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    min-height: 400px;
}

.chat-profile-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.profile-avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.profile-avatar-container svg {
    width: 100%;
    height: 100%;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
}

.profile-meta {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 14px;
    font-weight: 700;
    color: #333333;
}

.profile-role {
    font-size: 11px;
    color: var(--text-light);
}

.chat-messages-body {
    flex-grow: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #f4f6f9;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Balões de Mensagem */
.chat-balloon {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    animation: slideIn 0.3s ease-out;
}

.chat-balloon.assistant {
    background-color: var(--chat-blue);
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-balloon.user {
    background-color: #e2e8f0;
    color: #1a202c;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Balão digitando */
.typing-bubble-wrapper {
    display: none;
    align-self: flex-start;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
    align-items: center;
    justify-content: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background-color: rgba(255,255,255,0.7);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Área de Inputs do Chat */
.chat-input-area {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 12px;
    flex-shrink: 0;
}

/* Confirmação Form */
.phone-confirm-container {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.phone-confirm-container label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #003554;
    margin-bottom: 10px;
    line-height: 1.4;
}

.input-telefone {
    width: 100%;
    padding: 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.input-telefone:focus {
    border-color: var(--chat-blue);
}

.btn-confirmar-telefone {
    background-color: var(--chat-blue);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
    -webkit-appearance: none;
}

.btn-confirmar-telefone:hover {
    background-color: var(--primary-dark);
}

.btn-confirmar-telefone:active {
    background-color: #001f3d;
}

/* Botões de Resposta Rápida */
.options-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.btn-option-choice {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    -webkit-appearance: none;
}

.btn-option-choice:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-option-choice:active {
    background-color: #e2e8f0;
}

.option-badge-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    flex-shrink: 0;
}

.badge-success {
    background-color: var(--success-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

/* Área de Pagamento (PIX) */
.pix-payment-box {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.pix-badge {
    background-color: #e6f6ee;
    color: #0f8b3f;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 12px;
}

.qr-code-placeholder {
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
    border: 1px solid var(--border-color);
    padding: 8px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.qr-code-placeholder img {
    max-width: 100%;
    max-height: 100%;
}

.pix-instructions {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.4;
}

.copia-cola-container {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.input-pix-code {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 10px;
    color: var(--text-light);
    background-color: #f8f9fa;
    outline: none;
    min-width: 0;
}

.btn-copiar-pix {
    background-color: var(--chat-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: none;
}

.btn-copiar-pix:hover {
    background-color: var(--primary-dark);
}

.btn-copiar-pix:active {
    background-color: #001f3d;
}

.btn-copiar-pix.copiado {
    background-color: var(--success-color);
}

/* ==========================================================================
   RODAPÉ GOV.BR
   ========================================================================== */

.gov-footer {
    background-color: var(--primary-dark);
    color: #ffffff;
    padding: 20px 0;
    font-size: 11px;
    margin-top: auto;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo .custom-logo {
    filter: grayscale(1) invert(1) brightness(10);
    mix-blend-mode: screen;
}

.footer-bottom p {
    opacity: 0.7;
}

/* ==========================================================================
   ANIMAÇÕES
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ==========================================================================
   RESPONSIVIDADE - AJUSTES PARA TELAS MAIORES
   ========================================================================== */

@media (min-width: 480px) {
    .gov-container {
        padding: 0 20px;
    }

    .documento-oficial-box {
        padding: 24px;
    }

    .brasao-container svg {
        width: 60px;
        height: 60px;
    }

    .doc-header h2 {
        font-size: 16px;
    }

    .doc-body {
        font-size: 14.5px;
    }

    .gov-sub-links a {
        font-size: 11px;
    }

    .sub-bar-title {
        font-size: 11px;
    }

    .relato-text {
        font-size: 13px;
    }

    .gov-container-chat {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        height: calc(100vh - 180px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }
}

@media (min-width: 768px) {
    .header-top {
        height: 60px;
    }

    .gov-logo {
        font-size: 28px;
    }

    .gov-main-content {
        padding: 24px 0 60px 0;
    }

    .doc-footer .assinatura {
        font-size: 18px;
    }

    .linha-assinatura {
        width: 250px;
    }
}

/* ==========================================================================
   SYNCPAY PIX - LOADING SPINNER E ESTADOS
   ========================================================================== */

.pix-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    gap: 12px;
}

.pix-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: pix-spin 0.9s linear infinite;
}

@keyframes pix-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pix-loading-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin: 0;
}

.pix-loading-sub {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    margin: 0;
}

/* Estado de erro */

.pix-error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    gap: 8px;
}

.pix-error-icon {
    font-size: 36px;
    margin: 0;
}

.pix-error-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--danger-color);
    text-align: center;
    margin: 0;
}

.pix-error-detail {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    margin: 0;
}
