/* ==========================================================================
   ESTILOS BASE
   ========================================================================== */
body {
    background-color: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 15px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 25px;
}

.auth-logo img {
    width: 140px;
    height: auto;
}

.auth-card {
    background: #ffffff;
    padding: 35px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.auth-card h2 {
    color: #1e293b;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-card p {
    color: #64748b;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

/* ==========================================================================
   FORMULÁRIO E INPUTS
   ========================================================================== */
.input-group-custom {
    margin-bottom: 12px;
}

.input-group-custom label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.form-control-custom {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease-in-out;
    background: #f8fafc;
    font-size: 15px;
    color: #1e293b;
}

.form-control-custom:focus {
    border-color: #16a34a;
    background: white;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.08);
}

.senha-wrapper {
    position: relative;
}

.toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    z-index: 10;
}

/* ==========================================================================
   FOTO E PREVIEWS
   ========================================================================== */
.photo-upload-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
}

/* Miniatura no Card */
.small-preview {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #16a34a;
    flex-shrink: 0;
}

.small-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-header{
    background-color: #16a34a;
}

/* MODAL: Foto Redonda Centralizada */
#modalPreview .modal-body {
    background-color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px !important;
}

.modal-avatar-wrapper {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid #16a34a;
    background-color: #ffffff;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

#imgFullPreview {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

#btnRemoverFoto {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: none;
}

#btnRemoverFoto i {
    font-size: 18px;
    color: #000;
    transition: 0.2s;
}

#btnRemoverFoto i:hover {
    color: red;
}

.btn-close {
  filter: invert(1);
  transition: transform 0.3s ease;
}

.btn-close:hover {
  transform: rotate(90deg);
}

#file-name {
    display: inline-block;
    max-width: 165px; /* ajusta conforme teu layout */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* ==========================================================================
   BOTÃO E SPINNER
   ========================================================================== */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.3s;
}

.btn-submit:hover {
    background: #15803d;
    transform: translateY(-2px);
}

/* Input */
#data_nascimento {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 14px;
    transition: 0.25s;
}

#data_nascimento:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
}

/* ================= CALENDÁRIO FLATPICKR (CORES + FIX DE ROLAGEM) ================= */

/* Container principal - Força flutuação absoluta */
.flatpickr-calendar {
    position: absolute !important;
    z-index: 99999 !important;
    border-radius: 14px;
    border: 1px solid #22c55e;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    background: #fff;
    /* Impede qualquer tentativa de ocupar espaço no fluxo do documento */
    display: none; 
}

.flatpickr-calendar.open {
    display: inline-block;
}

/* Cores dos dias da semana */
.flatpickr-weekday {
    color: #16a34a !important;
    font-weight: 600;
}

/* Dia atual (Today) e Hover Geral */
.flatpickr-day.today {
    border-color: #22c55e !important;
    color: #16a34a !important;
    font-weight: bold;
}

.flatpickr-day:hover, 
.flatpickr-day.prevMonthDay:hover, 
.flatpickr-day.nextMonthDay:hover, 
.flatpickr-day.today:hover {
    background: #22c55e !important;
    color: #fff !important;
    border-radius: 50%;
    border-color: #22c55e !important;
}

/* Setas de navegação (Anterior/Próximo) */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #22c55e !important;
    fill: #22c55e !important; /* Flatpickr usa SVG */
    font-weight: bold;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: #16a34a !important;
    background: transparent !important;
}

/* Dia Selecionado */
.flatpickr-day.selected, 
.flatpickr-day.selected:hover {
    background: #16a34a !important;
    color: #fff !important;
    border-color: #16a34a !important;
    border-radius: 50%;
}

/* Ajuste do Header do Calendário */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-weight: 600;
    color: #1e293b;
}

/* Remove qualquer conflito com animações que possam causar "pulos" de scroll */
.flatpickr-calendar.animate.open {
    animation: none !important;
}

#spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* mais escuro */
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px); /* efeito vidro top */
    z-index: 9999;
}

#spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top: 6px solid #16a34a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-footer { text-align: center; margin-top: 15px; font-size: 14px; }
.auth-footer a { color: #16a34a; text-decoration: none; font-weight: 600; }