@import url("https://cdn.jsdelivr.net/npm/@fontsource/junction/index.css");

@font-face {
  font-family: miso-regular;
  src:
    local("☺"),
    url(../fonts/miso-regular.woff) format("woff"),
    url(../fonts/miso-regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
}

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

body {
  font-family: "miso-regular", Verdana, Tahoma;
  min-height: 100vh;
}

/* Background com overlay verde */
.login-bg {
  min-height: 100vh;
  background-image: url("../contents/back-login-contador.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
  position: relative;
}

.login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(90, 200, 80, 0.42);
}

/* Wrapper: card + link abaixo */
.login-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Card branco */
.login-card {
  position: relative;
  background: #ffffff;
  width: 488px;
  border: 4px solid #efefef;
  border-radius: 5px;
  padding: 131px 20px 40px;
  font-size: 28px;
  display: flex;
  flex-direction: column;
}

/* Logo posicionada dentro do padding superior */
.login-logo {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-img {
  height: 90px;
  max-width: 260px;
  object-fit: contain;
}

/* Divisor */
.login-divider {
  border: none;
  border-top: 3px solid #e0e0e0;
  margin: 0 -20px 26px -20px;
}

/* Campos */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 16px;
  font-family: "miso-regular", Verdana, Tahoma;
  color: #777;
  margin-bottom: 5px;
}

/* Evita estilo vermelho de validação nativa do browser */
.form-group input:invalid {
  box-shadow: none;
}

.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  border: 3px solid #efefef;
  padding: 9px 10px;
  font-size: 16px;
  font-family: inherit;
  color: rgba(0, 0, 0, 0.75);
  outline: none;
  transition: border-color 0.2s;
  border-radius: 5px;
}

.form-group input:focus {
  border-color: #38b0f8;
}

/* Linha de ações — empurrada para o fundo do card */
.login-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 30px;
}

.form-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn-entrar {
  background-color: #5a9a2c;
  color: #ffffff;
  border: none;
  width: 185.625px;
  height: 41px;
  padding-top: 9px;
  padding-bottom: 0;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.btn-entrar:hover {
  background-color: #4a8020;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 174px;
  flex: none;
  font-size: 13px;
  line-height: 18px;
  color: #555;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  padding: 15px 12px;
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  accent-color: #5a9a2c;
  cursor: pointer;
}

/* Link esqueci a senha — fora do card */
.forgot-link {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  font-family: "miso-regular", Verdana, Tahoma;
  color: #ffffff;
  text-decoration: none;
  text-align: center;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* =============================================
   RESPONSIVIDADE MOBILE
   ============================================= */
@media (max-width: 540px) {
  .login-bg {
    padding-top: 20px;
    padding-bottom: 20px;
    align-items: flex-start;
  }

  .login-wrapper {
    width: 100%;
    padding: 0 12px;
  }

  .login-card {
    width: 100%;
    border-radius: 5px;
    padding: 110px 16px 36px;
  }

  .login-logo-img {
    height: 70px;
  }

  .login-divider {
    margin: 0 -16px 20px -16px;
  }

  .login-form {
    padding: 0 8px;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-entrar {
    width: 100%;
    height: 44px;
  }

  .remember-label {
    width: 100%;
    justify-content: center;
  }

  .forgot-link {
    font-size: 14px;
    padding: 0 12px;
    text-align: center;
  }
}
