@import url('https://fonts.googleapis.com/css2?family=Afacad:ital,wght@0,400..700;1,400..700&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --bg-page: #ebedf0;
    /* cinza claro do fundo */
    --card-grad-1: #0e1116;
    /* degradê cinza escuro */
    --card-grad-2: #081c3e;
    /* degradê cinza escuro */
    --muted: #8a8f98;
    --text: #eaeef5;
    --title: #ffffff;
    --input-bg: #292e37;
    --input-border: #3b5481;
    --input-focus: #2f86ff;
    --btn-blue-1: #3294ff;
    --btn-blue-2: #1b6fff;
    --btn-gray: #3a414b;
    --shadow: 0 30px 60px rgba(0, 0, 0, .30), 0 10px 25px rgba(0, 0, 0, .15);
    --radius-xl: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Montserrat", sans-serif !important;
    background: var(--bg-page);
    display: grid;
    place-items: center;
    color: var(--text);
}

/* Lado esquerdo: formulário */
.section-main {
    height: 100%;
    width: 100%;
    background-image: url("../img/bg-2.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    position: relative;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    z-index: 2;
}

.top {
    height: 5%;
    width: 100%;
    animation: slideIn 0.9s ease-in-out;
}

.bottom {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    animation: slideIn 0.9s ease-in-out;
}

.label-first-access {
    margin-top: 0.8rem;
    font-size: 14px;
}

.info-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    letter-spacing: .2px;
    color: #020a14;
    opacity: .95;
}

.brand .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--btn-blue-1);
    box-shadow: 0 0 0 6px rgba(50, 148, 255, .15);
}

h1 {
    margin: 0;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--title);
}

.pretitle {
    font-size: 12px;
    letter-spacing: .18em;
    color: #b5bac3;
    opacity: .85;
}

.muted {
    color: var(--muted);
}

.muted a {
    color: var(--btn-blue-1);
    text-decoration: none;
}

form {
    display: grid;
    gap: 14px;
    margin-top: 6px;
    max-width: 520px;
}

.form-login {
    background: linear-gradient(135deg, var(--card-grad-1), var(--card-grad-2));
    padding: 3rem;
    border-radius: 21px;
    max-width: 520px;
}

.field {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 12px 14px 12px 44px;
    transition: .25s border, .25s box-shadow, .25s background;
}

.field input {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--text);
    font-size: 15px;
}

.field:hover {
    border-color: #3a4352;
}

.field:focus-within {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(47, 134, 255, .25);
}

.icon {
    position: absolute;
    left: 12px;
    opacity: .8;
}

.material-symbols-rounded.icon {
    font-size: 1.3rem;
    /* tamanho relativo */
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 20;
}

.suffix-btn {
    position: absolute;
    right: 10px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--input-bg);
    color: var(--text);
    background: transparent;
    cursor: pointer;
    opacity: .9;
    transition: all 0.3s ease-in-out;
}

.suffix-btn:hover {
    border-color: var(--btn-blue-1);
}

.row {
    display: flex;
    gap: 12px;
}

.row .field {
    flex: 1;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.btn {
    width: 100%;
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .25s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-gray {
    background: var(--btn-gray);
    color: #e7ebf2;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .03);
}

.btn-gray:hover {
    filter: brightness(1.05);
}

.btn-blue {
    background: linear-gradient(180deg, var(--btn-blue-1), var(--btn-blue-2));
    color: #fff;
    box-shadow: none;
    transition: all 0.3s ease-in-out;
}

.btn-blue:hover {
    box-shadow: 0 10px 20px rgba(50, 148, 255, .25), inset 0 -4px 0 rgba(0, 0, 0, .15);
    filter: brightness(1.03);
}

/* Lado direito: imagem */
.right {
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, .05);
}

.right::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('https://images.unsplash.com/photo-1501785888041-af3ef285b470?q=80&w=1600&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    filter: saturate(.95) contrast(1.05) brightness(.8);
    transform: scale(1.02);
}

/* gradiente escuro por cima da foto para dar contraste */
.right::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(1200px 500px at -10% 50%, transparent 35%, rgba(0, 0, 0, .55) 70%), linear-gradient(90deg, rgba(20, 23, 28, .85) 0%, rgba(20, 23, 28, 0) 60%);
    pointer-events: none;
}

/* Linha pontilhada curva entre as áreas */
svg.curve {
    position: absolute;
    left: 56%;
    top: 0;
    height: 100%;
    width: 220px;
    pointer-events: none;
    z-index: 1;
    opacity: .55;
}

.pop-up-confirmation-key {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(11, 41, 94, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    z-index: 9999;

    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Para evitar que a rolagem "trave" no body */
body.modal-open {
    overflow: hidden;
}

.pop-none {
    opacity: 0;
    visibility: hidden;
}

.pop-container {
    width: 800px;
    padding: 2rem 3rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--card-grad-1);
    box-shadow: 0 0 0 3px rgba(47, 134, 255, .25);
    animation: slideIn 0.8s ease-in-out;
}

.firstAccessForm {
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* Botão mostrar senha */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 1rem;
    transition: all 0.3s ease-in-out;
}

.toggle-password:hover {
    color: #2f86ff;
}

/* Barra de força */
.password-strength {
    margin-top: 8px;
    margin-bottom: 1.3rem;
    height: 8px;
    width: 49%;
    background: #eee;
    border-radius: 4px;
    position: relative;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-text {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

.group-input-container {
    width: 100%;
    display: flex;
    gap: 14px;
}

.items-input {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.close-pop-up {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.close-pop-up .btn-close-pop-up {
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--title);
    transition: all 0.3s ease-in-out;
}

.close-pop-up .btn-close-pop-up:hover {
    color: var(--btn-blue-1);
    transform: scale(1.1);
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Responsivo */
/* Tablet */
@media (max-width: 900px) {
    .panel {
        grid-template-columns: 1fr;
    }

    .right {
        display: none;
    }

    .left {
        padding: 36px 28px;
    }

    .card {
        height: auto;
    }

    svg.curve {
        display: none;
    }

    .pop-container {
        width: 90%;
        padding: 2rem;
        flex-direction: column;
    }

    h1 {
        font-size: 32px;
    }
}

/* Mobile grande (até 600px) */
@media (max-width: 600px) {

    .section-main {
        padding: 24px;
        gap: 20px;
    }

    h1 {
        font-size: 26px;
        line-height: 1.2;
    }

    .pretitle {
        font-size: 10px;
    }

    form {
        gap: 12px;
    }

    .field {
        padding: 10px 12px 10px 40px;
    }

    .icon {
        left: 10px;
    }

    .actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    .pop-container {
        width: 95%;
        padding: 1.5rem;
    }

    .group-input-container {
        flex-direction: column;
        gap: 12px;
    }

    .password-strength {
        width: 100%;
    }
}

/* Mobile pequeno (até 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 22px;
        align-self: center;
    }

    .pretitle {
        align-self: center;
        font-size: 9px;
    }

    .label-first-access {
        font-size: 12px;
    }

    .field input {
        font-size: 14px;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.7rem 1rem;
    }

    .pop-container {
        width: 100%;
        padding: 1rem;
        flex-direction: column;
        max-height: 90vh;
        /*  evita estourar a tela */
        overflow-y: auto;
        /*  se ainda passar, rola dentro da caixa */
    }

    .muted {
        font-size: 12px;
    }
}
/* ===== Loading (login e verificação MFA) ===== */

/* Overlay de tela cheia exibido enquanto a requisição está em andamento */
.auth-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;

    background-color: rgba(8, 15, 30, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;

    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-loading-overlay.pop-none {
    opacity: 0;
    visibility: hidden;
}

.auth-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    padding: 2rem 3rem;
    border-radius: 20px;
    text-align: center;

    background: var(--card-grad-1);
    box-shadow: 0 0 0 3px rgba(47, 134, 255, .25);
}

.auth-loading-title {
    color: var(--title);
    font-size: 16px;
    font-weight: 600;
}

.auth-loading-sub {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

/* Spinner */
.auth-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid rgba(47, 134, 255, .2);
    border-top-color: var(--btn-blue-1);
    animation: auth-spin .8s linear infinite;
}

.auth-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
    display: inline-block;
    vertical-align: -3px;
    margin-right: 8px;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Spinner dentro do botão azul precisa contrastar com o fundo */
.btn .auth-spinner-sm {
    border-color: rgba(255, 255, 255, .35);
    border-top-color: #fff;
}

/* Botão em estado de carregamento */
.btn[disabled] {
    cursor: not-allowed;
    opacity: .75;
    filter: none;
}

.btn[disabled]:hover {
    box-shadow: none;
    filter: none;
}

@media (prefers-reduced-motion: reduce) {
    .auth-spinner {
        animation-duration: 2s;
    }
}

@media (max-width: 600px) {
    .auth-loading-box {
        padding: 1.5rem;
        width: 100%;
    }
}
