/* Reset e estilos globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* ========================================
   PÁGINA DE LOGIN - MODERNIZADA
   ======================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* Animação de fundo */
.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.5s ease-out;
}

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

/* Logo e Header do Login */
.logo {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    padding: 40px 32px 32px;
    text-align: center;
    color: #ffffff;
}

.logo-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.logo-badge h1,
.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    color: #ffffff;
}

.logo p {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.95;
    font-weight: 400;
}

/* Card de Informações do Sistema - MODERNIZADO COM AZUL INSTITUCIONAL */
.system-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 24px 32px;
    margin: 0;
    border-bottom: 4px solid rgba(0, 0, 0, 0.05);
}

.system-info-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.system-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}

.system-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
}

.system-details {
    flex: 1;
    color: #ffffff;
}

.system-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 4px;
    font-weight: 600;
    color: #ffffff;
}

.system-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: #ffffff;
}

.system-description {
    font-size: 13px;
    margin-top: 4px;
    opacity: 0.95;
    line-height: 1.4;
    color: #ffffff;
}

/* Alertas na tela de login */
.login-box .alert {
    margin: 24px 32px 0;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

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

.login-box .alert-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.login-box .alert-success {
    background: #efe;
    color: #060;
    border: 1px solid #cfc;
}

/* Formulário de Login */
.login-form {
    padding: 32px;
}

.login-form .form-group {
    position: relative;
    margin-bottom: 24px;
}

.login-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 8px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
    background: #ffffff;
}

.login-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-form input::placeholder {
    color: #aaa;
}

/* Container para senha com toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #333;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

/* Botão de login */
.login-form .btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.login-form .btn-primary:active {
    transform: translateY(0);
}

/* Footer do login */
.login-footer {
    padding: 24px 32px 32px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    border-top: 1px solid #f0f0f0;
}

.login-footer p {
    margin: 4px 0;
}

.login-footer small {
    color: #9ca3af;
    font-size: 12px;
}

/* Responsividade do Login */
@media (max-width: 480px) {
    .login-page {
        padding: 15px;
    }

    .login-box {
        border-radius: 12px;
    }

    .logo {
        padding: 32px 24px 24px;
    }

    .logo-badge h1 {
        font-size: 20px;
    }

    .system-info {
        padding: 20px 24px;
    }

    .system-info-content {
        gap: 12px;
    }

    .system-icon {
        width: 40px;
        height: 40px;
    }

    .system-icon svg {
        width: 20px;
        height: 20px;
    }

    .system-name {
        font-size: 16px;
    }

    .system-description {
        font-size: 12px;
    }

    .login-form,
    .login-footer {
        padding-left: 24px;
        padding-right: 24px;
    }

    .login-box .alert {
        margin-left: 24px;
        margin-right: 24px;
    }
}

/* Modo paisagem mobile */
@media (max-width: 768px) and (max-height: 500px) {
    .login-page {
        padding: 20px 0;
    }

    .login-box {
        border-radius: 12px;
    }

    .logo {
        padding: 24px;
    }

    .system-info {
        padding: 16px 24px;
    }

    .login-form {
        padding: 24px;
    }

    .login-form .form-group {
        margin-bottom: 18px;
    }

    .login-footer {
        padding: 20px 24px;
    }
}

/* ========================================
   FORMULÁRIOS GERAIS
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

/* ========================================
   BOTÕES GERAIS
   ======================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========================================
   ALERTAS GERAIS
   ======================================== */

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========================================
   PAINEL ADMIN
   ======================================== */

.admin-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e293b 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
}

.sidebar-menu {
    list-style: none;
    margin-top: 20px;
}

.sidebar-menu li a {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: rgba(59, 130, 246, 0.2);
}

.main-content {
    flex: 1;
    padding: 30px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.header h1 {
    font-size: 28px;
    color: #1e3a8a;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 14px;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    font-size: 20px;
    color: #1e3a8a;
}

/* ========================================
   TABELAS
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background-color: #f1f5f9;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

table th {
    font-weight: 600;
    color: #1e3a8a;
}

table tbody tr:hover {
    background-color: #f8fafc;
}

/* ========================================
   CHECKBOX E RADIO
   ======================================== */

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* ========================================
   GRID PARA FORMULÁRIOS
   ======================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ========================================
   BADGE
   ======================================== */

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ========================================
   SEARCH
   ======================================== */

.search-box {
    margin-bottom: 20px;
}

.search-box form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box input[type="text"] {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.search-box button,
.search-box .btn {
    margin: 0;
}

/* ========================================
   UTILITÁRIOS
   ======================================== */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.gap-10 {
    gap: 10px;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}