/*
  auth.css
  Estilos da pagina de autenticacao (Login)
  Mobile-first – compativel com Bootstrap 4 + Shards Dashboard
  Paleta: GovBR (#1351b4)
*/

/* ============================================
   VARIAVEIS CSS
============================================ */
:root {
    --auth-primary:      #1351b4;
    --auth-primary-dark: #0f4085;
    --auth-success:      #168821;
    --auth-danger:       #dc3545;
    --auth-warning:      #ffc107;
    --auth-gray-100:     #f8f9fa;
    --auth-gray-200:     #e9ecef;
    --auth-gray-300:     #dee2e6;
    --auth-gray-500:     #adb5bd;
    --auth-gray-600:     #6c757d;
    --auth-gray-700:     #495057;
    --auth-gray-800:     #343a40;
    --auth-white:        #ffffff;
    --auth-radius:       0.375rem;
    --auth-radius-lg:    0.5rem;
    --auth-shadow-lg:    0 1rem 3rem rgba(0,0,0,0.175);
}

/* ============================================
   WRAPPER DA SECAO
============================================ */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 180px); /* desconta header + footer da masterpage */
    padding: 1.5rem 1rem;
}

/* ============================================
   CARD DE LOGIN
============================================ */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.login-card {
    background: var(--auth-white);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-lg);
    border: 1px solid var(--auth-gray-200);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-card-header {
    background: var(--auth-white);
    border-bottom: 1px solid var(--auth-gray-200);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
}

.login-card-header .logo img {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
}

.login-card-body {
    padding: 1.5rem 2rem 2rem;
}

/* ============================================
   CAMPOS DO FORMULARIO
============================================ */
.login-field-container {
    position: relative;
}

.login-field-container .form-control {
    padding-right: 4.5rem;
}

.login-type-indicator {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: var(--auth-gray-500);
    background: var(--auth-gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 2;
}

.login-type-indicator.email {
    color: #0c5460;
    background: #d1ecf1;
}

.login-type-indicator.username {
    color: var(--auth-primary);
    background: rgba(19, 81, 180, 0.1);
}

.password-field-container {
    position: relative;
}

.password-field-container .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--auth-gray-500);
    cursor: pointer;
    z-index: 3;
    padding: 0.25rem;
    border-radius: var(--auth-radius);
    transition: color 0.15s ease-in-out;
    line-height: 1;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--auth-primary);
    outline: 2px solid rgba(19, 81, 180, 0.3);
    outline-offset: 2px;
}

/* ============================================
   BOTAO GOV.BR
============================================ */
.btn-govbr {
    color: var(--auth-white);
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
    position: relative;
    overflow: hidden;
    font-weight: 600;
}

.btn-govbr:hover {
    color: var(--auth-white);
    background-color: var(--auth-primary-dark);
    border-color: var(--auth-primary-dark);
}

.btn-govbr:focus {
    color: var(--auth-white);
    box-shadow: 0 0 0 0.2rem rgba(19, 81, 180, 0.5);
}

.btn-govbr:disabled,
.btn-govbr.loading {
    pointer-events: none;
    opacity: 0.75;
}

/* Efeito shimmer no hover */
.btn-govbr::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-govbr:hover::before {
    left: 100%;
}

.govbr-logo {
    width: 18px;
    height: 18px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* ============================================
   DIVISOR
============================================ */
.divider {
    position: relative;
    text-align: center;
    margin: 1.25rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--auth-gray-300);
}

.divider span {
    background: var(--auth-white);
    color: var(--auth-gray-500);
    padding: 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* ============================================
   LINK ESQUECEU SENHA
============================================ */
.forgot-password-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.forgot-password-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* ============================================
   ANIMACOES
============================================ */
.fade-in {
    animation: authFadeIn 0.4s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.shake {
    animation: authShake 0.45s ease-in-out;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

/* Spinner ja disponivel no Bootstrap 4 */

/* ============================================
   RESPONSIVO – Mobile (< 576px)
============================================ */
@media (max-width: 575.98px) {
    .auth-section {
        align-items: flex-start;
        padding: 1rem 0.5rem;
        min-height: auto;
    }

    .login-card {
        border-radius: var(--auth-radius);
        box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.12);
    }

    .login-card-header {
        padding: 1.25rem 1.25rem 1rem;
    }

    .login-card-body {
        padding: 1rem 1.25rem 1.5rem;
    }
}

/* ============================================
   RESPONSIVO – Desktop (>= 768px)
============================================ */
@media (min-width: 768px) {
    .login-card {
        max-width: 440px;
    }
}
