/* ============================================
   SITE.CSS - Design Minimalista e Responsivo
   ============================================ */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores SESI Saúde - Manual de Identidade Visual */
    --primary-color: #164194;        /* Azul PANTONE 293 C */
    --primary-dark: #062751;         /* Azul Escuro */
    --secondary-color: #52ae32;      /* Verde Médio PANTONE 361 C */
    --secondary-dark: #265c24;       /* Verde Escuro */
    --success-color: #d4eed3;        /* Verde Claro (fundo sucesso) */
    --success-text: #265c24;         /* Verde Escuro (texto sucesso) */
    --danger-color: #dc3545;         /* Vermelho para erros */
    --light-bg: #edf1f7;             /* Azul/Cinza Claro */
    --white: #ffffff;                /* Branco puro */
    --text-dark: #062751;            /* Azul Escuro para textos */
    --text-light: #164194;           /* Azul médio para textos secundários */
    --border-color: #d4eed3;         /* Verde claro para bordas */
    --shadow: 0 2px 8px rgba(22, 65, 148, 0.1);
    --shadow-hover: 0 4px 16px rgba(22, 65, 148, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--white);        /* Fundo branco limpo */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-dark);
}

#content {
    width: 100%;
    max-width: 1200px;
}

/* ============================================
   PÁGINA HOME - FORMULÁRIO
   ============================================ */

/* Logo Container */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.logo-container img {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Card Principal */
.form-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(22, 65, 148, 0.12);
    border: 1px solid var(--border-color);
    padding: 40px;
    margin: 0 auto;
    max-width: 800px;
    animation: fadeInUp 0.6s ease-out;
}

.form-card-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--secondary-color);
}

.form-card-header h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-card-header p {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0;
}

/* Campos de Formulário */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
    font-size: 0.95rem;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus {
    border-color: var(--secondary-color);
    border-left: 3px solid var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(124, 179, 66, 0.15);
    outline: none;
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.invalid-feedback,
.field-validation-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

/* Select */
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    background-color: var(--white);
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--secondary-color);
    border-left: 3px solid var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(82, 174, 50, 0.15);
    outline: none;
}

/* Botões */
.btn {
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 78, 158, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 65, 148, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

/* Alert Messages */
.alert {
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: none;
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   PÁGINA ADMIN - LOGIN
   ============================================ */

.login-container {
    max-width: 400px;
    margin: 0 auto;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(22, 65, 148, 0.12);
    padding: 40px;
    animation: fadeInUp 0.6s ease-out;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.login-btn {
    width: 100%;
    margin-top: 20px;
}

/* ============================================
   PÁGINA ADMIN - ÍNDICE
   ============================================ */

.admin-container {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 30px;
    margin: 20px auto;
    max-width: 1400px;
    box-shadow: 0 4px 24px rgba(22, 65, 148, 0.1);
}

.admin-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-bg);
}

.admin-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.filter-section {
    background: var(--light-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 30px;
}

.filter-section h5 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 20px;
}

/* DataTables Customização */
.dataTables_wrapper {
    padding: 20px 0;
}

.dataTables_filter input {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 15px;
    margin-left: 10px;
}

.dataTables_length select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 15px;
    margin: 0 10px;
}

.dataTables_wrapper .dt-buttons {
    margin-bottom: 15px;
}

.dt-button {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    margin-right: 10px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.dt-button:hover {
    background: #003d7a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 78, 158, 0.3) !important;
}

.dt-button:first-child {
    background: var(--secondary-color) !important;
}

.dt-button:first-child:hover {
    background: #6fa035 !important;
}

table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}

table.dataTable thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, #003d7a 100%);
    color: var(--white);
    font-weight: 600;
    padding: 15px;
    border: none;
}

table.dataTable tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

table.dataTable tbody tr:hover {
    background-color: var(--light-bg);
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 78, 158, 0.06);
}

.card-header {
    background: linear-gradient(135deg, var(--light-bg) 0%, #ffffff 100%);
    border-bottom: 2px solid var(--secondary-color);
    padding: 20px;
    border-radius: 10px 10px 0 0 !important;
}

.card-header h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Botões de Ação */
.btn-success {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-success:hover,
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablets */
@media (max-width: 768px) {
    body {
        padding: 10px;
        background: var(--light-bg);
    }

    .form-card {
        padding: 25px;
    }

    .form-card-header h2 {
        font-size: 1.5rem;
    }

    .logo-container img {
        max-width: 250px;
    }

    .admin-container {
        padding: 20px;
    }

    .admin-header h1 {
        font-size: 1.5rem;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 10px;
        font-size: 0.9rem;
    }

    .dt-button {
        padding: 8px 15px !important;
        font-size: 0.9rem !important;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .form-card {
        padding: 20px;
    }

    .form-card-header h2 {
        font-size: 1.25rem;
    }

    .logo-container img {
        max-width: 200px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .admin-container {
        padding: 15px;
    }

    table.dataTable {
        font-size: 0.85rem;
    }

    .dataTables_wrapper .dt-buttons {
        display: flex;
        flex-direction: column;
    }

    .dt-button {
        margin-bottom: 10px !important;
        width: 100%;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
