/* Customizações para Bootstrap 5 - Paleta Unimed Ceará */

/* Variáveis de cor - Paleta Unimed */
:root {
    --unimed-primary: #00995d;      /* Verde Unimed - Cor Primária */
    --unimed-secondary: #0a5f55;    /* Verde escuro - Cor Secundária */
    --unimed-accent: #00bf73;       /* Verde mais claro */
    --unimed-dark: #004d39;         /* Verde muito escuro */
    --unimed-light: #e8f5f0;        /* Verde muito claro */
    
    --primary-color: #00995d;
    --secondary-color: #0a5f55;
    --success-color: #00995d;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #00995d;
    --light-color: #f8f9fa;
    --dark-color: #004d39;
}

/* Estilos globais */
body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Inputs */
.input_text,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
    box-sizing: border-box;
}

/* Campos de formulário em bloco quando fora de tabelas */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    display: block;
    width: 100%;
}

.input_text:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    color: #495057;
    background-color: #fff;
    border-color: #00995d;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 153, 93, 0.25);
}

/* Labels */
label {
    display: inline;
    margin-bottom: 0;
    margin-right: 0.5rem;
    font-weight: 500;
    color: #333;
}

/* Botões */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary,
.btn-success {
    color: #fff;
    background-color: #00995d;
    border-color: #00995d;
}

.btn-primary:hover,
.btn-success:hover {
    color: #fff;
    background-color: #0a5f55;
    border-color: #0a5f55;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 153, 93, 0.3);
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c82333;
    border-color: #bd2130;
}

/* Tabelas */
table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

table td,
table th {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

/* Tabelas de formulário */
table input[type="text"],
table input[type="password"],
table input[type="email"],
table input[type="number"],
table textarea,
table select,
table .input_text {
    display: inline-block;
    width: auto;
    margin: 0;
}

/* Headers de tabela */
table thead th {
    background-color: #004d39;
    border-bottom: 2px solid #00995d;
    font-weight: 600;
    color: #fff;
}

table tbody tr:hover {
    background-color: #e8f5f0;
}

/* Evitar que tabelas do DataTable recebam os estilos de entrada do formulário */
#tabela-lista-boletos input {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Navbar customizado */
#conteiner-menu {
    margin-bottom: 2rem;
}

.navbar-nav .nav-link {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

.navbar-nav .nav-link.active {
    font-weight: 600;
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.form-row > div {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

/* Alert messages */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #004d39;
    background-color: #e8f5f0;
    border-color: #00995d;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #004d39;
    background-color: #e8f5f0;
    border-color: #00995d;
}

/* Espaçamento */
.spacer {
    height: 2rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Container */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Formulário personalizado */
#form1 {
    background-color: #e8f5f0;
    padding: 0.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 153, 93, 0.1);
    /* margin: 1rem 0; */
}

#form1 table {
    margin-bottom: 2rem;
}

#form1 table td {
    padding: 0.75rem !important;
    border: none;
    vertical-align: middle;
    white-space: normal;
}

#form1 table label {
    margin: 0;
    font-size: 0.95rem;
    white-space: nowrap;
    padding-right: 1rem;
    color: #004d39;
    font-weight: 600;
}

#form1 table input[type="text"],
#form1 table input[type="password"],
#form1 table input[type="email"],
#form1 table input[type="number"],
#form1 table .input_text {
    padding: 0.5rem 0.75rem;
    margin: 0 2px;
    display: inline-block;
    width: auto;
    border: 2px solid #e0e0e0;
}

#form1 .input_text:focus {
    outline: none;
    border-color: #00995d;
    box-shadow: 0 0 0 0.2rem rgba(0, 153, 93, 0.25);
}

/* Títulos dentro do formulário */
#form1 h2,
#form1 h3 {
    color: #004d39;
    border-bottom: 2px solid #00995d;
    padding-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .input_text,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    textarea,
    select {
        margin-bottom: 1rem;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    table td,
    table th {
        padding: 0.5rem;
    }
    
    /* Melhorias específicas para index.php */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .card-form {
        margin-left: 0;
        margin-right: 0;
    }
    
    .card-header-custom h2 {
        font-size: 18px !important;
    }
    
    .card-header-custom p {
        font-size: 12px !important;
    }
    
    /* Logo responsivo */
    .container img[alt="Unimed Ceará"] {
        max-width: 180px !important;
    }
    
    /* Campos de carteira em mobile */
    .input-group-custom {
        flex-wrap: wrap !important;
    }
    
    .input-group-custom .input-wrapper {
        min-width: 100px;
    }
    
    /* Botões lado a lado mesmo em mobile (se couberem) */
    .btn-group-custom {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .btn-primary-custom,
    .btn-secondary-custom {
        font-size: 13px !important;
        padding: 10px 16px !important;
    }
    
    /* Alertas mais compactos */
    .alert {
        font-size: 12px !important;
        padding: 10px !important;
    }
    
    /* Info box menor */
    .info-box {
        font-size: 12px !important;
        padding: 10px !important;
    }
    
    /* Toast notifications em mobile */
    .toast {
        max-width: 90vw !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    /* Telas muito pequenas */
    .card-header-custom h2 {
        font-size: 16px !important;
    }
    
    .input-group-custom .input-wrapper {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    .input-divider {
        display: none !important;
    }
    
    .btn-group-custom {
        grid-template-columns: 1fr !important;
    }
    
    /* Logo ainda menor */
    .container img[alt="Unimed Ceará"] {
        max-width: 150px !important;
    }
}
