/* =========================================================
   TraceGP - Modern Split Hero Theme
   Responsive across: Mobile, Tablet, Laptop (1366x768),
   Full HD (1920x1080), QHD/2K (2560x1440), and 4K
   ========================================================= */

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

html, body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(79, 70, 229, 0.12) 0%, transparent 40%),
                linear-gradient(135deg, #050b1a 0%, #0a132b 50%, #050b1a 100%);
    background-attachment: fixed;
    color: #334155;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

form.login {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

#bandeiras {
    display: none !important;
}

/* --- CONTAINER CENTRAL DO LOGIN --- */
#loginWrapperCentral {
    width: 100%;
    max-width: 1080px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* --- CARD PRINCIPAL (SPLIT HERO + LOGIN CARD) --- */
#cabecalhoVisual {
    width: 85%;
    background-color: #060e24;
    background-image: linear-gradient(90deg, rgba(6, 14, 36, 0.93) 0%, rgba(8, 20, 52, 0.72) 45%, rgba(6, 14, 36, 0.85) 100%),
                      url('../imagens/fundo-img.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 24px;
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    animation: authCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- SEÃÃO HERO ESQUERDA (MENSAGEM E DETALHES) --- */
#heroSection {
    flex: 1 1 54%;
    background: transparent;
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 520px;
    position: relative;
}

#logoSobreposta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 24px;
}

#logoSobreposta img {
    max-height: 56px;
    max-width: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    filter: none;
}

.hero-content {
    margin: auto 0;
    padding: 10px 0;
}

.hero-title {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.5px;
}

.hero-highlight {
    color: #38bdf8 !important;
}

.hero-line {
    width: 36px;
    height: 3px;
    background: #0284c7;
    border-radius: 2px;
    margin: 16px 0 16px 0;
}

.hero-desc {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
    max-width: 380px;
}

.hero-features {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 20px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.feature-item:hover .feature-icon {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    transform: translateY(-2px);
}

.feature-item span {
    font-size: 11.5px;
    font-weight: 500;
    color: #cbd5e1;
    text-align: center;
}

/* --- ÃREA DE LOGIN DIREITA (CARD BRANCO FLUTUANTE) --- */
#areaLoginCentralizada {
    flex: 0 0 460px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

#cardLoginInner {
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px 28px 34px 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
}

/* --- SELETOR DE IDIOMA NO CANTO SUPERIOR DIREITO DO CARD --- */
.card-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.language-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-globe-icon {
    position: absolute;
    left: 10px;
    pointer-events: none;
    z-index: 2;
    stroke: #64748b;
}

.language-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 5px 28px 5px 30px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: #475569;
    cursor: pointer;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 11px;
}

.language-select:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.language-select:focus {
    background-color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    color: #0f172a;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 13.5px;
    color: #64748b;
}

#campos {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#divUser, #divPasswd, #divCodigo {
    position: relative;
    width: 100%;
    padding-bottom: 0 !important;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    z-index: 2;
}

.toggle-password:hover {
    background: rgba(0, 0, 0, 0.05);
}

.campoTxt {
    width: 100% !important;
    height: 48px !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 0 42px 0 44px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.campoTxt:hover {
    border-color: #cbd5e1 !important;
}

.campoTxt:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}

.campoTxt::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    font-size: 13.5px !important;
}

/* --- SELECT DE DOMÃNIO LDAP --- */
#dominioUsuario {
    width: 100% !important;
    height: 48px !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #0f172a !important;
    cursor: pointer !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center !important;
    background-size: 16px !important;
}

#dominioUsuario:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}

/* --- LINHA DE OPÃÃES: LEMBRAR USUÃRIO & RECUPERAR SENHA --- */
#optionsRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

#esqueciSenhaAlteraUsuario {
    display: flex;
    align-items: center;
}

#esqueciSenhaAlteraUsuario label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #475569 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    user-select: none;
}

#salvarUsuarioSenha {
    accent-color: #2563eb !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    border: 1.5px solid #cbd5e1 !important;
}

#divRecSenha {
    margin: 0 !important;
}

#botaoRec2 {
    background: none !important;
    border: none !important;
    color: #0284c7 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    padding: 0 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

#botaoRec2:hover {
    color: #0369a1 !important;
    text-decoration: underline !important;
}

#botaoRec2 div {
    padding: 0 !important;
}

/* --- BOTÃO DE LOGIN --- */
#divLogin {
    width: 100%;
    margin-top: 4px;
}

#botaoAcessarLogin {
    width: 100% !important;
    height: 48px !important;
    background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    letter-spacing: 0.2px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    outline: none !important;
}

#botaoAcessarLogin:hover {
    background: linear-gradient(135deg, #0369a1 0%, #1e40af 100%) !important;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45) !important;
    transform: translateY(-1px) !important;
}

#botaoAcessarLogin:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

#botaoAcessarLogin:focus-visible {
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.35) !important;
}

#divIdioma {
    display: none !important;
}

/* --- RODAPÃ --- */
#rodape {
    width: 100%;
    margin-top: 20px;
    background: transparent !important;
    position: static !important;
    height: auto !important;
    opacity: 1 !important;
}

#rodapeInterno {
    width: 100% !important;
    height: auto !important;
    font-size: 12px !important;
    font-family: inherit !important;
    color: #64748b !important;
    text-align: center !important;
    line-height: 1.6 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
}

#rodapeInterno #v2, #rodapeInterno #v3 {
    display: none !important;
}

.rodape-versao {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.badge-versao {
    color: #38bdf8;
    font-weight: 600;
}

#versao {
    float: none !important;
    line-height: normal !important;
    display: inline-block !important;
    color: #94a3b8 !important;
    font-size: 12px;
}

#creditos {
    float: none !important;
    line-height: 1.5 !important;
    text-align: center !important;
    display: block !important;
    color: #64748b !important;
    font-size: 12px !important;
}

#creditos a {
    color: #38bdf8 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    transition: color 0.2s ease;
}

#creditos a:hover {
    color: #7dd3fc !important;
    text-decoration: underline !important;
}

/* --- DIÃLOGOS DE CAPS LOCK E POPUP --- */
#divCaps {
    font-family: inherit;
    font-size: 12px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- RESPONSIVIDADE (MONITORES DE MÃDIA PARA ALTA RESOLUÃÃO E DISPOSITIVOS) --- */

/* Monitores de Altura Limitada (Laptops 1366x768, 1440x900, ou 1080p com escala 125%/150%) */
@media (max-height: 780px) and (min-width: 961px) {
    form.login {
        padding: 12px 16px;
    }
    #cabecalhoVisual {
        min-height: 470px;
    }
    #heroSection {
        min-height: 470px;
        padding: 28px 32px;
    }
    #logoSobreposta {
        margin-bottom: 16px;
    }
    #logoSobreposta img {
        max-height: 46px;
    }
    .hero-title {
        font-size: 26px;
    }
    .hero-line {
        margin: 12px 0;
    }
    .hero-desc {
        font-size: 13px;
        line-height: 1.5;
    }
    .hero-features {
        gap: 16px;
        padding-top: 14px;
    }
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    #areaLoginCentralizada {
        padding: 16px 20px;
    }
    #cardLoginInner {
        padding: 18px 24px 24px 24px;
    }
    .login-header {
        margin-bottom: 16px;
    }
    .login-title {
        font-size: 21px;
        margin-bottom: 3px;
    }
    #campos {
        gap: 12px;
    }
    .campoTxt, #dominioUsuario, #botaoAcessarLogin {
        height: 44px !important;
    }
    #rodape {
        margin-top: 10px;
    }
}

/* Monitores Full HD (1920x1080) */
@media (min-width: 1700px) and (max-width: 2199px) and (min-height: 850px) {
    #loginWrapperCentral {
        max-width: 1160px;
    }
    #heroSection {
        min-height: 560px;
        padding: 48px 44px;
    }
    .hero-title {
        font-size: 34px;
    }
    .hero-desc {
        font-size: 15px;
        max-width: 430px;
    }
    #areaLoginCentralizada {
        flex: 0 0 490px;
        padding: 26px 30px;
    }
    #cardLoginInner {
        padding: 28px 32px 36px 32px;
    }
    .login-title {
        font-size: 25px;
    }
}

/* Monitores de Alta ResoluÃ§Ã£o / 2K / QHD / 4K (largura >= 2200px e altura >= 1100px) */
@media (min-width: 2200px) and (min-height: 1100px) {
    #loginWrapperCentral {
        max-width: 1380px;
    }
    #cabecalhoVisual {
        border-radius: 28px;
        box-shadow: 0 35px 80px -15px rgba(0, 0, 0, 0.85),
                    0 0 0 1px rgba(255, 255, 255, 0.12);
    }
    #heroSection {
        min-height: 640px;
        padding: 56px 52px;
    }
    #logoSobreposta {
        margin-bottom: 28px;
    }
    #logoSobreposta img {
        max-height: 68px;
        max-width: 280px;
    }
    .hero-title {
        font-size: 40px;
        line-height: 1.25;
    }
    .hero-line {
        width: 44px;
        height: 4px;
        margin: 20px 0;
    }
    .hero-desc {
        font-size: 16px;
        line-height: 1.65;
        max-width: 480px;
    }
    .hero-features {
        gap: 28px;
        padding-top: 24px;
    }
    .feature-icon {
        width: 52px;
        height: 52px;
    }
    .feature-icon svg {
        width: 24px;
        height: 24px;
    }
    .feature-item span {
        font-size: 13px;
    }
    #areaLoginCentralizada {
        flex: 0 0 540px;
        padding: 32px 36px;
    }
    #cardLoginInner {
        border-radius: 24px;
        padding: 32px 36px 42px 36px;
        box-shadow: 0 25px 55px rgba(0, 0, 0, 0.5);
    }
    .language-select {
        font-size: 13px;
        padding: 6px 30px 6px 32px;
    }
    .login-title {
        font-size: 28px;
        margin-bottom: 8px;
    }
    .login-subtitle {
        font-size: 15px;
    }
    #campos {
        gap: 18px;
    }
    .campoTxt {
        height: 54px !important;
        font-size: 15.5px !important;
        border-radius: 12px !important;
    }
    #dominioUsuario {
        height: 54px !important;
        font-size: 15px !important;
        border-radius: 12px !important;
    }
    #esqueciSenhaAlteraUsuario label {
        font-size: 14px !important;
    }
    #botaoRec2 {
        font-size: 14px !important;
    }
    #botaoAcessarLogin {
        height: 54px !important;
        font-size: 16.5px !important;
        border-radius: 12px !important;
    }
    .rodape-versao, #versao, #creditos, #creditos a {
        font-size: 13.5px !important;
    }
}

/* Tablets / Telas mÃ©dias (atÃ© 960px) */
@media (max-width: 960px) {
    #cabecalhoVisual {
        flex-direction: column;
        max-width: 520px;
        margin: 16px auto;
    }
    #heroSection {
        padding: 28px 24px 16px 24px;
        min-height: auto;
    }
    .hero-features {
        display: none;
    }
    .hero-title {
        font-size: 24px;
    }
    .hero-desc {
        font-size: 13.5px;
    }
    #areaLoginCentralizada {
        flex: 1 1 auto;
        padding: 0 20px 24px 20px;
    }
    #cardLoginInner {
        padding: 30px 24px;
    }
}

/* Smartphones / Mobile (atÃ© 640px) */
@media (max-width: 640px) {
    form.login {
        padding: 16px 12px 20px 12px;
        justify-content: flex-start;
    }

    #cabecalhoVisual {
        border-radius: 18px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
        margin: 8px 0 16px 0;
    }

    #heroSection {
        padding: 24px 16px 12px 16px;
    }

    #logoSobreposta {
        justify-content: center;
        margin-bottom: 0;
    }

    #logoSobreposta img {
        max-height: 48px;
        max-width: 200px;
    }

    .hero-content {
        display: none;
    }

    #areaLoginCentralizada {
        padding: 0 12px 20px 12px;
    }

    #cardLoginInner {
        border-radius: 16px;
        padding: 20px 18px 24px 18px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    }

    .card-top-bar {
        margin-bottom: 4px;
    }

    .login-header {
        margin-bottom: 18px;
    }

    .login-title {
        font-size: 21px;
    }

    .login-subtitle {
        font-size: 13px;
    }

    .campoTxt {
        height: 50px !important;
        font-size: 16px !important;
        padding: 0 42px 0 44px !important;
    }

    #dominioUsuario {
        height: 50px !important;
        font-size: 16px !important;
    }

    #botaoAcessarLogin {
        height: 50px !important;
        font-size: 16px !important;
    }

    #optionsRow {
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 4px;
    }

    #rodape {
        margin-top: 14px;
    }
}