/* =============================== TOKENS =============================== */
/* Paleta alinhada à home e ao login (home.css / login-client.css). */

:root {
    --bg: #0D1B2A;
    --bg-deep: #11253D;
    --blue: #2563EB;
    --blue-h: #1d4fc0;
    --sky: #6FB6F2;
    --ink: #0D1B2A;
    --ink-mid: #314256;
    --ink-soft: #56697e;
    --fog: #8fa3b8;
    --mist: #b6c5d6;
    --line: #dce4ee;
    --surface: #ffffff;
    --bg-light: #f5f8fc;
}


/* =============================== RESET =============================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
}

body {
    min-height: 100vh;
    font-family: "Montserrat", sans-serif;
    background-color: var(--bg-light);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font-family: inherit;
}

button {
    border: none;
    cursor: pointer;
}

a {
    text-decoration: none;
}


/* =============================== LAYOUT =============================== */

.layout-login {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}


/* =============================== BRANDING =============================== */

.layout-login-brand {
    min-height: 100vh;
    background: linear-gradient(155deg, #0D1B2A 0%, #11253D 58%, #16335a 120%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.layout-login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        rgba(255, 255, 255, 0.06) 0.1rem,
        transparent 0.1rem
    );
    background-size: 3.4rem 3.4rem;
    opacity: 0.6;
}

.layout-login-brand::after {
    content: "";
    position: absolute;
    width: 46rem;
    height: 46rem;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.22);
    filter: blur(9rem);
    top: 34%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.layout-login-brand-content {
    width: min(100%, 46rem);
    position: relative;
    z-index: 2;
}


/* logo (símbolo colorido + texto branco) */

.login-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 3.4rem;
}

.login-brand-logo__mark {
    height: 5rem;
    width: auto;
    display: block;
}

.login-brand-logo__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    line-height: 1;
}

.login-brand-logo__text strong {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #ffffff;
}

.login-brand-logo__text small {
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.36em;
    color: #ffffff;
}


/* selo "Painel administrativo" */

.login-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    height: 3.2rem;
    padding: 0 1.4rem;
    margin-bottom: 2rem;
    border-radius: 999rem;
    background: rgba(111, 182, 242, 0.12);
    border: 1px solid rgba(111, 182, 242, 0.24);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sky);
}

.login-brand-badge svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 2.2;
}


/* texto do branding */

.layout-login-text {
    max-width: 44rem;
}

.component-login-title {
    font-size: clamp(3.2rem, 2.4vw, 4.2rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.05rem;
    color: #ffffff;
    margin-bottom: 2rem;
}

.component-login-title span {
    color: var(--sky);
}

.component-login-description {
    max-width: 42rem;
    font-size: 1.7rem;
    line-height: 1.6;
    font-weight: 400;
    color: var(--mist);
}


/* =============================== ÁREA DO FORMULÁRIO =============================== */

.layout-login-form-area {
    min-height: 100vh;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem;
}

.layout-login-form-box {
    width: min(100%, 43rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2rem;
    box-shadow: 0 3rem 6rem -3rem rgba(13, 27, 42, 0.22);
    padding: 4rem 3.6rem;
}

.layout-login-form-header {
    margin-bottom: 3rem;
}

.component-login-form-title {
    font-size: 2.6rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.05rem;
    color: var(--ink);
    margin-bottom: 0.7rem;
}

.component-login-form-subtitle {
    font-size: 1.45rem;
    line-height: 1.45;
    font-weight: 400;
    color: var(--ink-soft);
}


/* =============================== CAMPOS =============================== */

.component-login-form {
    width: 100%;
}

.component-login-field {
    width: 100%;
    margin-bottom: 1.8rem;
}

.component-login-label {
    display: block;
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 600;
    color: var(--ink-mid);
    margin-bottom: 0.8rem;
}

.component-login-input {
    width: 100%;
    height: 5rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background-color: var(--surface);
    padding: 0 1.6rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.component-login-input::placeholder {
    color: #9aa8ba;
    font-weight: 400;
}

.component-login-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 0.4rem rgba(37, 99, 235, 0.12);
}

.component-login-password-wrapper {
    width: 100%;
    position: relative;
}

.component-login-input-password {
    padding-right: 5rem;
}

.component-login-password-button {
    width: 4.4rem;
    height: 5rem;
    position: absolute;
    top: 0;
    right: 0.3rem;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fog);
    transition: color 0.18s ease;
}

.component-login-password-button:hover {
    color: var(--blue);
}

.component-login-password-button svg {
    width: 1.8rem;
    height: 1.8rem;
    stroke-width: 2;
}


/* =============================== MENSAGEM =============================== */

.component-login-message {
    min-height: 1.6rem;
    margin: 0.6rem 0 0;
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.4;
}

.component-login-message--error {
    color: #dc2626;
}

.component-login-message--success {
    color: #16a34a;
}

.component-login-message--loading {
    color: var(--blue);
}


/* =============================== BOTÕES =============================== */

.button-login-submit {
    width: 100%;
    height: 5.2rem;
    border-radius: 999rem;
    background: var(--blue);
    color: #ffffff;
    font-size: 1.42rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 1.6rem;
    box-shadow: 0 1.2rem 2.4rem -0.8rem rgba(37, 99, 235, 0.6);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.button-login-submit svg {
    width: 1.8rem;
    height: 1.8rem;
    stroke-width: 2.2;
}

.button-login-submit:hover {
    background: var(--blue-h);
    transform: translateY(-0.2rem);
    box-shadow: 0 1.6rem 2.8rem -0.8rem rgba(37, 99, 235, 0.7);
}

.button-login-back {
    position: absolute;
    top: 3rem;
    left: 3rem;
    height: 3.8rem;
    padding: 0 1.5rem;
    border-radius: 999rem;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-mid);
    font-size: 1.3rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.button-login-back svg {
    width: 1.6rem;
    height: 1.6rem;
    stroke-width: 2.2;
}

.button-login-back:hover {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-0.1rem);
}


/* =============================== CHECK INICIAL DE SESSÃO =============================== */
/* Esconde a tela até o JS confirmar que não há sessão admin ativa. */

.auth-check-pending {
    visibility: hidden;
}


/* =============================== HEADER MOBILE =============================== */

.layout-login-mobile-header {
    display: none;
}


/* =============================== RESPONSIVO TABLET =============================== */

@media (max-width: 1024px) {

    .layout-login-brand {
        padding: 4rem 3rem;
    }

    .layout-login-brand-content {
        width: min(100%, 40rem);
    }

    .layout-login-form-box {
        width: min(100%, 40rem);
        padding: 3.4rem 2.8rem;
    }

    .component-login-title {
        font-size: 3.2rem;
    }

    .component-login-description {
        font-size: 1.6rem;
    }

}


/* =============================== RESPONSIVO MOBILE =============================== */

@media (max-width: 768px) {

    .layout-login {
        grid-template-columns: 1fr;
    }

    .layout-login-mobile-header {
        height: 6.4rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1.4rem;
        padding: 0 1.8rem;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .layout-login-mobile-header__logo {
        display: inline-flex;
        align-items: center;
        flex-shrink: 0;
    }

    .layout-login-mobile-header__logo img {
        width: 13rem;
        height: auto;
        display: block;
    }

    .layout-login-mobile-header__back {
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
        height: 3.6rem;
        padding: 0 1.3rem;
        border-radius: 999rem;
        background: var(--surface);
        border: 1px solid var(--line);
        color: var(--ink-mid);
        font-size: 1.3rem;
        font-weight: 600;
        transition: color 0.2s ease, border-color 0.2s ease;
    }

    .layout-login-mobile-header__back svg {
        width: 1.5rem;
        height: 1.5rem;
        stroke-width: 2.2;
    }

    .layout-login-mobile-header__back:hover {
        color: var(--blue);
        border-color: rgba(37, 99, 235, 0.4);
    }

    /* Em mobile, o branding grande e o botão flutuante somem. */
    .layout-login-brand {
        display: none;
    }

    .button-login-back {
        display: none;
    }

    .layout-login-form-area {
        min-height: auto;
        padding: 3.2rem 2rem 5rem;
        display: block;
    }

    .layout-login-form-box {
        width: 100%;
        max-width: 44rem;
        margin: 0 auto;
        padding: 3.2rem 2.4rem;
    }

}


/* =============================== RESPONSIVO MOBILE PEQUENO =============================== */

@media (max-width: 420px) {

    .layout-login-form-area {
        background: var(--surface);
        padding: 2.8rem 1.8rem 4.8rem;
    }

    .layout-login-form-box {
        padding: 0.6rem 0 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .component-login-form-title {
        font-size: 2.4rem;
    }

    .layout-login-mobile-header__logo img {
        width: 11.5rem;
    }

}
