@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #4cc9f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --bg-body: #f3f4f6;
    --text-main: #334155;
    --text-light: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --header-height: 70px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main, .public-container, .container-admin, .container-logs, .container-relatorio, .login-card-wrapper {
    flex: 1;
}
.hidden { display: none !important; }
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 40px 20px 80px 20px;
    text-align: center;
    color: white;
}
.main-header .logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.main-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--dark);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}
body.admin-body { padding-top: var(--header-height); }
.brand-logo { font-size: 1.2rem; font-weight: 700; color: white; display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; gap: 10px; }
.btn-menu { padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; color: #e2e8f0; background: rgba(255,255,255,0.1); transition: all 0.2s; text-decoration: none; }
.btn-menu:hover, .btn-menu.active { background: var(--primary); color: white; transform: translateY(-2px); }
.user-info { font-size: 0.9rem; color: #cbd5e1; display: flex; align-items: center; gap: 10px; }
.btn-logout { background: var(--danger); color: white; padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.public-container {
    max-width: 800px;
    margin: -50px auto 50px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}
.step-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.step-card h2 {
    color: var(--dark);
    font-size: 1.5rem;
    margin-bottom: 25px;
    border-left: none;
    padding-left: 0;
}
.form-public { max-width: 400px; margin: 0 auto; text-align: left; }
.form-public label { font-weight: 600; color: var(--text-main); margin-bottom: 5px; display: block; }
.form-public input { width: 100%; padding: 15px; border: 2px solid #e2e8f0; border-radius: 10px; margin-bottom: 20px; font-size: 1rem; transition: 0.3s; }
.form-public input:focus { border-color: var(--primary); outline: none; }
.btn-big {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-big:hover { background: var(--primary-dark); transform: translateY(-2px); }
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}
.curso-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: hidden;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}
.curso-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.curso-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.curso-card h3 {
    padding: 15px 15px 5px;
    font-size: 1.1rem;
    color: var(--dark);
    margin: 0;
}
.curso-card p {
    padding: 0 15px 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-grow: 1;
}
.curso-card button {
    width: 100%;
    padding: 15px;
    background: var(--success);
    color: white;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}
.curso-card button:hover { background: #059669; }
.container-admin, .container-logs, .container-relatorio { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.form-card, .table-panel { background: white; border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 25px; margin-bottom: 20px; }
.cards-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card-widget { background: white; padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow-md); position: relative; overflow: hidden; color: white; }
.card-blue { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%); }
.card-gold { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 15px; border-bottom: 1px solid #f1f5f9; text-align: left; }
th { background: #f8fafc; font-weight: 700; color: var(--dark); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.btn { padding: 10px 20px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #64748b; color: white; }
.btn-sm { padding: 5px 10px; font-size: 0.85rem; }
.btn-edit { background: #eff6ff; color: var(--primary); }
.btn-delete { background: #fef2f2; color: var(--danger); }
@media (max-width: 768px) {
    .main-header { padding: 30px 15px 60px; }
    .public-container { margin-top: -30px; }
    .step-card { padding: 25px 15px; }
    .form-grid { grid-template-columns: 1fr; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .top-bar { position: relative; height: auto; flex-direction: column; padding: 15px; gap: 15px; }
    body.admin-body { padding-top: 0; }
}
.main-footer {
    background: var(--white);
    border-top: 1px solid #e2e8f0;
    padding: 40px 20px;
    margin-top: 60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 10;
}

.footer-logo {
    height: 35px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.footer-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1) rotate(2deg);
}

.footer-text {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
}

.footer-text strong {
    color: var(--dark);
    font-weight: 700;
}
.admin-body .main-footer {
    background: transparent;
    border-top: none;
    margin-top: 40px;
    padding-bottom: 20px;
}

@media print {
    .main-footer { display: none; }
}