:root {
    --primary-red: #c71a17;
    --primary-red-hover: #a11412;
    --dark-text: #222222;
    --light-text: #666666;
    --border-color: #dddddd;
    --bg-light: #ffffff;
    --bg-footer: #c71a17;
}

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

html {
    scroll-padding-top: 80px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--dark-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

/* Header */
.header {
    height: 80px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.header-transparent {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.header.header-transparent .header-nav-main a,
.header.header-transparent .header-actions a,
.header.header-transparent .header-actions i,
.header.header-transparent .mobile-menu-btn {
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}



.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 80px;
}

.main-content.no-padding-top {
    padding-top: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo img {
    max-height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-weight: 600;
}

.header-nav a {
    color: var(--primary-red);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.header-nav a:hover {
    color: var(--primary-red-hover);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--dark-text);
    font-size: 1.2rem;
}

.header-icons a:hover {
    color: var(--primary-red);
}

/* Container */
.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-title {
    color: var(--primary-red);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-subtitle {
    color: var(--light-text);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.page-subtitle a {
    color: var(--primary-red);
}

/* Auth Layout */
.auth-layout {
    display: flex;
    gap: 4rem;
    align-items: stretch;
    margin-top: 1rem;
}

/* Cartao da esquerda: sociais, divisor "Ou", formulario e o link do rodape.
   A margem negativa e o oposto do padding: joga a borda para fora para que
   os botoes e inputs alinhem com o titulo da pagina, e nao com o card. */
.auth-card {
    flex: 0 0 480px;
    max-width: 100%;
    margin-left: -1.5rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-rodape {
    text-align: center;
    font-size: 0.95rem;
    color: var(--light-text);
}

.auth-rodape a {
    color: var(--primary-red);
    font-weight: 600;
}

/* Texto que abre o cartao, onde o formulario sozinho nao diz o que vai acontecer. */
.auth-intro {
    margin: 0;
    font-size: 0.95rem;
    color: var(--light-text);
}

/* O cartao ja separa os filhos pelo gap: a margem do alerta somaria a ele. */
.auth-card .alert {
    margin-bottom: 0;
}

/* Coluna da direita. Sem imagem cadastrada, sobra o fundo cinza.
   Na tela de entrar ela estica junto com o card, batendo exatamente com a
   altura dele. A imagem e absoluta de proposito: em fluxo, a altura natural
   dela entraria na conta do flex e poderia esticar o card. */
.auth-ilustracao {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e9ecef;
}

.auth-ilustracao img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cadastrar: o formulario e mais alto, entao a ilustracao para de acompanhar
   o card e fica com a mesma altura da tela de entrar. Se as duas nao baterem
   na tela, e este o unico numero a ajustar. */
.auth-layout--imagem-fixa .auth-ilustracao {
    align-self: flex-start;
    height: 528px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #444;
}

.form-group input:not([type="checkbox"]) {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus {
    border-color: var(--primary-red);
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    width: 100%;
}

.password-input i {
    position: absolute;
    right: 1rem;
    color: #aaa;
    cursor: pointer;
}

.password-strength {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}
.password-strength div {
    height: 4px;
    flex: 1;
    background: var(--border-color);
    border-radius: 2px;
}

/* Regra da senha, embaixo do medidor, e o aviso de conferencia do campo de confirmacao. */
.password-dica {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--light-text, #868e96);
}

.form-erro {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #c92a2a;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.form-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    color: var(--dark-text);
}

.form-options a {
    color: var(--primary-red);
}

.btn-primary {
    background-color: var(--primary-red);
    color: #fff;
    border: none;
    padding: 0.7rem 1rem;
    font-size: 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider span {
    color: var(--light-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-social {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-size: 0.9rem;
    transition: 0.2s;
    width: 100%;
}

.btn-social .social-icon {
    position: absolute;
    left: 1.2rem;
    font-size: 1.5rem; /* for fa */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-facebook {
    background-color: #1877F2;
    color: #fff;
}
.btn-facebook:hover { background-color: #166fe5; }

.btn-google {
    background-color: #f5f5f5;
    color: #000;
}
.btn-google:hover { background-color: #e8e8e8; }

.btn-social img {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    background-color: var(--bg-footer);
    color: #fff;
    padding: 4rem 5% 2rem;
    margin-top: auto;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-column h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.8rem;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.9);
}

.footer-column ul li a:hover {
    text-decoration: underline;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
    font-size: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

/* Perfil & Minha Conta */
.perfil-container {
    display: flex;
    max-width: 900px;
    margin: 0 auto;
    align-items: flex-start;
    gap: 4rem;
}

.perfil-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.perfil-header-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}

.avatar-placeholder {
    width: 180px;
    height: 180px;
    background-color: #e0e0e0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 5.8rem;
    position: relative;
}

.avatar-edit {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #fff;
    color: var(--dark-text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.perfil-info h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.perfil-info h2 i {
    color: #1877F2;
    font-size: 1rem;
}

.perfil-info p {
    color: var(--light-text);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.perfil-stats {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.perfil-menu {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
}

.perfil-menu a {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0;
    color: var(--dark-text);
    font-size: 1rem;
}

.perfil-menu a:hover {
    color: var(--primary-red);
}

.perfil-menu a i {
    width: 24px;
    color: var(--light-text);
    text-align: center;
}

.btn-sair-perfil {
    background: none;
    border: none;
    padding: 0.2rem 0;
    font: inherit;
    color: var(--dark-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
    font-size: 1rem;
}

.btn-sair-perfil i {
    width: 24px;
    text-align: center;
    color: var(--light-text);
}

.minha-conta-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.minha-conta-form .form-group-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.minha-conta-form .form-group-row label {
    font-weight: normal;
    color: var(--dark-text);
}

.minha-conta-form .form-group-row input {
    border: none;
    text-align: right;
    background: transparent;
    color: var(--dark-text);
    font-size: 1rem;
    outline: none;
    width: 60%;
}

.delete-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.btn-outline-danger {
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    background: transparent;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.btn-outline-danger:hover {
    background: var(--primary-red);
    color: #fff;
}

/* Confirmação de identidade antes de excluir a conta (M5). */
.excluir-confirmacao {
    padding: 1.25rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.excluir-confirmacao label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark, #232c45);
}

.excluir-confirmacao input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
}

.excluir-aviso {
    margin: 0.75rem 0 1rem;
    font-size: 0.85rem;
    color: var(--primary-red, #c92a2a);
}

.excluir-acoes {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-outline {
    border: 1px solid var(--border-color);
    color: var(--light-text, #6c757d);
    background: transparent;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: 0.2s;
}

.btn-outline:hover {
    background: #f1f3f5;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Utilities */
.show-on-mobile {
    display: none !important;
}

/* Responsividade Base */
@media (max-width: 992px) {
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-menu-btn {
        display: block !important;
        margin-left: 1rem;
        color: var(--dark-text);
    }

    .hide-on-mobile {
        display: none !important;
    }

    .show-on-mobile {
        display: block !important;
    }

    .header-nav-main {
        display: none !important;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        gap: 0 !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 0;
    }

    .header-nav-main.active {
        display: flex !important;
    }

    .header-nav-main a {
        padding: 1rem 2rem;
        border-bottom: 1px solid #eee;
    }
}

/* Flatpickr Fix para campos readonly */
input[readonly].flatpickr-date,
input[readonly].flatpickr-date-future,
.flatpickr-input[readonly],
.flatpickr-input ~ input[readonly] {
    opacity: 1 !important;
    color: var(--dark-text) !important;
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1.5rem;
    }
    .container {
        padding: 2rem 1.5rem;
    }
    .footer {
        padding: 3rem 1.5rem 2rem;
    }
    .footer-top {
        grid-template-columns: 1fr;
    }
    .auth-layout {
        flex-direction: column;
        gap: 2rem;
    }
    .auth-card {
        flex: none;
        width: 100%;
        margin-left: 0;
    }
    .auth-ilustracao,
    .auth-layout--imagem-fixa .auth-ilustracao {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 5 / 3;
    }
    .perfil-container {
        flex-direction: column;
        align-items: center;
    }
    .perfil-header-row {
        flex-direction: column;
        text-align: center;
        align-items: center;
        width: 100% !important;
    }
    .perfil-body, .perfil-menu {
        align-items: center;
        width: 100%;
    }
    .perfil-info {
        text-align: center;
    }
    .perfil-info h2 {
        justify-content: center;
    }
    .perfil-menu a, .btn-sair-perfil {
        justify-content: center;
    }
    .minha-conta-form {
        width: 100%;
    }
    .minha-conta-form .form-group-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .minha-conta-form .form-group-row input {
        width: 100%;
        text-align: left;
    }
}

/* Correções do Dropdown de Notificações */
#notification-dropdown,
#notification-dropdown * {
    text-shadow: none !important;
}

@media (max-width: 576px) {
    #notification-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 10px !important;
        left: auto !important;
        width: 320px !important;
        max-width: calc(100vw - 20px) !important;
    }
}

.conteudo-summernote a {
    color: #337ab7;
}
