:root {
    --cfc-yellow: #f1c40f;
    --cfc-yellow-2: #ffd73d;
    --cfc-green: #008d34;
    --cfc-green-dark: #006d28;
    --cfc-blue: #003b89;
    --cfc-dark: #1b1b1b;
    --cfc-soft: #fff8d7;
    --cfc-muted: #667085;
    --cfc-border: #e9e2c9;
}

html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: #ffffff;
    color: var(--cfc-dark);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--cfc-green); }
a:hover { color: var(--cfc-green-dark); }
.shadow-soft { box-shadow: 0 18px 55px rgba(15,23,42,.10); }
.text-cfc-dark { color: var(--cfc-dark); }
.bg-soft { background: var(--cfc-soft); }

/* Topo igual site institucional */
.top-contact-bar {
    background: #e7b708;
    min-height: 50px;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
}
.top-contact-bar a,
.top-contact-bar span { color: #fff; text-decoration: none; }
.top-contact-bar i { font-size: 1rem; }

.main-navbar {
    background: #fff !important;
    min-height: 52px;
    position: relative;
    z-index: 1040;
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.main-navbar .container { position: relative; }
.navbar-brand { z-index: 4; }
.navbar-brand img { max-height: 74px; width: auto; }
.brand-fallback {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 38% 28%, #fff59f, #f1c40f 58%, #078536 60%);
    color: #073e1c;
    font-weight: 950;
    border: 3px solid rgba(0,141,52,.22);
    box-shadow: 0 6px 18px rgba(0,0,0,.14);
}
.main-navbar .nav-link {
    color: var(--cfc-green);
    font-weight: 900;
    letter-spacing: .01em;
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
}
.main-navbar .nav-link:hover,
.main-navbar .nav-link:focus { color: #005d23; }

.btn-primary {
    background: linear-gradient(135deg, #073884, #003b89);
    border: 0;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(0,59,137,.26);
}
.btn-primary:hover,
.btn-primary:focus { color:#fff; filter: brightness(.97); }
.btn-success {
    background: var(--cfc-green);
    border-color: var(--cfc-green);
    font-weight: 900;
}
.btn-success:hover { background: var(--cfc-green-dark); border-color: var(--cfc-green-dark); }
.btn-warning { background: var(--cfc-yellow); border-color: var(--cfc-yellow); color:#111; font-weight:900; }
.btn-outline-primary { color: var(--cfc-blue); border-color: var(--cfc-blue); }
.btn-outline-primary:hover { background: var(--cfc-blue); border-color: var(--cfc-blue); color:#fff; }

/* Hero premium estilo referencia */
.institutional-hero {
    position: relative;
    overflow: hidden;
    min-height: 435px;
    background:
        linear-gradient(90deg, rgba(239,190,0,.98), rgba(245,200,10,.96)),
        var(--hero-bg);
    background-size: cover;
    background-position: center;
}
.institutional-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.20) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: .45;
    pointer-events: none;
}
.institutional-hero::after {
    content: "";
    position: absolute;
    left: -8%;
    bottom: -118px;
    width: 118%;
    height: 150px;
    background: #fff;
    transform: rotate(-2deg);
    transform-origin: left center;
    z-index: 2;
}
.hero-wide { position: relative; z-index: 3; }
.hero-vehicle-col { min-height: 435px; position: relative; }
.hero-vehicle {
    position: absolute;
    left: -70px;
    bottom: 18px;
    width: min(820px, 64vw);
    max-height: 390px;
    object-fit: contain;
    filter: drop-shadow(0 24px 18px rgba(0,0,0,.22));
}
.hero-text-col {
    min-height: 435px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 5vw 70px 24px;
}
.hero-content-card { width: min(100%, 520px); text-align: center; }
.hero-title {
    margin: 0;
    color: #fff;
    font-size: clamp(3rem, 4.7vw, 5.1rem);
    line-height: .98;
    font-weight: 950;
    letter-spacing: .09em;
    text-transform: uppercase;
    text-shadow: 0 8px 28px rgba(0,0,0,.13);
}
.hero-divider {
    border: 0;
    border-top: 2px dotted rgba(0,141,52,.80);
    opacity: 1;
    margin: 22px auto 16px;
    max-width: 460px;
}
.hero-subtitle {
    color: #fff;
    font-size: clamp(1.08rem, 1.15vw, 1.52rem);
    letter-spacing: .03em;
    text-shadow: 0 4px 16px rgba(0,0,0,.10);
}
.hero-subtitle strong { color: var(--cfc-blue); font-weight: 950; }
.hero-action { min-width: 360px; letter-spacing: .10em; border-radius: 4px !important; }

.section-eyebrow {
    color: var(--cfc-green);
    text-transform: uppercase;
    font-weight: 950;
    letter-spacing: .12em;
    font-size: .86rem;
}
.section-title {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #202020;
}
.section-title::after {
    content: "";
    display: block;
    width: min(92%, 990px);
    height: 1px;
    margin: 14px auto 0;
    border-top: 2px dotted rgba(231,183,8,.45);
}
.section-lead { color: var(--cfc-muted); font-size: 1.08rem; }

/* Sobre nós */
.about-card {
    border: 0;
    border-radius: 0;
    background: #fff;
    overflow: hidden;
}
.about-media img { width: 100%; display:block; object-fit: contain; }
.about-copy h3 { font-weight: 900; line-height: 1.22; }
.about-copy p { color: #4b5563; line-height: 1.75; }
.stat-mini {
    border-left: 4px solid var(--cfc-green);
    padding: 10px 14px;
    background: #f8fff9;
}

/* Serviços parecidos com a referencia */
.services-section { background: #fff; }
.service-card {
    height: 100%;
    border: 2px solid var(--cfc-green);
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0,0,0,.10);
    padding: 34px 30px;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 18px 45px rgba(0,0,0,.14); }
.service-card .service-icon {
    color: var(--cfc-green);
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 26px;
}
.service-card h3 {
    font-weight: 950;
    font-size: clamp(1.6rem, 2vw, 2.15rem);
    letter-spacing: .03em;
    line-height: 1.08;
}
.service-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    margin: 24px 0 30px;
    color: #333;
}
.service-items span::before { content: "— "; color: #333; }
.service-card .btn { margin-top: auto; border-radius: 2px; }

/* CTA amarelo com fundo */
.enroll-cta {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(rgba(231,183,8,.86), rgba(231,183,8,.86)),
        var(--cta-bg, linear-gradient(135deg, #f1c40f, #e7b708));
    background-size: cover;
    background-position: center;
    color: #fff;
}
.enroll-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.20), transparent 32%);
}
.enroll-cta::after {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    width: 100%;
    height: 14px;
    background: linear-gradient(135deg, transparent 8px, #fff 0) 0 0/18px 14px repeat-x;
}
.enroll-cta .container { position: relative; z-index: 2; }
.enroll-cta h2 {
    font-size: clamp(2.3rem, 4vw, 4.3rem);
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.enroll-cta p { font-size: 1.25rem; font-weight: 700; letter-spacing:.04em; }
.enroll-cta .btn { min-width: 300px; border-radius: 2px; }

/* Links e informações */
.link-card,
.more-card,
.contact-card,
.category-card,
.info-card {
    border: 1px solid var(--cfc-border);
    background: #fff;
    box-shadow: 0 14px 38px rgba(15,23,42,.08);
}
.link-card { border-radius: 3px; padding: 30px; text-align:center; height:100%; }
.link-card h3 { font-weight: 900; }
.more-card { border-radius: 18px; padding: 24px; height:100%; }
.more-card h3 { color: var(--cfc-green); font-weight:900; }
.more-card ul { margin-bottom:0; padding-left: 1.1rem; color:#4b5563; }
.category-card { border-radius: 18px; padding: 26px; height:100%; text-align:center; }
.category-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items:center;
    justify-content:center;
    background:#111;
    color: var(--cfc-yellow);
    font-weight: 950;
    font-size: 1.5rem;
    border: 4px solid var(--cfc-yellow);
}
.contact-card { border-radius: 22px; }
.feature-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items:center;
    justify-content:center;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffe86b, var(--cfc-yellow));
    color:#111;
    font-weight:900;
    box-shadow:0 12px 25px rgba(242,196,0,.22);
}
.text-muted, .service-card p, .category-card p, .info-card p { color: var(--cfc-muted)!important; }

/* Calendario e area do aluno */
.calendar-day { min-height: 150px; background: #fff; border: 1px solid #f0ebd7; border-radius: 18px; padding: 12px; }
.calendar-day.today { border-color: var(--cfc-yellow); box-shadow: 0 10px 24px rgba(242,196,0,.14); }
.slot-pill { display:block; width:100%; border:0; border-radius:12px; padding:8px 10px; font-size:.86rem; text-align:left; margin-bottom:8px; }
.slot-free { background:#e8f7ee; color:#116034; }
.slot-busy { background:#eef2f7; color:#64748b; }
.slot-mine { background:#fff2a3; color:#6b5200; }

/* Admin */
.admin-sidebar { background: linear-gradient(180deg, #111111 0%, #202020 100%); min-height: calc(100vh - 104px); border:1px solid rgba(242,196,0,.18); }
.admin-sidebar a { color: rgba(255,255,255,.84); text-decoration:none; display:block; padding:12px 14px; border-radius:12px; margin-bottom:6px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background:rgba(242,196,0,.14); color:#ffe76b; }
.install-bg { min-height:100vh; background: radial-gradient(circle at top, #fff0a5, #fffaf0 48%, #fff); }
.table-responsive { border-radius:18px; }
.form-control, .form-select { border-radius:14px; border-color:#e8dec2; }
.form-control:focus, .form-select:focus { border-color: rgba(242,196,0,.75); box-shadow: 0 0 0 .25rem rgba(242,196,0,.18); }

.floating-whatsapp {
    position:fixed;
    right:18px;
    bottom:18px;
    z-index:1080;
    display:inline-flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    color:#fff;
    background:linear-gradient(135deg,#25D366,#18a84c);
    border-radius:999px;
    padding:12px 18px 12px 14px;
    box-shadow:0 16px 40px rgba(37,211,102,.35);
    transition:transform .2s ease, box-shadow .2s ease;
}
.floating-whatsapp:hover { color:#fff; transform:translateY(-2px); box-shadow:0 20px 44px rgba(37,211,102,.45); }
.floating-whatsapp i { font-size:1.45rem; line-height:1; }
.floating-whatsapp-label { font-weight:800; font-size:.95rem; }
.floating-whatsapp::before { content:""; position:absolute; inset:-6px; border-radius:inherit; border:1px solid rgba(37,211,102,.20); animation:pulseWhats 2.2s infinite; }
@keyframes pulseWhats { 0%{transform:scale(.96);opacity:.85} 70%{transform:scale(1.08);opacity:0} 100%{transform:scale(1.08);opacity:0} }

@media (min-width: 992px) {
    .main-navbar .navbar-brand {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin: 0 !important;
    }
    .main-navbar .navbar-collapse { width: 100%; }
}
@media (max-width: 1199px) {
    .hero-vehicle { left: -120px; width: 680px; }
}
@media (max-width: 991px) {
    .top-contact-bar .address-item { display:none!important; }
    .main-navbar { min-height: 70px; }
    .navbar-brand img { max-height:54px; }
    .institutional-hero { min-height: auto; }
    .hero-vehicle-col { min-height: 260px; order: 2; }
    .hero-text-col { min-height: auto; order: 1; padding: 45px 22px 16px; }
    .hero-vehicle { position:relative; left:auto; bottom:auto; width: 100%; max-height: 310px; margin: 0 auto 42px; display:block; }
    .hero-action { min-width: auto; width: 100%; }
    .admin-sidebar { min-height:auto; }
}
@media (max-width: 767px) {
    .top-contact-bar { font-size:.82rem; min-height: auto; }
    .top-contact-bar .phone-item { display:none!important; }
    .hero-title { letter-spacing:.04em; font-size: 2.65rem; }
    .section-title { letter-spacing:.04em; }
    .calendar-day { min-height:auto; }
    .service-card { min-height: auto; }
    .floating-whatsapp { right:14px; bottom:14px; padding:13px; }
    .floating-whatsapp-label { display:none!important; }
}

.rating-stars {
    color: #f1c40f;
    font-size: 1.05rem;
    letter-spacing: .06em;
    text-shadow: 0 1px 0 rgba(0,0,0,.10);
}
.rating-form textarea,
.rating-form select {
    min-width: 220px;
}
.admin-sidebar .bi-star-fill { color: #f1c40f; }

.pwa-install-button {
    position: fixed;
    right: 18px;
    left: auto;
    bottom: 18px;
    z-index: 1080;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #111111, #2a2a2a);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.pwa-install-button i { color: var(--cfc-yellow); font-size: 1.25rem; }
.pwa-install-button:hover { transform: translateY(-2px); }

@media (max-width: 767px) {
    .pwa-install-button {
        right: 14px;
        left: auto;
        bottom: 14px;
        padding: 13px;
    }
    .pwa-install-button span { display: none; }
}

/* Correção final do calendário: grid independente do Bootstrap CDN */
.calendar-header-wrap {
    width: 100%;
}
.calendar-month-nav {
    flex-wrap: nowrap;
}
.calendar-week-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: .45rem;
    text-align: center;
    font-weight: 900;
    color: var(--cfc-muted);
    font-size: .9rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}
.calendar-cell {
    min-width: 0;
}
.calendar-empty {
    min-height: 150px;
}
.calendar-date-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.calendar-mobile-weekday {
    display: none;
    font-weight: 700;
}
.calendar-day {
    height: 100%;
    min-width: 0;
    word-break: normal;
    overflow-wrap: anywhere;
}
.calendar-day form {
    margin: 0;
}

@media (max-width: 767.98px) {
    .calendar-header-wrap {
        align-items: stretch !important;
    }
    .calendar-month-nav {
        width: 100%;
        display: flex;
    }
    .calendar-month-nav .btn {
        flex: 1 1 0;
        min-width: 0;
    }
    .calendar-week-head,
    .calendar-empty {
        display: none !important;
    }
    .calendar-grid {
        display: block;
    }
    .calendar-cell {
        display: block;
        margin-bottom: 1rem;
    }
    .calendar-day {
        min-height: 132px;
        height: auto;
        padding: 16px 18px;
    }
    .calendar-mobile-weekday {
        display: inline-block;
    }
}

/* Cores das aulas definidas pelo admin */
.lesson-row-blue td:first-child { border-left: 6px solid #0d6efd; }
.lesson-row-green td:first-child { border-left: 6px solid #198754; }
.lesson-row-red td:first-child { border-left: 6px solid #dc3545; }
.lesson-row-blue:not(.table-danger):not(.table-warning) { background: rgba(13, 110, 253, .035); }
.lesson-row-green:not(.table-danger):not(.table-warning) { background: rgba(25, 135, 84, .045); }
.lesson-row-red:not(.table-danger):not(.table-warning) { background: rgba(220, 53, 69, .045); }


.calendar-holiday {
    background: #fff3cd !important;
    border-color: rgba(241,196,15,.55) !important;
}
.holiday-pill {
    background: linear-gradient(135deg, #fff3cd, #fff8e1);
    border: 1px solid rgba(241,196,15,.55);
    color: #6b4e00;
    border-radius: 14px;
    padding: .55rem .65rem;
    font-size: .82rem;
    line-height: 1.2;
}
.student-payment-card {
    background: linear-gradient(135deg, #ffffff, #fffdf2);
    border-color: rgba(0,141,52,.15) !important;
}


.holiday-admin-summary {
    border: 1px solid rgba(245, 158, 11, .22) !important;
    background: linear-gradient(135deg, rgba(255, 248, 225, .92), rgba(255, 255, 255, .96));
}
.holiday-admin-pill {
    font-size: .86rem;
    padding: .55rem .75rem;
}


/* Capas de e-books, materiais e conteúdos de formação */
.content-cover-card {
    width: 100%;
    height: 210px;
    object-fit: cover;
    background: #f3f4f6;
    display: block;
}
.content-cover-thumb,
.content-cover-placeholder {
    width: 72px;
    height: 92px;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid rgba(0,0,0,.08);
}
.content-cover-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #6c757d;
}
.min-width-0 {
    min-width: 0;
}

/* Pastas de contatos do instrutor */
.contact-folder-tabs .nav-link {
    border: 1px solid rgba(13, 110, 253, .18);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .85rem .5rem;
    font-weight: 700;
}
.contact-folder-tabs .nav-link i {
    font-size: 1.35rem;
}
.contact-folder-tabs .nav-link.active .badge {
    color: #212529 !important;
}

/* Mensagens internas */
.message-body {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.55;
}


/* Atalhos e áreas separadas do painel do instrutor */
.professional-action-card,
.contact-folder-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.professional-action-card:hover,
.contact-folder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 1rem 2.5rem rgba(0,0,0,.12) !important;
}
.professional-action-icon,
.contact-folder-icon,
.contact-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13,110,253,.1);
    color: #0d6efd;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.contact-folder-card-active {
    outline: 3px solid rgba(13,110,253,.22);
    background: rgba(13,110,253,.035);
}
.contact-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.25rem;
}
.message-body {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Experiência enxuta de acesso e novos módulos do portal */
.access-home {
    min-height: calc(100vh - 190px);
    display: flex;
    align-items: center;
    padding: 3rem 0;
    background:
        radial-gradient(circle at 12% 10%, rgba(241,196,15,.18), transparent 32%),
        radial-gradient(circle at 90% 82%, rgba(0,141,52,.12), transparent 30%),
        #f8fafc;
}
.access-home-logo {
    max-width: 150px;
    max-height: 100px;
    object-fit: contain;
}
.access-login-card,
.access-role-card {
    border: 1px solid rgba(15,23,42,.06);
}
.access-role-card {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.access-role-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0,141,52,.22);
    box-shadow: 0 20px 45px rgba(15,23,42,.12) !important;
}
.access-role-icon,
.action-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.55rem;
    color: var(--cfc-green);
    background: rgba(0,141,52,.10);
}

.dashboard-action-card {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border: 1px solid rgba(15,23,42,.07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-action-card:hover {
    color: inherit;
    transform: translateY(-3px);
    border-color: rgba(0,141,52,.25);
    box-shadow: 0 18px 38px rgba(15,23,42,.12) !important;
}

.profile-avatar,
.profile-placeholder {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 5px 16px rgba(15,23,42,.15);
}
.profile-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f6;
    color: #64748b;
    font-size: 1.55rem;
}

.month-selector {
    display: flex;
    gap: .65rem;
    overflow-x: auto;
    padding: .25rem .1rem .75rem;
    scrollbar-width: thin;
}
.month-selector .btn { flex: 0 0 auto; }
.lesson-month-card {
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.lesson-month-card:hover {
    border-color: rgba(0,141,52,.28) !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
}
.lesson-completed {
    border-left: 5px solid var(--cfc-green) !important;
    background: rgba(0,141,52,.025);
}

.message-timeline,
.group-chat {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.internal-message {
    max-width: min(84%, 720px);
}
.internal-message.mine { align-self: flex-end; }
.internal-message.received { align-self: flex-start; }
.message-bubble {
    padding: .85rem 1rem;
    border-radius: 18px;
    background: #f1f5f9;
    color: #172033;
    overflow-wrap: anywhere;
    line-height: 1.55;
    box-shadow: 0 5px 14px rgba(15,23,42,.06);
}
.internal-message.mine .message-bubble {
    background: rgba(0,141,52,.11);
    border-bottom-right-radius: 5px;
}
.internal-message.received .message-bubble {
    border-bottom-left-radius: 5px;
}

.group-cover-wrap {
    min-height: 190px;
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(0,141,52,.12), rgba(241,196,15,.22));
}
.group-cover {
    width: 100%;
    height: 230px;
    object-fit: cover;
}
.group-cover-placeholder {
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--cfc-green);
}
.group-admin-image {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    object-fit: cover;
    background: #f1f5f9;
}
.video-cover,
.bank-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 18px;
    background: #eef2f6;
}
.bank-image { height: 130px; }

.student-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .65rem;
    max-height: 340px;
    overflow-y: auto;
    padding: .25rem;
}
.student-check {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .75rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}
.student-check:hover { border-color: rgba(0,141,52,.35); }

@media (max-width: 767.98px) {
    .access-home {
        min-height: auto;
        padding: 1.5rem 0 2.5rem;
        align-items: flex-start;
    }
    .access-login-card .card-body { padding: 1.5rem !important; }
    .internal-message { max-width: 94%; }
    .profile-avatar,
    .profile-placeholder {
        width: 50px;
        height: 50px;
        min-width: 50px;
    }
    .group-cover { height: 180px; }
}
.dashboard-action-card {
    padding: 1.25rem;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15,23,42,.07);
}
.dashboard-action-card .action-icon { margin-bottom: 1rem; }
.dashboard-action-card strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: .3rem;
}
.dashboard-action-card small {
    display: block;
    color: var(--cfc-muted);
    line-height: 1.4;
}
.access-role-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 132px;
    padding: 1.25rem;
    border-radius: 24px;
    background: #fff;
    color: var(--cfc-dark);
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(15,23,42,.08);
}
.access-role-card > div { flex: 1; min-width: 0; }
.access-role-card strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: .25rem;
}
.access-role-card small {
    display: block;
    color: var(--cfc-muted);
    line-height: 1.45;
}
.access-role-card > .bi-chevron-right { color: var(--cfc-green); font-size: 1.25rem; }

/* Conversas e contatos internos */
.conversation-folder-card {
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.conversation-folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(25, 44, 78, .10);
    border-color: rgba(13, 110, 253, .35) !important;
}
.direct-conversation-timeline {
    max-height: 62vh;
    overflow-y: auto;
    padding-right: .35rem;
}


.message-action-hint {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding: .7rem .9rem;
    border: 1px dashed rgba(15, 23, 42, .18);
    border-radius: 14px;
    color: #64748b;
    background: #f8fafc;
    font-size: .88rem;
}
.message-actions-enabled .message-bubble {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .16s ease, box-shadow .16s ease;
}
.message-actions-enabled .message-bubble:active,
.message-actions-enabled .internal-message.actions-open .message-bubble {
    transform: scale(.985);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .14), 0 7px 18px rgba(15,23,42,.10);
}
.message-actions-enabled .message-actions {
    display: none !important;
}
.message-actions-enabled .internal-message.actions-open .message-actions {
    display: flex !important;
    animation: messageActionsIn .16s ease both;
}
@keyframes messageActionsIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}


/* CFCV12: cards de acesso centralizados sem alterar os demais componentes */
.dashboard-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 230px;
}
.dashboard-action-card .action-icon { margin-left: auto; margin-right: auto; }
.dashboard-action-card strong, .dashboard-action-card small { width: 100%; text-align: center; }
@media (max-width: 767.98px) { .dashboard-action-card { min-height: 210px; } }

/* Arquivos enviados nos grupos teóricos */
.group-message-image{display:block;max-width:min(100%,420px);max-height:420px;object-fit:contain;border-radius:1rem;background:#fff;border:1px solid rgba(0,0,0,.08)}

/* CFCV14: visualização ampliada e envio inteligente de imagens */
.cfc-image-previewable { cursor: zoom-in; }
.cfc-image-previewable:focus { outline: 3px solid rgba(13,110,253,.28); outline-offset: 3px; }
.cfc-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,.88);
    backdrop-filter: blur(4px);
}
.cfc-image-viewer.is-open { display: flex; }
.cfc-image-viewer-stage { max-width: 96vw; max-height: 94vh; text-align: center; }
.cfc-image-viewer-stage img {
    display: block;
    max-width: 96vw;
    max-height: 86vh;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 22px 70px rgba(0,0,0,.45);
    background: #fff;
}
.cfc-image-viewer-caption { color: #fff; margin-top: .75rem; font-weight: 700; }
.cfc-image-viewer-close {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 1.35rem;
    box-shadow: 0 8px 28px rgba(0,0,0,.3);
}
body.cfc-image-viewer-open { overflow: hidden; }
.professional-profile-photo {
    width: 92px;
    height: 92px;
    min-width: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 10px 30px rgba(15,23,42,.18);
}
.admin-stat-link { display:block; height:100%; color:inherit; text-decoration:none; }
.admin-stat-link .card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.admin-stat-link:hover { color:inherit; }
.admin-stat-link:hover .card { transform:translateY(-3px); box-shadow:0 18px 38px rgba(15,23,42,.12)!important; border-color:rgba(13,110,253,.20)!important; }
@media (max-width: 767.98px) {
    .professional-profile-photo { width:76px; height:76px; min-width:76px; }
}

/* CFCV16: imagens de mensagens abrem dentro do painel, sem navegar para o arquivo */
.group-image-preview-button {
    display: block;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 1rem;
    background: transparent;
    cursor: zoom-in;
    text-align: left;
}
.group-image-preview-button:focus-visible {
    outline: 3px solid rgba(13,110,253,.32);
    outline-offset: 3px;
}

/* CFCV16: comprovantes digitais */
.receipt-preview-shell {
    width: min(100%, 760px);
    padding: clamp(.5rem, 2vw, 1rem);
    border-radius: 28px;
    background: #dcecff;
    box-shadow: 0 24px 70px rgba(15,23,42,.16);
}
.receipt-preview-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px;
    background: #fff;
}
.payment-receipt-mini {
    padding: .75rem;
    border: 1px solid rgba(13,110,253,.16);
    border-radius: 18px;
    background: rgba(13,110,253,.035);
}
.payment-receipt-mini img {
    display: block;
    width: 100%;
    max-height: 330px;
    object-fit: contain;
    border-radius: 14px;
    background: #eaf3ff;
}
.payment-charge-paid { border: 1px solid rgba(25,135,84,.22) !important; }

/* Botão flutuante de modo claro/escuro */
.floating-theme-toggle {
    position: fixed;
    left: max(14px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 1100;
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    background: #172033;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 14px 34px rgba(15,23,42,.28);
    transition: transform .18s ease, background .18s ease;
}
.floating-theme-toggle:hover { transform: translateY(-2px); }

/* Modo escuro persistente */
html[data-cfc-theme="dark"] {
    --cfc-dark: #f4f7fb;
    --cfc-muted: #aeb9c9;
    --cfc-border: #2b3a4f;
    --cfc-soft: #172033;
    color-scheme: dark;
}
html[data-cfc-theme="dark"] body {
    background: #09111f;
    color: #f4f7fb;
}
html[data-cfc-theme="dark"] .main-navbar,
html[data-cfc-theme="dark"] .main-navbar.bg-white,
html[data-cfc-theme="dark"] footer,
html[data-cfc-theme="dark"] .bg-white,
html[data-cfc-theme="dark"] .card,
html[data-cfc-theme="dark"] .dashboard-action-card,
html[data-cfc-theme="dark"] .access-role-card,
html[data-cfc-theme="dark"] .conversation-folder-card,
html[data-cfc-theme="dark"] .lesson-month-card,
html[data-cfc-theme="dark"] .student-check {
    background: #111c2d !important;
    color: #f4f7fb !important;
    border-color: #2a3a50 !important;
}
html[data-cfc-theme="dark"] .main-navbar { box-shadow: 0 1px 0 rgba(255,255,255,.08); }
html[data-cfc-theme="dark"] .main-navbar .nav-link,
html[data-cfc-theme="dark"] a:not(.btn):not(.floating-whatsapp) { color: #7dd3fc; }
html[data-cfc-theme="dark"] .text-cfc-dark,
html[data-cfc-theme="dark"] .text-dark { color: #f4f7fb !important; }
html[data-cfc-theme="dark"] .text-muted,
html[data-cfc-theme="dark"] .form-text,
html[data-cfc-theme="dark"] small { color: #aeb9c9 !important; }
html[data-cfc-theme="dark"] .border,
html[data-cfc-theme="dark"] .border-top,
html[data-cfc-theme="dark"] .border-bottom,
html[data-cfc-theme="dark"] hr { border-color: #2a3a50 !important; }
html[data-cfc-theme="dark"] .form-control,
html[data-cfc-theme="dark"] .form-select,
html[data-cfc-theme="dark"] textarea,
html[data-cfc-theme="dark"] input {
    background-color: #0b1524;
    color: #f4f7fb;
    border-color: #34465f;
}
html[data-cfc-theme="dark"] .form-control::placeholder,
html[data-cfc-theme="dark"] textarea::placeholder { color: #7f8da2; }
html[data-cfc-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-color: #eef4fb; --bs-table-border-color: #2a3a50; }
html[data-cfc-theme="dark"] .alert-light,
html[data-cfc-theme="dark"] .message-action-hint,
html[data-cfc-theme="dark"] .message-bubble,
html[data-cfc-theme="dark"] .payment-receipt-mini {
    background: #162338 !important;
    color: #f4f7fb !important;
    border-color: #30435d !important;
}
html[data-cfc-theme="dark"] .internal-message.mine .message-bubble { background: rgba(16,185,129,.18) !important; }
html[data-cfc-theme="dark"] .receipt-preview-shell { background: #101c2d; }
html[data-cfc-theme="dark"] .floating-theme-toggle { background: #f8c91c; color: #111827; }
html[data-cfc-theme="dark"] .sticky-bottom.bg-white { background: #111c2d !important; }
html[data-cfc-theme="dark"] .navbar-toggler { background: #f8fafc; }

@media (max-width: 767.98px) {
    .receipt-page .btn { flex: 1 1 auto; }
    .floating-theme-toggle { width: 50px; height: 50px; }
}
html[data-cfc-theme="dark"] .institutional-hero::after { background: #09111f; }
html[data-cfc-theme="dark"] .access-home,
html[data-cfc-theme="dark"] .clean-site-header { background-color: #09111f !important; }
html[data-cfc-theme="dark"] .bg-light,
html[data-cfc-theme="dark"] .text-bg-light {
    background-color: #1a2940 !important;
    color: #eef4fb !important;
}
html[data-cfc-theme="dark"] .modal-content,
html[data-cfc-theme="dark"] .dropdown-menu,
html[data-cfc-theme="dark"] .list-group-item {
    background-color: #111c2d;
    color: #eef4fb;
    border-color: #2a3a50;
}


/* CFCV17: comprovante enviado pelo aluno e posição do instalador */
.pwa-install-button.has-whatsapp { bottom: 92px; }
.payment-proof-box {
    border: 1px dashed rgba(13, 110, 253, .38);
    background: rgba(13, 110, 253, .055);
    border-radius: 1rem;
    padding: 1rem;
}
.payment-proof-file {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}
.payment-proof-file i { font-size: 1.6rem; color: var(--bs-primary); }
.payment-proof-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-proof-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    width: 100%;
}
.payment-proof-thumb {
    width: 74px;
    height: 74px;
    border-radius: .8rem;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,.10);
}
html[data-cfc-theme="dark"] .payment-proof-box {
    background: rgba(65, 142, 255, .10);
    border-color: rgba(108, 167, 255, .38);
}
@media (max-width: 767px) {
    .pwa-install-button.has-whatsapp { bottom: 88px; }
}


/* CFCV18: conversas com rolagem interna no estilo de aplicativos de mensagens */
.chat-scroll-panel {
    width: 100%;
    min-height: 250px;
    max-height: min(62vh, 680px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    padding: .35rem .55rem .8rem .15rem;
    border-radius: 1rem;
}
.chat-scroll-panel:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .25);
    outline-offset: 3px;
}
.chat-scroll-panel::-webkit-scrollbar { width: 9px; }
.chat-scroll-panel::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, .13);
    border-radius: 999px;
}
.chat-scroll-panel::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .48);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}
.chat-scroll-panel::-webkit-scrollbar-thumb:hover { background-color: rgba(71, 85, 105, .68); }
html[data-cfc-theme="dark"] .chat-scroll-panel {
    scrollbar-color: rgba(148, 163, 184, .55) rgba(30, 41, 59, .38);
}
html[data-cfc-theme="dark"] .chat-scroll-panel::-webkit-scrollbar-track { background: rgba(30, 41, 59, .55); }
html[data-cfc-theme="dark"] .chat-scroll-panel::-webkit-scrollbar-thumb { background-color: rgba(148, 163, 184, .5); }
@media (max-width: 767.98px) {
    .chat-scroll-panel {
        min-height: 300px;
        max-height: 56vh;
        padding-right: .35rem;
    }
}

/* CFCV19: localização, avisos, permissões e mensagens de áudio */
.student-notice-board {
    padding: 1.25rem;
    border-radius: 1.35rem;
    background: linear-gradient(135deg, rgba(255,193,7,.13), rgba(13,110,253,.06));
    border: 1px solid rgba(231,183,8,.24);
}
.notice-board-icon {
    width: 46px; height: 46px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #ffc107; color: #111827; font-size: 1.25rem;
}
.location-action-card { cursor: default; }
.audio-recorder-controls { display: flex; flex-wrap: wrap; gap: .55rem; }
.audio-recorder-status { min-height: 1.3rem; }
.audio-message-wrap audio { display: block; width: min(100%, 360px); max-width: 100%; height: 44px; }
.audio-notification-pulse {
    animation: cfcAudioAlert 1.15s ease-in-out infinite;
    position: relative;
}
.audio-notification-pulse::after {
    content: '';
    position: absolute;
    top: .7rem; right: .7rem;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ff2d55;
    box-shadow: 0 0 0 0 rgba(255,45,85,.55);
    animation: cfcAudioDot 1.15s ease-out infinite;
}
@keyframes cfcAudioAlert {
    0%,100% { box-shadow: 0 10px 30px rgba(15,23,42,.08); }
    50% { box-shadow: 0 0 0 5px rgba(255,45,85,.20), 0 14px 34px rgba(255,45,85,.22); }
}
@keyframes cfcAudioDot {
    0% { transform: scale(.85); box-shadow: 0 0 0 0 rgba(255,45,85,.55); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255,45,85,0); }
    100% { transform: scale(.85); box-shadow: 0 0 0 0 rgba(255,45,85,0); }
}
html[data-cfc-theme="dark"] .student-notice-board {
    background: linear-gradient(135deg, rgba(255,193,7,.10), rgba(59,130,246,.10));
    border-color: rgba(255,193,7,.22);
}
html[data-cfc-theme="dark"] .audio-message-wrap audio { filter: invert(.88) hue-rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
    .audio-notification-pulse, .audio-notification-pulse::after { animation: none; }
}
@media (max-width: 575.98px) {
    .audio-recorder-controls .btn { flex: 1 1 auto; }
}


/* CFCV21: alerta de aula atrasada para confirmação */
@keyframes lessonConfirmationPulse{0%,100%{box-shadow:0 10px 30px rgba(15,75,150,.10);transform:translateY(0)}50%{box-shadow:0 0 0 6px rgba(220,53,69,.22),0 12px 34px rgba(220,53,69,.28);transform:translateY(-2px)}}
.lesson-confirmation-pulse{animation:lessonConfirmationPulse 1.15s ease-in-out infinite;border:2px solid rgba(220,53,69,.55)!important}
@media (prefers-reduced-motion:reduce){.lesson-confirmation-pulse{animation:none}}
