/* ---------------------------------------------------------
   Portal login - ajustes sobre o template (painel inclinado)
   Cores: destaque #addc52 | escuro #0e172a
--------------------------------------------------------- */

/* Loader animado */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: #0e172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity .5s ease, visibility .5s ease;
}
.page-loader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-logo {
    width: 140px;
    margin-bottom: 26px;
    animation: loaderPulse 1.4s ease-in-out infinite;
}
.loader-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(255, 255, 255, .18);
    border-top-color: #addc52;
    border-right-color: #addc52;
    border-radius: 50%;
    animation: loaderSpin .8s linear infinite;
}
@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}
@keyframes loaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: .8; }
}

/* Passos do login */
.login-step {
    animation: stepFade .45s ease both;
}
@keyframes stepFade {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* Reduz o espaçamento gigante do template no topo e mantém a
   centralização vertical mesmo em mobile (anula o display:block
   do media query do template) */
.form-holder .form-content {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    padding: 40px 50px 50px;
}

/* Telemóveis: margens mais curtas e títulos mais pequenos */
@media (max-width: 480px) {
    .form-holder .form-content {
        padding: 40px 22px 40px;
    }
    .login-step h3 {
        font-size: 22px;
    }
}

/* Logotipo/redes alinhados com o bloco (anula o -40/100 do template) */
.form-content .logo-social {
    margin-top: 0;
    margin-bottom: 30px;
    margin-left: 0;
    margin-right: 0;
}

/* Títulos e texto: tamanhos consistentes */
.login-step h3 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}
.login-step p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Formulário a largura toda, sem as margens negativas do template */
.login-step form {
    display: block;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
}

/* Grupos de campo: largura total + altura fixa + ícone centrado */
.login-step .form-group {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}
.login-step .form-group .form-control {
    height: 52px;
    padding: 0 44px;
    font-size: 15px;
    line-height: 52px;
    margin-bottom: 0;
    border-radius: 8px;
}
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #0e172a;
    font-size: 15px;
    opacity: .55;
    pointer-events: none;
}

/* Olho para mostrar/ocultar a palavra-passe */
.eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: #0e172a;
    font-size: 15px;
    opacity: .55;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
}
/* Garante que os ícones de olho usem a fonte Font Awesome correta */
.eye-btn i,
.eye-btn .fa,
.eye-btn .far,
.eye-btn .fas {
    font-family: "Font Awesome 5 Free";
    font-style: normal;
}
.eye-btn:hover {
    opacity: 1;
    color: #8fbf3a;
}

/* Botão a largura toda, com ícone centrado */
.login-step .form-button {
    width: 100%;
    margin-top: 6px;
    margin-bottom: 0;
}
.login-step .form-button .ibtn {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    margin-right: 0;
}
.login-step .form-button .ibtn i {
    margin-left: 0;
}

/* Caixa do utilizador (passo da senha) — foto centrada, nome por baixo */
.user-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 20px;
    text-align: center;
}
.user-photo {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #addc52;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
    flex-shrink: 0;
}
.user-avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    flex-shrink: 0;
}
.user-avatar-icon {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    border: 3px solid #addc52;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 40px;
}
.user-avatar-icon i { line-height: 1; }
.user-box h4 {
    color: #fff;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

/* Ligações do passo (voltar / esquecer senha) */
.step-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}
.step-actions a {
    color: #A8A8B7;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.step-actions a:hover {
    color: #addc52;
    text-decoration: none;
}

/* Validação — mensagens de erro */
.validation-error {
    display: block;
    color: #ff8a8a;
    font-size: 13px;
    line-height: 1.4;
    margin: -6px 0 14px;
    padding-left: 16px;
    min-height: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .25s ease, opacity .25s ease, margin .25s ease;
}
.validation-error.visible {
    max-height: 48px;
    opacity: 1;
    margin-bottom: 14px;
}
.login-step .form-group .form-control.has-error {
    border-color: #ff8a8a;
    box-shadow: 0 0 0 3px rgba(255, 138, 138, .18);
}
.form-group.has-error {
    margin-bottom: 16px;
}

/* ---------------------------------------------------------
   Recuperação de palavra-passe
--------------------------------------------------------- */

/* Ícone de recuperação / sucesso */
.forgot-icon-wrap,
.success-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    margin: 0 auto 20px;
    font-size: 30px;
}
.forgot-icon-wrap {
    background: rgba(173, 220, 82, .15);
    color: #addc52;
    animation: iconBounce .6s ease both;
}
.success-icon-wrap {
    background: rgba(173, 220, 82, .15);
    color: #addc52;
    animation: iconBounce .6s ease both;
}
@keyframes iconBounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Botão "Voltar ao Login" como link-estilo dentro do form-button */
.ibtn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .25);
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}
.ibtn-back:hover {
    border-color: #addc52;
    background: rgba(173, 220, 82, .08);
    color: #fff;
    text-decoration: none;
}

/* Fade-in para o estado de sucesso */
#forgot-success {
    animation: stepFade .45s ease both;
}