/* 
   Design: Dark Professional Theme
   Inspirado na pasta de pagamento - Elegante e menos cansativo para os olhos
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Cores principais - Tema escuro */
    --bg-gradient-start: #002C5F;
    --bg-gradient-mid: #001E3C;
    --bg-gradient-end: #002C5F;
    
    /* Cores de marca */
    --brand-primary: #002C5F;
    --brand-secondary: #00AAD2;
    --brand-accent: #007FA8;
    --brand-light: #E8F4F8;
    --brand-dark: #001E3C;
    
    /* Cores de superfície */
    --surface-color: rgba(255, 255, 255, 0.98);
    --surface-hover: rgba(255, 255, 255, 1);
    
    /* Cores de texto */
    --text-primary: #002C5F;
    --text-secondary: #4A5568;
    --text-light: #718096;
    --text-white: #FFFFFF;
    
    /* Cores de estado */
    --danger-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    
    /* Sombras */
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    --shadow-button: 0 15px 35px rgba(0, 44, 95, 0.4);
    --shadow-input: 0 2px 8px rgba(0, 44, 95, 0.1);
    
    /* Bordas */
    --border-radius: 24px;
    --border-radius-sm: 12px;
    --border-radius-lg: 20px;
    
    /* Transições */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 16px;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Glass Card - Estilo principal dos cards */
.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background: var(--surface-color);
    padding: 6px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 8px;
    border-radius: 16px;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.tab-btn i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.tab-btn:hover {
    color: var(--brand-secondary);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    color: var(--text-white);
    box-shadow: 0 8px 20px rgba(0, 44, 95, 0.3);
}

/* Form Sections */
.form-section {
    margin-bottom: 20px;
    padding: 24px;
    border-radius: var(--border-radius);
    background: var(--surface-color);
    box-shadow: var(--shadow-card);
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--brand-light);
}

.optional {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    background: var(--brand-light);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Inputs */
.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 4px;
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E2E8F0;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    outline: none;
}

input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

input:focus {
    border-color: var(--brand-secondary);
    background: var(--text-white);
    box-shadow: 0 0 0 4px rgba(0, 170, 210, 0.15);
}

input:hover:not(:focus) {
    border-color: #CBD5E1;
    background: linear-gradient(135deg, var(--brand-light) 0%, #D0EBF2 100%);
}

input.input-error {
    border-color: var(--danger-color);
    background: #FEF2F2;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Layout Helpers */
.row {
    display: flex;
    gap: 15px;
}

.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }

.hidden {
    display: none !important;
}

/* Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 40px;
}

button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-button);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 44, 95, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    color: var(--text-secondary);
    border: 2px solid #E2E8F0;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--brand-light) 0%, #D0EBF2 100%);
    border-color: var(--brand-secondary);
    color: var(--brand-primary);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%);
    color: var(--text-white);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.4);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 30, 60, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: var(--surface-color);
    padding: 32px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-card);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.modal-content p {
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

/* Valor Section */
.valor-section {
    text-align: center;
    background: linear-gradient(135deg, var(--brand-light) 0%, #D0EBF2 100%);
    border: 3px solid var(--brand-secondary);
}

.valor-display {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin: 12px 0;
    text-shadow: 0 2px 4px rgba(0, 44, 95, 0.1);
}

.valor-detalhe {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Beneficiários Múltiplos (Pessoas) */
.pessoa-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pessoa-titulo::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-accent) 100%);
    border-radius: 2px;
}

.beneficiario-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    position: relative;
    border: 2px solid #E2E8F0;
    transition: var(--transition);
}

.beneficiario-card:hover {
    border-color: var(--brand-secondary);
    box-shadow: 0 8px 25px rgba(0, 170, 210, 0.15);
}

.action-btn-container {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px dashed #E2E8F0;
    text-align: center;
}

.remove-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    background: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%);
    color: var(--text-white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transition: var(--transition);
}

.remove-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

/* Error Messages */
.error-msg {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-msg::before {
    content: '⚠';
    font-size: 0.9rem;
}

.cpf-error-msg {
    display: block;
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
}

.cep-error-msg {
    display: block;
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
}

/* Loading State */
.loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 400px) {
    .tabs {
        padding: 4px;
    }
    
    .tab-btn {
        padding: 10px 4px;
        font-size: 0.7rem;
    }
    
    .tab-btn i {
        font-size: 1.1rem;
    }
    
    .form-section {
        padding: 18px;
    }
    
    .valor-display {
        font-size: 2.2rem;
    }
    
    .row {
        flex-direction: column;
        gap: 0;
    }
    
    .w-30, .w-40, .w-60, .w-70 {
        width: 100%;
    }
}

/* Botão Excluir Endereço */
.endereco-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-excluir-endereco {
    background: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%);
    color: var(--text-white);
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: auto;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: var(--transition);
}

.btn-excluir-endereco:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-excluir-endereco:active {
    transform: translateY(0);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--brand-light);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-secondary);
}

/* Security Badge Style (opcional para futuro uso) */
.security-badge {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border: 1px solid var(--success-color);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #047857;
}

/* Animação de entrada suave */
.form-section {
    animation: fadeInUp 0.4s ease;
}

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

/* Estilo para campos de data/hora com validação */
.date-error-msg,
.time-error-msg {
    display: block;
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
}


/* Select de Estado */
select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E2E8F0;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23002C5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

select:focus {
    border-color: var(--brand-secondary);
    background-color: var(--text-white);
    box-shadow: 0 0 0 4px rgba(0, 170, 210, 0.15);
}

select:hover:not(:focus) {
    border-color: #CBD5E1;
    background-color: var(--brand-light);
}

select.input-error {
    border-color: var(--danger-color);
    background-color: #FEF2F2;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

select option {
    padding: 12px;
    background: white;
    color: var(--text-primary);
}

/* Mensagem de erro do Estado */
#estadoError {
    display: block;
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
}

/* Date/Time Error Messages */
.date-error-msg,
.time-error-msg {
    display: block;
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
}
