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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 24px;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Inter', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;

    background-color: #eef3f8;
    background-image: url('/imagens/background_silveira_eng.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Camada sutil para manter o formulário legível em qualquer tela. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.16) 50%,
        rgba(255, 255, 255, 0.06) 100%
    );
}

.login-container {
    position: relative;
    z-index: 1;
    width: min(100%, 380px);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;

    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 14px;
    box-shadow:
        0 22px 55px rgba(15, 44, 77, 0.18),
        0 5px 18px rgba(15, 44, 77, 0.09);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-container img {
    max-width: 260px;
    width: 100%;
    height: auto;
    display: inline-block;
}

.login-container h2 {
    text-align: center;
    margin: 0 0 1.5rem;
    font-size: 1.2rem;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.login-container label {
    margin: 0.5rem 0 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.login-container input[type='text'],
.login-container input[type='password'] {
    width: 100%;
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    color: #172033;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-container input:focus {
    outline: none;
    border-color: #1e5e9c;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 94, 156, 0.13);
}

.login-container button {
    margin-top: 0.5rem;
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    background: #1f5f9d;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.login-container button:hover {
    background: #174b7d;
    box-shadow: 0 7px 18px rgba(31, 95, 157, 0.22);
    transform: translateY(-1px);
}

.login-container button:active {
    transform: translateY(0);
}

.note {
    margin-top: 1.5rem;
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: center;
}

.turnstile-wrapper {
    margin: 0 0 1.2rem;
    display: flex;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}

.error-box {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #f3c2c0;
    border-radius: 8px;
    background: #fff1f0;
    color: #8a1f1f;
    font-size: 0.85rem;
    text-align: center;
}

.success-box {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #86efac;
    border-radius: 8px;
    background: #ecfdf3;
    color: #166534;
    font-size: 0.85rem;
    text-align: center;
}

.forgot-link {
    margin-top: 12px;
    text-align: center;
}

.forgot-link a {
    color: #1f5f9d;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link a:hover {
    text-decoration: underline;
}

.system-version {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 900px) {
    body {
        background-position: 42% center;
        background-attachment: scroll;
    }
}

@media (max-width: 500px) {
    body {
        padding: 18px;
        align-items: flex-start;
        background-position: 54% center;
    }

    .login-container {
        width: 100%;
        margin: 18px 0;
        padding: 2rem 1.4rem;
        border-radius: 12px;
    }

    .logo-container img {
        max-width: 220px;
    }

    .system-version {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
