/* ========= BACKGROUND + LAYOUT GERAL ========= */

html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    /* Imagem de fundo ocupando a tela toda */
    background:
        radial-gradient(circle at top,
            rgba(15, 23, 42, 0.60) 0,
            rgba(2, 6, 23, 0.78) 45%,
            rgba(2, 6, 23, 0.85) 100%),
        url('img-login/fundo-login.jpg') center center / cover no-repeat fixed;

    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e5e7eb;
}

/* Conteúdo só aparece com JS habilitado */
.main-content-bloqueio-js {
    display: none !important;
}

.js-enabled .main-content-bloqueio-js {
    display: flex !important;
}

/* Wrapper centraliza tudo na tela */
.login-page-wrapper {
    flex: 1;
    min-height: 100vh;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Card do login – MAIOR E CENTRALIZADO */
.login-card {
    width: 80%;
    max-width: 520px;
    /* aumentei o tamanho */
    background: rgba(15, 23, 42, 0.96);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.75);
    padding: 26px 22px 22px;
    backdrop-filter: blur(9px);
}

@media (min-width: 576px) {
    .login-card {
        padding: 28px 30px 24px;
    }
}

@media (min-width: 992px) {
    .login-card {
        max-width: 540px;
        padding: 30px 34px 26px;
    }
}

.login-logo {
    max-width: 260px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e5e7eb;
}

.form-control {
    background-color: #020617;
    border-color: #1f2937;
    color: #f9fafb;
    border-radius: 10px;
    font-size: 0.95rem;
}

.form-control:focus {
    background-color: #020617;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.55);
    color: #f9fafb;
}

.input-group-text {
    background-color: #020617;
    border-color: #1f2937;
    color: #9ca3af;
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #9ca3af;
}

.btn-login-primary {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    border: none;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
}

.btn-login-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.6);
}

.btn-link-block {
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.88rem;
}

.btn-link-light {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.btn-link-light:hover {
    background: rgba(15, 23, 42, 0.8);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.9);
}

.btn-link-ghost {
    background: transparent;
    color: #9ca3af;
    border: 1px solid transparent;
}

.btn-link-ghost:hover {
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.7);
}

.checkbox-label {
    font-size: 0.86rem;
    color: #d1d5db;
}

.login-footer {
    margin-top: 16px;
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}

.login-footer a {
    color: #e5e7eb;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ==== Ajustes SweetAlert para não mexer na altura/scroll ==== */
body.swal2-height-auto {
    height: 100vh !important;
}

body.swal2-shown,
body.swal2-iosfix {
    padding-right: 0 !important;
}

/* Overlay elegante quando JS estiver desativado */
.noscript-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: #fff;
    text-align: center;
    padding: 24px;
}

.noscript-box {
    background: rgba(220, 53, 69, .92);
    padding: 32px;
    border-radius: 14px;
    box-shadow: 0 0 24px rgba(220, 53, 69, .8);
    animation: pulse 1.6s infinite;
    max-width: 640px;
    width: 100%;
}

.noscript-box i {
    font-size: 84px;
    margin-bottom: 14px;
    display: block;
}

.noscript-box h1 {
    font-size: 30px;
    margin: 0 0 6px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.noscript-box p {
    font-size: 18px;
    margin: 0;
    line-height: 1.5;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(220, 53, 69, .6);
    }

    50% {
        box-shadow: 0 0 40px rgba(220, 53, 69, 1);
    }

    100% {
        box-shadow: 0 0 20px rgba(220, 53, 69, .6);
    }
}


/* Placeholders claros no tema escuro */
.form-control::placeholder {
    color: #e0e0e0 !important;
    opacity: 0.8;
}


/* Caso use input-group-text com cor escura */
.input-group-text {
    background-color: #1f1f1f;
    color: #ffffff;
}

/* ===== Modo app premium apenas para celular e tablet ===== */
@media (max-width: 1024px) {
    :root {
        --login-app-bg: #070b12;
        --login-app-surface: rgba(15, 23, 42, .78);
        --login-app-surface-strong: rgba(17, 25, 39, .94);
        --login-app-line: rgba(255, 255, 255, .12);
        --login-app-text: #f8fafc;
        --login-app-muted: #9aa7ba;
        --login-app-brand: #705cfc;
        --login-app-brand-2: #00e0b8;
        --login-app-warning: #ffc857;
    }

    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        background-color: var(--login-app-bg);
    }

    body {
        display: block;
        color: var(--login-app-text);
        background:
            radial-gradient(circle at 18% -10%, rgba(112, 92, 252, .28), transparent 34%),
            radial-gradient(circle at 105% 16%, rgba(0, 224, 184, .16), transparent 34%),
            linear-gradient(180deg, rgba(5, 9, 15, .78), rgba(5, 9, 15, .96)),
            url('../../img-login/fundo-login-mobile.jpg') center center / cover no-repeat fixed;
    }

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 24%),
            radial-gradient(circle at 50% 100%, rgba(112, 92, 252, .12), transparent 34%);
        z-index: 0;
    }

    .main-content-bloqueio-js {
        position: relative;
        z-index: 1;
        width: 100%;
        min-height: 100svh;
    }

    .login-page-wrapper {
        position: relative;
        width: 100%;
        min-height: 100svh;
        justify-content: flex-start;
        align-items: stretch;
        padding:
            max(18px, env(safe-area-inset-top, 0px) + 14px)
            14px
            max(18px, env(safe-area-inset-bottom, 0px) + 14px);
        gap: 12px;
    }

    .login-page-wrapper::before {
        content: "Area segura";
        align-self: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 0 14px;
        border: 1px solid rgba(0, 224, 184, .18);
        border-radius: 999px;
        color: #dffbf6;
        background: rgba(0, 224, 184, .08);
        font-size: .72rem;
        font-weight: 800;
        letter-spacing: .02em;
        box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    }

    .login-card {
        position: relative;
        width: 100%;
        max-width: 620px;
        margin: 0 auto;
        padding: 22px 18px 18px;
        border-radius: 28px;
        border: 1px solid var(--login-app-line);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)),
            var(--login-app-surface-strong);
        box-shadow:
            0 28px 70px rgba(0, 0, 0, .50),
            inset 0 1px 0 rgba(255, 255, 255, .08);
        backdrop-filter: saturate(145%) blur(18px);
        overflow: hidden;
    }

    .login-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 4px;
        background: linear-gradient(90deg, var(--login-app-brand), var(--login-app-brand-2), var(--login-app-warning));
    }

    .login-card::after {
        content: "";
        position: absolute;
        right: -52px;
        top: -52px;
        width: 128px;
        height: 128px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(112, 92, 252, .22), transparent 68%);
        pointer-events: none;
    }

    .login-card > * {
        position: relative;
        z-index: 1;
    }

    .login-card .text-center.mb-4 {
        display: flex;
        justify-content: center;
        margin-bottom: 18px !important;
    }

    .login-logo {
        width: min(210px, 72vw);
        max-width: 210px;
        height: auto;
        padding: 10px 14px;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 20px;
        background: rgba(3, 7, 18, .42);
        box-shadow: 0 18px 34px rgba(0, 0, 0, .28);
        object-fit: contain;
    }

    .login-title {
        margin-bottom: 6px;
        font-size: clamp(1.42rem, 5.2vw, 2rem);
        line-height: 1.08;
        font-weight: 850;
        letter-spacing: 0;
        color: var(--login-app-text);
    }

    .login-subtitle {
        max-width: 46ch;
        margin-bottom: 0;
        color: var(--login-app-muted);
        font-size: .88rem;
        line-height: 1.55;
    }

    .form-label {
        margin-bottom: 7px;
        color: #dbe5f2;
        font-size: .82rem;
        font-weight: 800;
    }

    .input-group {
        min-height: 54px;
        border: 1px solid rgba(255, 255, 255, .10);
        border-radius: 18px;
        background: rgba(3, 7, 18, .58);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
        overflow: hidden;
    }

    .input-group:focus-within {
        border-color: rgba(0, 224, 184, .55);
        box-shadow:
            0 0 0 4px rgba(0, 224, 184, .10),
            inset 0 1px 0 rgba(255, 255, 255, .05);
    }

    .input-group-text,
    .form-control {
        min-height: 54px;
        border: 0 !important;
        background: transparent !important;
        color: var(--login-app-text);
    }

    .input-group-text {
        width: 52px;
        justify-content: center;
        color: var(--login-app-brand-2);
        font-size: 1.05rem;
    }

    .form-control {
        padding: 12px 14px 12px 2px;
        font-size: 16px;
        font-weight: 650;
    }

    .form-control:focus {
        box-shadow: none;
        color: var(--login-app-text);
    }

    .form-control::placeholder {
        color: rgba(226, 232, 240, .58) !important;
        opacity: 1;
    }

    #tipoUsuario {
        min-height: 20px !important;
        color: var(--login-app-brand-2) !important;
        font-size: .72rem;
        font-weight: 800;
    }

    .form-check-input {
        width: 1.05rem;
        height: 1.05rem;
        border-color: rgba(255, 255, 255, .24);
        background-color: rgba(3, 7, 18, .62);
    }

    .form-check-input:checked {
        border-color: var(--login-app-brand-2);
        background-color: var(--login-app-brand-2);
    }

    .checkbox-label {
        color: #cbd5e1;
        font-size: .82rem;
        font-weight: 700;
    }

    .btn-login-primary {
        min-height: 54px;
        border-radius: 18px;
        color: #071118;
        font-weight: 900;
        letter-spacing: 0;
        background: linear-gradient(135deg, var(--login-app-brand-2), #8cf7e4);
        box-shadow:
            0 18px 34px rgba(0, 224, 184, .24),
            inset 0 1px 0 rgba(255, 255, 255, .35);
    }

    .btn-login-primary:hover,
    .btn-login-primary:focus {
        color: #071118;
        filter: saturate(112%) brightness(1.02);
        transform: translateY(-1px);
    }

    .btn-link-block {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
        font-size: .84rem;
        font-weight: 850;
        text-decoration: none;
    }

    .btn-link-light {
        color: #eef5ff;
        border-color: rgba(255, 255, 255, .12);
        background: rgba(255, 255, 255, .055);
    }

    .btn-link-light:hover,
    .btn-link-light:focus {
        color: #fff;
        border-color: rgba(112, 92, 252, .42);
        background: rgba(112, 92, 252, .16);
    }

    .btn-link-ghost {
        color: #b7c2d2;
        border-color: rgba(255, 255, 255, .08);
        background: rgba(3, 7, 18, .32);
    }

    .btn-link-ghost:hover,
    .btn-link-ghost:focus {
        color: #fff;
        border-color: rgba(255, 255, 255, .18);
        background: rgba(255, 255, 255, .07);
    }

    .login-footer {
        width: min(100%, 620px);
        margin: 0 auto;
        padding: 12px 14px 0;
        color: rgba(203, 213, 225, .72);
        font-size: .68rem;
        line-height: 1.55;
    }

    .login-footer a {
        color: #e8eef7;
        font-weight: 800;
    }

    .swal2-popup {
        border-radius: 24px !important;
        background: #101827 !important;
        color: #f8fafc !important;
        border: 1px solid rgba(255, 255, 255, .12) !important;
    }
}

@media (max-width: 420px) {
    .login-page-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }

    .login-card {
        padding: 20px 14px 16px;
        border-radius: 24px;
    }

    .login-logo {
        max-width: 186px;
    }

    .login-subtitle {
        font-size: .82rem;
    }

    .input-group,
    .input-group-text,
    .form-control {
        min-height: 51px;
    }

    .btn-login-primary {
        min-height: 52px;
    }

    .btn-link-block {
        min-height: 46px;
        font-size: .78rem;
    }
}

@media (max-height: 720px) and (max-width: 1024px) {
    .login-page-wrapper {
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .login-page-wrapper::before {
        display: none;
    }

    .login-card {
        padding-top: 16px;
        padding-bottom: 14px;
    }

    .login-card .text-center.mb-4 {
        margin-bottom: 12px !important;
    }

    .login-logo {
        max-width: 168px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .login-title {
        font-size: 1.28rem;
    }

    .login-subtitle {
        font-size: .78rem;
        line-height: 1.42;
    }

    .input-group,
    .input-group-text,
    .form-control {
        min-height: 48px;
    }

    .mb-3 {
        margin-bottom: .72rem !important;
    }

    .btn-login-primary {
        min-height: 49px;
        margin-bottom: .65rem !important;
    }

    .btn-link-block {
        min-height: 42px;
    }

    .login-footer {
        font-size: .62rem;
        padding-top: 4px;
    }
}
