/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f7fb;
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, #ff6f61 0%, #e65b50 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px -5px rgba(230, 91, 80, 0.3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
}

header nav {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

header nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    transition: background 0.2s, transform 0.1s;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    font-size: 0.95rem;
    border: 1px solid rgba(255,255,255,0.2);
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

header p {
    margin-top: 0.75rem;
    width: 100%;
    font-size: 0.95rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* ===== MAIN CONTENT ===== */
main {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
}

/* ===== TÍTULOS ===== */
h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #0f172a;
    border-left: 6px solid #ff6f61;
    padding-left: 1rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    color: #334155;
}

/* ===== FORMULÁRIOS ===== */
form {
    max-width: 900px;
    margin: 0 auto;
}

fieldset {
    border: none;
    background: #f8fafc;
    padding: 1.8rem;
    margin-bottom: 2rem;
    border-radius: 24px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02), 0 2px 8px rgba(0,0,0,0.03);
}

legend {
    font-weight: 600;
    font-size: 1.2rem;
    color: #ff6f61;
    padding: 0.3rem 1.2rem;
    background: white;
    border-radius: 40px;
    border: 1px solid #ffe4e0;
    box-shadow: 0 4px 10px rgba(255,111,97,0.1);
    margin-left: -0.2rem;
}

label {
    display: block;
    margin: 1.2rem 0 0.4rem;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 1rem;
    transition: border 0.2s, box-shadow 0.2s;
    background: white;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #ff6f61;
    box-shadow: 0 0 0 4px rgba(255, 111, 97, 0.15);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' 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 1.2rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: #f1f5f9;
    padding: 1.2rem 1.5rem;
    border-radius: 40px;
    margin-top: 0.5rem;
    border: 1px solid #e2e8f0;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    font-size: 1rem;
}

.radio-group input[type="radio"] {
    accent-color: #ff6f61;
    width: 1.3rem;
    height: 1.3rem;
    margin: 0;
    flex-shrink: 0;
}

/* ===== BOTÕES ===== */
button, .button {
    background: linear-gradient(135deg, #ff6f61 0%, #e65b50 100%);
    color: white;
    border: none;
    padding: 1rem 2.2rem;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 18px -6px rgba(230, 91, 80, 0.5);
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-block;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}

button:hover, .button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -8px rgba(230, 91, 80, 0.6);
}

button:active, .button:active {
    transform: translateY(0);
    box-shadow: 0 5px 12px -4px rgba(230, 91, 80, 0.6);
}

/* ===== TABELAS ===== */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 24px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    min-width: 600px; /* Garante rolagem em telas pequenas */
}

table th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    word-break: break-word;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: #faf9ff;
}

/* ===== LINKS DE AÇÃO ===== */
table a {
    color: #ff6f61;
    text-decoration: none;
    font-weight: 600;
    background: #fff2f0;
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    transition: background 0.2s;
    display: inline-block;
    white-space: nowrap;
    font-size: 0.9rem;
    border: 1px solid #ffe4e0;
}

table a:hover {
    background: #ffe4e0;
}

/* ===== MENSAGENS DE ERRO/SUCESSO ===== */
.error, .success {
    padding: 1.2rem 1.5rem;
    border-radius: 60px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1rem;
    border-left: 6px solid;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.error {
    background: #fee2e2;
    color: #b91c1c;
    border-left-color: #b91c1c;
}

.success {
    background: #dcfce7;
    color: #166534;
    border-left-color: #166534;
}

/* ===== DASHBOARD LINKS ===== */
.dashboard-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.dashboard-links li a {
    display: block;
    background: #f8fafc;
    padding: 1.2rem 2rem;
    border-radius: 40px;
    color: #1e293b;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    text-align: center;
    min-width: 200px;
}

.dashboard-links li a:hover {
    border-color: #ff6f61;
    background: #fff5f3;
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -10px rgba(255, 111, 97, 0.3);
}

/* ===== DETALHES DO CHECKLIST ===== */
.detail-item {
    background: #f8fafc;
    padding: 1.2rem 1.5rem;
    border-radius: 24px;
    margin-bottom: 1rem;
    border-left: 6px solid #ff6f61;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    word-break: break-word;
}

.detail-item strong {
    display: inline-block;
    min-width: 200px;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    margin-top: 2.5rem;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== RESPONSIVIDADE AVANÇADA ===== */

/* Tablets e telas médias */
@media (max-width: 1024px) {
    .container {
        padding: 1.8rem 1.2rem;
    }
    header h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.2rem 1rem;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.5rem;
    }

    header h1 {
        font-size: 1.5rem;
        justify-content: center;
        text-align: center;
    }

    header nav {
        width: 100%;
        justify-content: center;
        gap: 0.6rem;
    }

    header nav a {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        flex: 1 1 auto;
        text-align: center;
    }

    header p {
        text-align: center;
        justify-content: center;
        font-size: 0.9rem;
    }

    main {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }

    h2 {
        font-size: 1.5rem;
        border-left-width: 5px;
        padding-left: 0.8rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    fieldset {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }

    legend {
        font-size: 1.1rem;
        padding: 0.3rem 1rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem;
        border-radius: 30px;
    }

    .radio-group label {
        font-size: 1rem;
    }

    input[type="text"],
    input[type="date"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        padding: 0.8rem 1rem;
        border-radius: 18px;
        font-size: 16px; /* Evita zoom automático no iOS */
    }

    button, .button {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
        border-radius: 50px;
    }

    .dashboard-links ul {
        flex-direction: column;
    }

    .dashboard-links li a {
        width: 100%;
        min-width: auto;
        padding: 1.2rem;
    }

    .detail-item strong {
        display: block;
        min-width: auto;
        margin-bottom: 0.4rem;
    }

    /* Ajuste da tabela: já tem overflow auto, mas podemos reduzir fonte */
    table th, table td {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    table a {
        padding: 0.3rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Celulares pequenos */
@media (max-width: 480px) {
    .container {
        padding: 0.8rem 0.8rem;
    }

    header {
        padding: 1.2rem;
        border-radius: 18px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    header nav {
        gap: 0.4rem;
    }

    header nav a {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }

    main {
        padding: 1.2rem 0.8rem;
        border-radius: 18px;
    }

    h2 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    fieldset {
        padding: 1.2rem 0.8rem;
        margin-bottom: 1.5rem;
    }

    legend {
        font-size: 1rem;
        padding: 0.2rem 1rem;
    }

    .radio-group {
        padding: 0.8rem;
        gap: 0.6rem;
    }

    .radio-group label {
        font-size: 0.95rem;
        gap: 0.4rem;
    }

    .radio-group input[type="radio"] {
        width: 1.2rem;
        height: 1.2rem;
    }

    input, select, textarea {
        font-size: 16px; /* Importante para evitar zoom */
    }

    button, .button {
        font-size: 1rem;
        padding: 0.9rem;
    }

    .error, .success {
        padding: 1rem;
        font-size: 0.95rem;
        border-radius: 40px;
    }

    .detail-item {
        padding: 1rem;
    }

    footer {
        font-size: 0.8rem;
    }
}

/* Telas muito pequenas (dobráveis, 360px) */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.3rem;
    }

    header nav a {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .dashboard-links li a {
        padding: 1rem;
        font-size: 0.95rem;
    }
}

/* Acessibilidade: foco visível */
:focus-visible {
    outline: 3px solid #ff6f61;
    outline-offset: 2px;
}