/* Reset básico e tipografia */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f9;
    color: #333;
    padding: 20px;
    transition: all 0.3s ease;
}

/* Suporte a modo escuro/claro */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    table, th, td {
        border-color: #444;
    }
    th {
        background-color: #0056b3;
    }
    tr:nth-child(even) {
        background-color: #2a2a2a;
    }
    form {
        background-color: #2e2e2e;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }
    input[type="text"], input[type="number"], input[type="date"], textarea, select {
        background-color: #3a3a3a;
        color: #e0e0e0;
        border-color: #555;
    }
    input[type="submit"] {
        background-color: #007bff;
    }
    input[type="submit"]:hover {
        background-color: #0056b3;
    }
    a {
        color: #66b0ff;
    }
}

/* Cabeçalhos */
h1 {
    color: #007bff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

th {
    background-color: #007bff;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e9ecef;
    transition: background-color 0.2s ease;
}

/* Formulários */
form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

input[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

input[type="submit"]:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

input[type="submit"]:active {
    transform: translateY(0);
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    td {
        border: none;
        position: relative;
        padding-left: 50%;
    }
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        color: #555;
    }
    form {
        padding: 15px;
    }
    h1 {
        font-size: 1.5rem;
    }
    input[type="submit"] {
        width: 100%;
    }
}

/* Erros */
p[style="color: red;"] {
    color: #dc3545;
    text-align: center;
    margin: 10px 0;
    font-weight: 500;
}