/* Variáveis CSS Globais - Paleta FUMPI Acessível e Idosos-Friendly */
:root {
    --primary: #009639;         /* Verde FUMPI */
    --primary-dark: #00752c;    /* Verde Escuro */
    --accent: #ffd100;          /* Amarelo FUMPI */
    --accent-dark: #e6bd00;     /* Amarelo Escuro */
    --secondary: #334155;       /* Azul acinzentado de alta legibilidade */
    --background: #f1f5f9;      /* Fundo claro relaxante */
    --surface: #ffffff;
    --text-main: #0f172a;       /* Contraste extremo para leitura fácil */
    --text-muted: #334155;      /* Contraste seguro para idosos */
    --border: #94a3b8;          /* Bordas fortes e nítidas */
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 14px;             /* Cantos suaves e modernos */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =======================================
   HEADER
======================================= */
.main-header {
    background-color: var(--surface);
    border-bottom: 5px solid var(--primary); /* Linha divisória verde */
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.header-logo {
    max-height: 80px;
    width: auto;
}

.header-titles h1 {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 800;
    line-height: 1.2;
}

.header-titles p {
    font-size: 1rem;
    color: var(--secondary);
    font-weight: 600;
    margin-top: 0.15rem;
}

.header-right-wrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-counter-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    user-select: none;
}

.counter-number-group {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--primary, #009639);
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: -0.02em;
}

.counter-plus {
    color: var(--primary, #009639);
}

.counter-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
    margin-top: 2px;
}

.btn-logout-portal {
    background-color: #f1f5f9;
    color: var(--danger);
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.btn-logout-portal:hover {
    background-color: #fee2e2;
    border-color: var(--danger);
}

/* =======================================
   CONTAINERS & GRIDS
======================================= */
.portal-container {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.welcome-box {
    background-color: #e6f4ea; /* Fundo verde clarinho agradável */
    border-left: 6px solid var(--primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2.5rem;
}

.welcome-box h2 {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.welcome-box p {
    font-size: 1.15rem;
    color: #137333;
    font-weight: 600;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
}

@media (max-width: 600px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    .header-user-logout {
        position: static;
        margin-top: 1rem;
        width: 100%;
    }
    .btn-logout-portal {
        display: block;
        text-align: center;
    }
}

/* =======================================
   CARDS & FORMS
======================================= */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 3px solid var(--border); /* Borda reforçada */
    box-shadow: var(--shadow-md);
    overflow: visible;
}

.card-header {
    background-color: #f8fafc;
    padding: 1.5rem;
    border-bottom: 5px solid var(--border);
    border-top-left-radius: calc(var(--radius) - 5px);
    border-top-right-radius: calc(var(--radius) - 5px);
}

.card-header h2 {
    font-size: 1.35rem;
    color: var(--text-main);
    font-weight: 800;
}

.card-body {
    padding: 2rem;
}

.card-instruction {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 1.15rem; /* Fonte maior para melhor visualização */
    font-weight: 700;
    color: var(--text-main);
}

.form-group input, .select-large {
    width: 100%;
    padding: 0.95rem 1.2rem;
    border: 3px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.2rem; /* Fonte grande confortável para digitação */
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
    background-color: var(--surface);
}

.form-group input:focus, .select-large:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(0, 150, 57, 0.2);
}

.input-tip {
    display: block;
    font-size: 0.95rem;
    color: #475569;
    margin-top: 0.4rem;
    font-weight: 600;
}

/* =======================================
   BUTTONS
======================================= */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1.1rem 2rem;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.25rem; /* Botões grandes e fáceis de clicar */
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none !important;
}

.btn-primary {
    background-color: var(--primary);
    color: white !important;
    box-shadow: 0 6px 12px rgba(0, 150, 57, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 150, 57, 0.4);
}

.btn-accent {
    background-color: var(--accent);
    color: #000 !important;
    box-shadow: 0 6px 12px rgba(255, 209, 0, 0.3);
}

.btn-accent:hover {
    background-color: var(--accent-dark);
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 209, 0, 0.4);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    background-color: #cbd5e1;
    color: #94a3b8;
    border: 3px solid #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* =======================================
   ALERTS
======================================= */
.alert {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    font-size: 1.15rem;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 3px solid var(--danger);
    font-weight: 700;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 3px solid var(--success);
    font-weight: 700;
}

.matricula-highlight {
    font-size: 1.8rem;
    color: var(--primary-dark);
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px dashed var(--primary);
    display: inline-block;
    margin-top: 0.5rem;
}

.card-links {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-links a {
    color: #1d4ed8;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: underline;
}

.card-links a.link-highlight {
    color: var(--primary-dark);
}

/* =======================================
   PASSWORD REQUIREMENTS STYLING
======================================= */
.password-requirements {
    background-color: #f8fafc;
    border: 2px solid var(--border);
    padding: 1.2rem;
    border-radius: 8px;
    margin-top: 0.8rem;
}

.req-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.password-requirements ul {
    list-style: none;
    padding-left: 0;
}

.password-requirements li {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    padding-left: 1.5rem;
    position: relative;
}

.password-requirements li::before {
    position: absolute;
    left: 0;
    font-weight: 800;
}

.password-requirements li.invalid {
    color: #991b1b;
}

.password-requirements li.invalid::before {
    content: "✗";
    color: var(--danger);
}

.password-requirements li.valid {
    color: var(--success);
}

.password-requirements li.valid::before {
    content: "✓";
    color: var(--success);
}

/* =======================================
   BENEFICIÁRIO Restrito: PAINEL
======================================= */
.user-highlight-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2.2rem;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
}

.user-meta-badge {
    text-align: right;
}

.user-meta-info .meta-label, .user-meta-badge .meta-label {
    display: block;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #bbf7d0;
    font-weight: 700;
}

.user-meta-info h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.matricula-badge {
    display: inline-block;
    background-color: var(--accent);
    color: #000;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 0.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.nome-destaque {
    color: var(--primary-dark);
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.no-records {
    text-align: center;
    padding: 3rem 1.5rem;
}

.no-records .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.no-records p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.no-records .sub-text {
    font-size: 1.05rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* =======================================
   FOOTER
======================================= */
.main-footer {
    background-color: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 2.5rem 1rem;
    margin-top: 4rem;
    border-top: 5px solid var(--accent);
}

.main-footer p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Wrapper e Toggle do Ícone de Senha */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 3.5rem !important; /* Maior espaçamento devido aos inputs grandes para idosos */
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 28px; /* Ícone ligeiramente maior e mais acessível */
    height: 28px;
    opacity: 0.6;
    transition: opacity 0.2s;
    user-select: none;
    z-index: 10;
}

.toggle-password:hover {
    opacity: 1;
}

/* Banner DIRF */
.dirf-container {
    margin-top: 1.5rem;
    width: 100%;
}

.dirf-box {
    background-color: var(--surface);
    border: 3px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.dirf-box span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.text-center {
    text-align: center;
}

.btn-dirf {
    padding: 0.65rem 1.6rem !important;
    font-size: 1.1rem !important;
    white-space: nowrap;
    border: none !important;
    box-shadow: 0 4px 6px rgba(0, 150, 57, 0.2) !important;
}

@media (max-width: 650px) {
    .dirf-box {
        flex-direction: column;
        text-align: center;
        gap: 1.2rem;
        padding: 1.5rem;
    }
}

/* =======================================
   DATEPICKER DE MÊS/ANO (MONTHPICKER)
======================================= */
.datepicker-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.datepicker-input-wrapper input {
    padding-right: 48px;
}

.datepicker-icon {
    position: absolute;
    right: 14px;
    cursor: pointer;
    font-size: 1.3rem;
    user-select: none;
    line-height: 1;
    transition: transform 0.2s ease;
}

.datepicker-icon:hover {
    transform: scale(1.15);
}

.monthpicker-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 99999;
    background: #ffffff;
    border: 2px solid var(--primary, #009639);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    padding: 16px;
    width: 290px;
    font-family: inherit;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.monthpicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.monthpicker-year-display {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary, #009639);
}

.monthpicker-nav {
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.monthpicker-nav:hover:not(:disabled) {
    background: var(--primary, #009639);
    color: #ffffff;
    border-color: var(--primary, #009639);
}

.monthpicker-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.monthpicker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.monthpicker-month {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 6px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.monthpicker-month:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: var(--primary, #009639);
}

.monthpicker-month.selected {
    background: var(--primary, #009639);
    color: #ffffff;
    border-color: var(--primary, #009639);
    box-shadow: 0 4px 8px rgba(0, 150, 57, 0.3);
}



