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

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

html {
    font-size: 62.5%;
}

body {
    min-height: 100vh;
    font-family: "Inter", sans-serif;
    background-color: #f7f8fa;
    color: #001f35;
}

button,
input {
    font-family: inherit;
}

button {
    border: none;
    cursor: pointer;
}

a {
    text-decoration: none;
}


/* =============================== PÁGINA DE LOGIN =============================== */

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


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

.layout-login-brand {
    min-height: 100vh;
    background-color: #062234;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        rgba(255, 255, 255, 0.075) 0.08rem,
        transparent 0.08rem
    );
    background-size: 3.6rem 3.6rem;
    opacity: 0.45;
}

.layout-login-brand::after {
    content: "";
    position: absolute;
    width: 42rem;
    height: 42rem;
    border-radius: 50%;
    background: rgba(45, 159, 213, 0.12);
    filter: blur(8rem);
    top: 38%;
    left: 47%;
    transform: translate(-50%, -50%);
}

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

.component-login-logo {
    width: 25rem;
    height: auto;
    display: block;
    margin-bottom: 2rem;
}

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

.component-login-title {
    font-size: clamp(3rem, 2.2vw, 4rem);
    line-height: 1.16;
    font-weight: 600;
    letter-spacing: -0.07rem;
    color: #ffffff;
    margin-bottom: 2.1rem;
}

.component-login-title span {
    font-weight: 600;
    color: #3d9ed0;
}

.component-login-description {
    max-width: 46rem;
    font-size: 1.75rem;
    line-height: 1.55;
    font-weight: 500;
    color: rgba(166, 190, 214, 0.85);
}


/* =============================== FORMULÁRIO =============================== */

.layout-login-form-area {
    min-height: 100vh;
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.layout-login-form-box {
    width: min(100%, 40rem);
    transform: translateY(-0.8rem);
}

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

.component-login-form-title {
    font-size: 2.75rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.05rem;
    color: #001f35;
    margin-bottom: 0.8rem;
}

.component-login-form-subtitle {
    font-size: 1.45rem;
    line-height: 1.4;
    font-weight: 500;
    color: #6b7a90;
}

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

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

.component-login-label {
    display: block;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 700;
    color: #001f35;
    margin-bottom: 1rem;
}

.component-login-input {
    width: 100%;
    height: 4.6rem;
    border: 0.1rem solid #d6dde6;
    border-radius: 0.4rem;
    background-color: #ffffff;
    padding: 0 1.7rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: #001f35;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.component-login-input::placeholder {
    color: #96a3b5;
}

.component-login-input:focus {
    border-color: #3d9ed0;
    box-shadow: 0 0 0 0.3rem rgba(61, 158, 208, 0.14);
}

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

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

.component-login-password-button {
    width: 4.2rem;
    height: 4.6rem;
    position: absolute;
    top: 0;
    right: 0.3rem;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c8ca1;
}

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


/* =============================== LINK CRIAR CONTA =============================== */

.component-login-create-account {
    margin-top: 2.7rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 500;
    color: #6b7a90;
}

.component-login-create-account a {
    color: #1673b9;
    font-weight: 800;
}


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

.button-login-submit {
    width: 100%;
    height: 4.7rem;
    border-radius: 0.4rem;
    background: linear-gradient(90deg, #2c7fba 0%, #55b7cd 100%);
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.8rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

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

.button-login-submit:hover {
    transform: translateY(-0.1rem);
    filter: brightness(1.03);
}

.button-login-back {
    position: absolute;
    top: 3.2rem;
    left: 3.2rem;
    min-height: 3.8rem;
    padding: 0 1.6rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #2c7fba 0%, #55b7cd 100%);
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

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

.button-login-back:hover {
    transform: translateY(-0.1rem);
    filter: brightness(1.03);
}


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

@media (max-width: 1024px) {

    .layout-login-brand-content {
        width: min(100%, 42rem);
        padding: 0 3rem;
    }

    .layout-login-form-box {
        width: min(100%, 38rem);
        padding: 0 2.4rem;
    }

    .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-brand {
        min-height: auto;
        padding: 6rem 2.4rem;
        align-items: flex-start;
    }

    .layout-login-brand-content {
        width: 100%;
        padding: 0;
        transform: none;
    }

    .component-login-logo {
        width: 18rem;
        margin-bottom: 4rem;
    }

    .component-login-title {
        max-width: 42rem;
        font-size: 3rem;
    }

    .component-login-description {
        max-width: 42rem;
        font-size: 1.55rem;
    }

    .layout-login-form-area {
        min-height: auto;
        padding: 8rem 2.4rem 4rem;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .layout-login-form-box {
        width: 100%;
        max-width: 42rem;
        padding: 0;
        transform: none;
    }

    .button-login-back {
        top: 2rem;
        left: 2.4rem;
    }

}


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

@media (max-width: 480px) {

    html {
        font-size: 58%;
    }

    .layout-login-brand {
        padding: 4.8rem 2rem;
    }

    .layout-login-form-area {
        padding: 8rem 2rem 4.8rem;
    }

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

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

    .button-login-back {
        left: 2rem;
    }

}

/* =============================== ESQUECI SENHA =============================== */

.component-login-forgot {
  text-align: right;
  margin-top: -0.8rem;
  margin-bottom: 0.4rem;
}

.component-login-forgot-link {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1673b9;
  transition: opacity 0.15s ease;
}

.component-login-forgot-link:hover {
  opacity: 0.75;
}


/* =============================== MENSAGEM DO LOGIN =============================== */

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

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

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

.component-login-message--loading {
  color: #2563eb;
}


/* =============================== CHECK INICIAL DE SESSÃO =============================== */
/* Esconde a tela até o JS confirmar que não há sessão ativa.
   Previne flash do form caso o cliente já esteja logado (vai direto pro dashboard). */

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


/* =============================== LINK DE ADMINISTRAÇÃO =============================== */

.layout-login-admin-link {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.55rem 1.4rem;
  border-radius: 999rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  transition: color 0.18s ease, background 0.18s ease;
}

.layout-login-admin-link:hover {
  color: #1673b9;
  background: rgba(22, 115, 185, 0.08);
}

@media (max-width: 768px) {
  .layout-login-admin-link {
    position: static;
    transform: none;
    margin-top: 3.6rem;
  }
}


/* =============================== HEADER MOBILE DE LOGIN =============================== */
/* Replica o estilo do header da landing (logo à esquerda, botão Voltar à
   direita). Oculto em desktop — só aparece em <= 768px e substitui o
   branding grande + o botão "Voltar" flutuante. */

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

@media (max-width: 768px) {

    .layout-login-mobile-header {
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1.4rem;
        padding: 0 1.6rem;
        background-color: #062234;
        position: sticky;
        top: 0;
        z-index: 10;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

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

    /* Tamanhos em px porque login usa html { font-size: 62.5% } (1rem = 10px),
       então repetir as medidas da home em rem renderiza menor.
       Os 168px equivalem aos 10.5rem da home (com base 16px). */
    .layout-login-mobile-header__logo img {
        width: 168px;
        height: auto;
        display: block;
    }

    .layout-login-mobile-header__back {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: 6px;
        background: linear-gradient(90deg, #2c7fba 0%, #55b7cd 100%);
        color: #ffffff;
        font-size: 13px;
        font-weight: 700;
        transition: filter 0.2s ease, transform 0.18s ease;
    }

    .layout-login-mobile-header__back svg {
        width: 14px;
        height: 14px;
        stroke-width: 2.4;
    }

    .layout-login-mobile-header__back:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }

    /* Em mobile, o branding grande some — o novo header já tem o logo. */
    .layout-login-brand { display: none; }

    /* O botão Voltar flutuante antigo também — agora vive no header mobile. */
    .button-login-back { display: none; }

    /* Sem botão flutuante, o form-area pode encostar mais perto do header. */
    .layout-login-form-area { padding-top: 3.2rem; }

}

@media (max-width: 420px) {
    .layout-login-mobile-header__logo img { width: 136px; }
}
