/* ============================================================
   Academy — Stylesheet
   Paleta: #E8785A / #F0957A / #FDEEE9 / #FAF7F4 / #F2EDE8 / #1A1A1A
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --coral:        #E8785A;
    --coral-mid:    #F0957A;
    --coral-strong: #D4573A;
    --coral-pale:   #FDEEE9;
    --coral-hover:  #f5ddd6;

    --bg:           #FAF7F4;
    --bg-alt:       #F2EDE8;
    --white:        #FFFFFF;
    --text:         #1A1A1A;
    --text-soft:    #6B6560;
    --border:       #E8E0D8;

    --success:      #2E7D52;
    --success-bg:   #E8F5EE;
    --error:        #C0392B;
    --error-bg:     #FDECEA;

    --sidebar-w:    260px;
    --radius:       10px;
    --shadow:       0 2px 12px rgba(232,120,90,.10);
    --shadow-sm:    0 1px 4px rgba(0,0,0,.07);
    --transition:   .18s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--coral-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.d-flex          { display: flex; }
.gap-1           { gap: 8px; }
.gap-2           { gap: 16px; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap       { flex-wrap: wrap; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-muted   { color: var(--text-soft); font-size: .875em; }
.text-center  { text-align: center; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: .78em; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--error-bg);   color: var(--error); }
.badge-coral   { background: var(--coral-pale);  color: var(--coral-strong); }

/* --- Botões ----------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 20px; border-radius: var(--radius);
    font-size: .9rem; font-weight: 600; cursor: pointer;
    border: none; transition: var(--transition); text-decoration: none;
    line-height: 1; white-space: nowrap;
}
.btn-primary { background: var(--coral); color: var(--white); }
.btn-primary:hover { background: var(--coral-strong); text-decoration: none; color: var(--white); }
.btn-outline { background: transparent; color: var(--coral-strong); border: 2px solid var(--coral); }
.btn-outline:hover { background: var(--coral-pale); text-decoration: none; }
.btn-danger  { background: var(--error); color: var(--white); }
.btn-danger:hover { opacity: .88; text-decoration: none; color: var(--white); }
.btn-dark    { background: var(--text); color: var(--white); }
.btn-dark:hover { opacity: .85; text-decoration: none; color: var(--white); }
.btn-sm      { padding: 5px 13px; font-size: .8rem; }
.btn-block   { width: 100%; justify-content: center; }

/* --- Formulários ------------------------------------------ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: .88rem; }
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: .95rem; color: var(--text); background: var(--white);
    transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(232,120,90,.14); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-text { font-size: .8rem; color: var(--text-soft); margin-top: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* --- Cards ------------------------------------------------- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1.5px solid var(--border); }
.card-header h2 { font-size: 1.1rem; }
.card-thumb { background: var(--coral-pale); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; height: 160px; display: flex; align-items: center; justify-content: center; color: var(--coral); font-size: 3rem; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px; }
.card-body h3 { font-size: 1rem; margin-bottom: 6px; }
.card-body p  { font-size: .875rem; color: var(--text-soft); margin-bottom: 14px; }

/* --- Grid de cursos --------------------------------------- */
.cursos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.curso-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); border: 1px solid var(--border); }
.curso-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(232,120,90,.18); }

/* --- Progresso -------------------------------------------- */
.progress-bar-wrap { background: var(--coral-pale); border-radius: 20px; height: 8px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { background: linear-gradient(90deg, var(--coral), var(--coral-strong)); height: 100%; border-radius: 20px; transition: width .4s; }

/* --- Sidebar ---------------------------------------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--text); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; overflow-y: auto; }
.sidebar-logo { padding: 24px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo h1 { color: var(--coral-mid); font-size: 1.3rem; letter-spacing: 1.5px; font-weight: 800; }
.sidebar-logo span { color: rgba(255,255,255,.35); font-size: .78rem; }
.sidebar-user { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-user strong { color: var(--white); display: block; margin-bottom: 2px; font-size: .9rem; }
.sidebar-user span   { color: rgba(255,255,255,.35); font-size: .78rem; }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,.6); font-size: .9rem; font-weight: 500; transition: background var(--transition), color var(--transition); text-decoration: none; }
.sidebar nav a:hover, .sidebar nav a.ativo { background: rgba(232,120,90,.18); color: var(--coral-mid); }
.sidebar nav a .icon { font-size: 1.05rem; width: 22px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer form button { background: none; border: none; cursor: pointer; color: rgba(255,255,255,.4); font-size: .85rem; display: flex; align-items: center; gap: 8px; width: 100%; transition: color var(--transition); }
.sidebar-footer form button:hover { color: var(--coral-mid); }

.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 32px; }
.page-header { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.5rem; }

/* --- Tabela ----------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.table th { background: var(--text); color: var(--white); padding: 12px 16px; text-align: left; font-size: .8rem; font-weight: 600; letter-spacing: .6px; white-space: nowrap; text-transform: uppercase; }
table.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tr:hover td { background: var(--coral-pale); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Stats ------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; align-items: center; gap: 16px; border-left: 4px solid var(--coral); }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; background: var(--coral-pale); color: var(--coral-strong); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-card h3 { font-size: 1.7rem; line-height: 1; }
.stat-card p  { font-size: .75rem; color: var(--text-soft); margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; }

/* --- Aula -------------------------------------------------- */
.aula-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.video-wrap  { margin-bottom: 16px; }
.aula-descricao { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 16px; line-height: 1.75; border-left: 4px solid var(--coral); }
.modulo-lista { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.modulo-lista h3 { background: var(--text); color: var(--white); padding: 11px 16px; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.modulo-lista ul { list-style: none; }
.modulo-lista ul li a { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: .875rem; text-decoration: none; transition: background var(--transition); }
.modulo-lista ul li a:hover { background: var(--coral-pale); }
.modulo-lista ul li a.atual { background: var(--coral-pale); color: var(--coral-strong); font-weight: 600; }
.modulo-lista ul li a .check { color: var(--success); font-size: .8rem; margin-left: auto; }

/* --- Login ------------------------------------------------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1A1A1A 0%, #2d2420 100%); padding: 20px; }
.login-box { background: var(--white); border-radius: 16px; padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
.login-box .logo { text-align: center; margin-bottom: 32px; }
.login-box .logo h1 { font-size: 2rem; color: var(--coral); letter-spacing: 3px; font-weight: 800; margin-bottom: 4px; }
.login-box .logo p { color: var(--text-soft); font-size: .9rem; }

/* --- Alertas ----------------------------------------------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: .9rem; border-left: 4px solid; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-danger  { background: var(--error-bg);   color: var(--error);   border-color: var(--error); }
.alert-info    { background: var(--coral-pale);  color: var(--coral-strong); border-color: var(--coral); }

/* --- Flash ------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: .9rem; border-left: 4px solid; }

/* --- Breadcrumb -------------------------------------------- */
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: .83rem; color: var(--text-soft); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--coral-strong); }
.breadcrumb span { color: var(--border); }

/* --- Módulos no curso -------------------------------------- */
.modulo-section { margin-bottom: 16px; }
.modulo-titulo { background: var(--bg-alt); padding: 12px 18px; border-radius: var(--radius) var(--radius) 0 0; font-weight: 700; color: var(--text); border-left: 4px solid var(--coral); font-size: .92rem; }
.aulas-list { background: var(--white); box-shadow: var(--shadow); border-radius: 0 0 var(--radius) var(--radius); }
.aulas-list a { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; transition: background var(--transition); font-size: .9rem; }
.aulas-list a:last-child { border-bottom: none; }
.aulas-list a:hover { background: var(--coral-pale); }
.aulas-list .num { width: 26px; height: 26px; border-radius: 50%; background: var(--coral-pale); color: var(--coral-strong); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }

/* --- Bloqueio de acesso ------------------------------------ */
.acesso-bloqueado { text-align: center; padding: 60px 24px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 500px; margin: 60px auto; }
.acesso-bloqueado .icone { font-size: 3.5rem; margin-bottom: 16px; }
.acesso-bloqueado h2 { font-size: 1.4rem; margin-bottom: 10px; }
.acesso-bloqueado p  { color: var(--text-soft); margin-bottom: 24px; line-height: 1.7; }

/* --- Responsivo -------------------------------------------- */
@media (max-width: 960px) {
    .aula-layout { grid-template-columns: 1fr; }
    .form-row    { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; }
    .sidebar.aberta { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .menu-toggle { display: flex; position: fixed; top: 12px; left: 12px; z-index: 200; background: var(--coral); color: white; border: none; border-radius: 8px; width: 40px; height: 40px; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 769px) { .menu-toggle { display: none; } }
