/* ==========================================================================
   login.css — Tela de login (raiz do sistema)
   Paleta espelhada de assets/css/style.css (:root, --template1/2/3).
   Manter os mesmos valores ao alterar a paleta do sistema.
   Sem fontes externas: a CSP do sistema permite apenas font-src 'self' data:.
   ========================================================================== */

:root {
    --template1: #2E7D32;
    --template2: #1B5E20;
    --template3: #4CAF50;
    --template1-soft: rgba(46, 125, 50, 0.12);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body.login-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #212529;
    background:
        radial-gradient(1200px 600px at 15% 10%, rgba(76, 175, 80, 0.35), transparent 60%),
        radial-gradient(900px 500px at 85% 90%, rgba(27, 94, 32, 0.45), transparent 60%),
        linear-gradient(135deg, var(--template2) 0%, #10361a 100%);
    background-attachment: fixed;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: loginFadeIn 0.5s ease-out;
}

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

.login-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

.login-logo-placeholder {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--template1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.login-brand {
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0;
    font-size: 1.3rem;
    color: #212529;
}

.login-brand span { color: var(--template3); }

.login-subtitle {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8a8f98;
    margin: 2px 0 0;
}

.login-alert {
    border-radius: 12px;
    font-size: 0.83rem;
    padding: 10px 12px;
    margin-bottom: 18px;
}

.login-alert-danger  { background: #fdecea; color: #8a1c17; border: 1px solid #f5c6c3; }
.login-alert-warning { background: #fff6e5; color: #7a4b00; border: 1px solid #ffdda1; }
.login-alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #b6dfb9; }

.login-field { margin-bottom: 16px; }

.login-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #495057;
}

.login-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 0.95rem;
    color: #212529;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input::placeholder { color: #adb5bd; }

.login-input:focus {
    outline: none;
    border-color: var(--template3);
    box-shadow: 0 0 0 3px var(--template1-soft);
}

.login-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 4px;
    color: #6c757d;
    line-height: 1;
    cursor: pointer;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.83rem;
}

.login-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    cursor: pointer;
}

.login-check input { width: 16px; height: 16px; accent-color: var(--template1); }

.login-link {
    color: var(--template1);
    text-decoration: none;
    font-weight: 600;
}

.login-link:hover { color: var(--template2); text-decoration: underline; }

.login-btn {
    display: block;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    background: linear-gradient(135deg, var(--template1), var(--template2));
    box-shadow: 0 10px 22px rgba(27, 94, 32, 0.3);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(27, 94, 32, 0.38);
}

.login-btn:focus-visible { outline: 3px solid var(--template3); outline-offset: 2px; }
.login-btn:disabled { opacity: 0.7; cursor: progress; }

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.78rem;
    color: #8a8f98;
}

.login-modal .modal-content {
    background: #fff;
    color: #212529;
    border: 0;
    border-radius: 18px;
}

.login-modal .modal-header,
.login-modal .modal-footer { border-color: #eee; }

.login-modal .modal-footer .login-btn { min-height: 44px; }

#global-loader {
    position: fixed;
    inset: 0;
    background: #10361a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575.98px) {
    body.login-body { padding: 16px 12px; }
    .login-card { padding: 28px 20px 22px; border-radius: 16px; }
    .login-brand { font-size: 1.15rem; }
    .login-options { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .login-card { animation: none; }
    .login-btn { transition: none; }
}
