html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  padding: 12px;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  --gpm-blue: #1f5285;
  --gpm-blue-2: #2f6ca6;
  --gpm-ink: #10304f;
  --gpm-soft: #d8e0e8;

  background: var(--login-bg) no-repeat center center fixed;
  background-size: cover;

  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--app-height, 100vh);
  min-height: var(--app-height, 100dvh);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  overscroll-behavior-y: none;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(8, 31, 52, 0.42) 0%, rgba(16, 53, 86, 0.28) 38%, rgba(31, 82, 133, 0.22) 70%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(120% 90% at 12% 8%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.04) 50%, rgba(255, 255, 255, 0) 74%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 42% at 84% 88%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(42% 34% at 18% 86%, rgba(47, 108, 166, 0.14) 0%, rgba(47, 108, 166, 0) 74%);
}

body.theme-destaque::before {
  background:
    linear-gradient(145deg, rgba(6, 24, 41, 0.58) 0%, rgba(14, 45, 74, 0.42) 40%, rgba(23, 82, 133, 0.33) 72%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(118% 90% at 10% 6%, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0) 74%);
}

body.theme-destaque::after {
  background:
    radial-gradient(56% 42% at 84% 88%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 74%),
    radial-gradient(46% 38% at 15% 86%, rgba(47, 108, 166, 0.19) 0%, rgba(47, 108, 166, 0) 76%);
}

.login-container {
  width: min(92vw, 390px);
  margin: 10px auto;
  padding: 24px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(160deg, rgba(214, 221, 229, 0.72), rgba(196, 207, 219, 0.68));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 14px 35px rgba(8, 24, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  text-align: center;
  position: relative;
  z-index: 1;
}

body.theme-destaque .login-container {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: linear-gradient(160deg, rgba(221, 230, 239, 0.78), rgba(198, 212, 226, 0.74));
  box-shadow: 0 18px 40px rgba(6, 22, 37, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.logo img {
  width: min(70vw, 220px);
  max-width: 220px;
  margin: 0 auto 8px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35)) brightness(1.1);
  transform: scale(1.14);
  transform-origin: center top;
}

h2 {
  margin: 0 0 10px;
  color: var(--gpm-blue);
  font-size: clamp(17px, 4.3vw, 22px);
  font-weight: 800;
  letter-spacing: 0.2px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  margin: 8px 0;
  border: 1px solid rgba(31, 82, 133, 0.24);
  background: rgba(250, 252, 255, 0.9);
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 16px;
  color: #153a5f;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: rgba(31, 82, 133, 0.52);
  box-shadow: 0 0 0 3px rgba(47, 108, 166, 0.18);
  background: rgba(255, 255, 255, 0.96);
}

button {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  background: linear-gradient(135deg, var(--gpm-blue), var(--gpm-blue-2));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(23, 71, 121, 0.28);
  transition: transform .16s ease, box-shadow .2s ease, filter .2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(23, 71, 121, 0.34);
  filter: saturate(1.07);
}

button:active {
  transform: translateY(0);
}

body.theme-destaque button {
  background: linear-gradient(135deg, #1b5f99, #3179ba);
  box-shadow: 0 12px 25px rgba(15, 58, 99, 0.36);
}

.whatsapp-contato {
  margin-top: -22px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gpm-blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.whatsapp-contato i {
  font-size: 15px;
}

.footer {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(16, 48, 79, 0.72);
}

.propaganda {
  margin-top: 9px;
  font-size: 12px;
  color: var(--gpm-blue);
}

.propaganda a {
  color: var(--gpm-blue);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 82, 133, 0.55);
}

.visual-toggle {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.visual-btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(31, 82, 133, 0.32);
  background: rgba(255, 255, 255, 0.65);
  color: #1d4f81;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.visual-btn:hover {
  transform: none;
  filter: none;
  background: rgba(255, 255, 255, 0.9);
}

.visual-btn.is-active {
  background: #1f5285;
  color: #fff;
  border-color: #1f5285;
}

@media (max-width: 820px) {
  body {
    padding: 0;
    align-items: stretch;
    background: linear-gradient(180deg, rgba(13, 48, 76, 0.92), rgba(13, 48, 76, 0.88)), var(--login-bg) no-repeat center center;
    background-size: cover;
  }

  body::before {
    background:
      linear-gradient(180deg, rgba(7, 29, 49, 0.54), rgba(15, 49, 79, 0.42)),
      radial-gradient(100% 62% at 50% 0%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 74%);
  }

  body::after {
    background:
      radial-gradient(58% 45% at 84% 86%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 74%),
      radial-gradient(45% 35% at 16% 88%, rgba(47, 108, 166, 0.15) 0%, rgba(47, 108, 166, 0) 76%);
  }

  body.theme-destaque::before {
    background:
      linear-gradient(180deg, rgba(6, 25, 42, 0.66), rgba(13, 44, 72, 0.52)),
      radial-gradient(100% 64% at 50% 0%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 74%);
  }

  body.theme-destaque::after {
    background:
      radial-gradient(60% 48% at 84% 86%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 74%),
      radial-gradient(47% 36% at 16% 88%, rgba(47, 108, 166, 0.2) 0%, rgba(47, 108, 166, 0) 76%);
  }

  .login-container {
    width: 100%;
    min-height: var(--app-height, 100vh);
    min-height: var(--app-height, 100dvh);
    max-width: none;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(160deg, rgba(214, 221, 229, 0.88), rgba(196, 207, 219, 0.84));
    padding: max(22px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .logo img {
    width: min(64vw, 210px);
    max-width: 210px;
    margin-bottom: 6px;
    transform: scale(1.14);
  }

  h2 {
    margin-bottom: 14px;
    font-size: 28px;
    line-height: 1.15;
  }

  input[type="text"],
  input[type="password"],
  button {
    min-height: 54px;
    border-radius: 10px;
    font-size: 17px;
  }

  .whatsapp-contato {
    font-size: 20px;
    margin-top: -24px;
    margin-bottom: 8px;
  }

  .whatsapp-contato i {
    font-size: 20px;
  }

  .footer,
  .propaganda {
    font-size: 15px;
  }

  .visual-btn {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 13px;
  }
}

@media (min-width: 821px) {
  body {
    padding: 20px;
  }

  .login-container {
    width: min(94vw, 400px);
    padding: 28px 24px;
  }

  .logo img {
    width: min(38vw, 240px);
    max-width: 240px;
    margin-bottom: 10px;
    transform: scale(1.14);
  }
}
