* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: url("/static/img/login_sistemaster_bg.png") no-repeat;
    background-size: cover;
    background-position: center center;

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* overlay escuro leve pra dar contraste */
body::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 38%, rgba(125, 211, 252, 0.18), transparent 34%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.48), rgba(15, 23, 42, 0.22), rgba(2, 6, 23, 0.52));
    top: 0;
    left: 0;
    z-index: 0;
}

.marca-sistemaster {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 1;
    width: clamp(420px, 29vw, 560px);
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.42));
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    position: relative;
    z-index: 2;
    transform: translateY(72px);
}

.login-box {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92));
    backdrop-filter: blur(14px);

    padding: 26px 28px 26px;
    border: 1px solid rgba(191, 219, 254, 0.72);
    border-radius: 8px;
    box-shadow:
        0 22px 55px rgba(2, 8, 23, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);

    animation: fadeIn 0.6s ease;
}

.login-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #2563eb, #38bdf8);
}

.login-box h1 {
    margin-bottom: 18px;
    font-size: 18px;
    line-height: 1.2;
    color: #173b63;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.login-box h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 2px;
    margin: 8px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

.form-grupo {
    margin-bottom: 17px;
}

.form-grupo label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
    font-weight: bold;
}

.form-grupo input {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* foco bonito */
.form-grupo input:focus {
    border-color: #0ea5e9;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

button {
    width: 100%;
    min-height: 42px;
    padding: 11px 12px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
    filter: brightness(0.97);
    box-shadow: 0 13px 26px rgba(37, 99, 235, 0.32);
    transform: translateY(-1px);
}

.erro-login {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* animação suave */
@keyframes fadeIn {
    from {
        transform: translateY(12px);
    }
    to {
        transform: translateY(0);
    }
}

.mensagem-login {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: bold;
}

.mensagem-login.sucesso {
    background: #dcfce7;
    color: #166534;
}

.mensagem-login.erro {
    background: #fee2e2;
    color: #991b1b;
}

.status-licenca {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
}

.status-licenca.ok {
    background: linear-gradient(90deg, #dcfce7, #ecfdf5);
    color: #14532d;
    border: 1px solid #bbf7d0;
}

.status-licenca.bloqueada {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.botao-licenca {
    margin-top: 12px;
    background: rgba(248, 250, 252, 0.84);
    color: #1f2937;
    border: 1px solid #cbd5e1;
    box-shadow: none;
}

.botao-licenca:hover {
    background: #eef2ff;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.versao-app {
    margin-top: 14px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
    font-weight: bold;
}

@media (max-width: 900px) {
    body {
        align-items: flex-end;
        overflow-y: auto;
        padding-top: 110px;
        padding-bottom: 22px;
    }

    .login-container {
        transform: none;
    }

    .marca-sistemaster {
        top: 18px;
        width: min(380px, 82vw);
    }
}

@media (max-height: 820px) and (min-width: 901px) {
    .marca-sistemaster {
        top: 10px;
        width: clamp(330px, 27vw, 380px);
    }

    .login-container {
        transform: translateY(76px);
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 14px;
    }

    .login-box {
        padding: 26px 22px 23px;
    }

    .login-box h1 {
        font-size: 18px;
    }
}

.aviso-atualizacao {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    text-align: center;
    font-size: 13px;
}

.aviso-atualizacao strong,
.aviso-atualizacao span {
    display: block;
}

.aviso-atualizacao span {
    margin-top: 3px;
    color: #7c2d12;
}

.aviso-atualizacao button {
    margin-top: 10px;
    background: #f97316;
    color: #fff;
}

.aviso-atualizacao button:hover {
    background: #ea580c;
}

.retorno-atualizacao {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    background: #eef2ff;
    color: #1d4ed8;
}

.retorno-atualizacao.ok {
    background: #dcfce7;
    color: #166534;
}

.retorno-atualizacao.erro {
    background: #fee2e2;
    color: #991b1b;
}

.modal-licenca {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(15, 23, 42, 0.66);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-atualizacao {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 11;
    background: rgba(15, 23, 42, 0.66);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-licenca.ativo,
.modal-atualizacao.ativo {
    display: flex;
}

.modal-caixa {
    width: min(560px, 100%);
    background: #ffffff;
    border-radius: 14px;
    padding: 26px;
    position: relative;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.modal-caixa h2 {
    color: #111827;
    margin-bottom: 8px;
}

.modal-caixa p {
    color: #4b5563;
    margin-bottom: 18px;
}

.modal-caixa-atualizacao {
    max-width: 420px;
}

.acoes-backup-atualizacao {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.acoes-backup-atualizacao button {
    min-height: 44px;
}

.botao-sem-backup {
    background: #f97316;
}

.botao-sem-backup:hover {
    background: #ea580c;
}

.modal-caixa label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
    font-weight: bold;
}

.modal-caixa textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: vertical;
    font-size: 13px;
    margin-bottom: 14px;
}

.fechar-modal {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #ef4444;
    padding: 0;
    font-size: 22px;
}
