/* ==========================================================
   PALETA DE CORES E ESTILO MODERNO (DESIGN INSPIRADO NO MOCKUP)
   ========================================================== */

:root {
    --bg-main: #3b0a3d;
    --bg-card: rgba(255, 250, 239, 0.903);
    --bg-card-dark: #2a072c;
    --text-primary: #2d0c2e;
    --text-muted: #7b5f7c;
    --text-light: #ffffff;
    --primary-gradient: linear-gradient(135deg, #e01e5a 0%, #d81b60 50%, #8e24aa 100%);
    --button-gradient: linear-gradient(90deg, #ec407a, #d81b60, #ab47bc);
    --button-hover: linear-gradient(90deg, #d81b60, #c2185b, #8e24aa);
    --accent-pink: #f48fb1;
    --border-color: rgba(236, 64, 122, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg-main);
    color: var(--text-light);
    min-height: 100vh;
}

/* --- TELA DE LOGIN & CADASTRO --- */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 40px;
    border-radius: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    margin-top: 6px;
    margin-bottom: 28px;
}

/* --- PAINEL PRINCIPAL --- */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
}

.user-badge {
    color: var(--accent-pink);
    font-weight: 600;
}

.status-pill {
    background: rgba(236, 64, 122, 0.2);
    color: #f8bbd0;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(236, 64, 122, 0.3);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 12px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- CARDS DE ESTATÍSTICA --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 24px;
    border-radius: 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-top: 8px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- FORMULÁRIOS & CAMPOS --- */
.main-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 32px;
    border-radius: 28px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    margin-bottom: 28px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea {
    width: 100%;
    background: #fffef6eb;
    border: 1.5px solid rgba(140, 106, 142, 0.2);
    border-radius: 14px;
    padding: 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

input:focus, textarea:focus {
    border-color: #d81b60;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.1);
}

input[type="file"] {
    width: 100%;
    font-size: 13px;
    color: var(--text-muted);
}

input[type="file"]::file-selector-button {
    background: var(--button-gradient);
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 12px;
}

/* --- BOTÕES --- */
.btn-primary {
    width: 100%;
    background: var(--button-gradient);
    color: #ffffff;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 20px rgba(216, 27, 96, 0.3);
}

.btn-primary:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(216, 27, 96, 0.4);
}

.btn-secondary {
    background: #ab47bc;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Botão exclusivo para a Área Admin */
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    white-space: nowrap;
    background: linear-gradient(135deg, #6f42c1, #4e2a84);
    color: #ffffff !important;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(111, 66, 193, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-admin:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(111, 66, 193, 0.4);
}

/* --- PROGRESSO --- */
.progress-box {
    background: #f8f0f8;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.progress-bar-bg {
    width: 100%;
    background: #e0d0e0;
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    background: var(--button-gradient);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
}

/* --- TABELAS --- */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th {
    padding: 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid #f0e0f0;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0e0f0;
    color: var(--text-primary);
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 28px;
    border-radius: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
}

/* --- UTILITÁRIOS --- */
.hidden { 
    display: none !important; 
}

.alert-error { 
    background: #ffebee; 
    color: #c62828; 
    padding: 12px; 
    border-radius: 12px; 
    margin-bottom: 16px; 
    font-size: 13px; 
}

.alert-success { 
    background: #e8f5e9; 
    color: #2e7d32; 
    padding: 12px; 
    border-radius: 12px; 
    margin-bottom: 16px; 
    font-size: 13px; 
}

.link-primary { 
    color: #d81b60; 
    text-decoration: none; 
    font-weight: 600; 
}

.link-primary:hover { 
    text-decoration: underline; 
}

/* --- ADAPTAÇÃO PARA CELULARES --- */
@media (max-width: 768px) {
    /* Impede que o texto ou o container transborde da tela */
    html, body {
        overflow-x: hidden;
    }

    /* Reduz um pouco o tamanho dos títulos para caber em telas muito pequenas (ex: iPhone SE) */
    .brand-title {
        font-size: 20px;
    }

    /* Faz os botões do topo ocuparem a largura total se a tela for muito estreita */
    .header-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .header-actions a, 
    .header-actions span {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}