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

:root {
  --green: #3cb554;
  --green-d: #2a8a3e;
  --green-l: #5cd974;
  --gold-l: #f0c84a;
  --gold: #d4a832;
  --text: #e8f5ea;
  --muted: #8ab890;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Nunito', sans-serif;
  background: #04120a;
  color: var(--text);
}

/* ── FUNDO desktop ── */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('images/bg-login.png') center center / 100% auto no-repeat;
}

/* ── CENA ── */
.scene {
  position: relative;
  z-index: 5;
  width: 100vw;
  height: 100vh;
}

/* ── FORM BOX desktop: posicionado sobre a imagem ── */
.form-box {
  position: absolute;
  left: 28%;
  right: 28%;
  top: 43%;
  bottom: 5%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  overflow: hidden;
}

/* ═══ LOGIN CARD ═══ */
#loginCard {
  width: 100%;
  display: grid;
  grid-template-columns: 38% 62%;
  gap: 0;
  align-items: center;
}

.lc-left {
  padding-right: 22px;
  border-right: 1px solid rgba(180, 140, 40, .3);
}

.welcome-tag {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--gold-l);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.welcome-sub {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}

.dragon-ghost {
  font-size: 52px;
  opacity: .07;
  margin-top: 8px;
  line-height: 1;
  user-select: none;
}

.lc-right { padding-left: 22px; }

/* ── CAMPOS ── */
.fg { margin-bottom: 9px; }

.fl {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}

.fw { position: relative; }

.fi-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(100, 160, 110, .5);
  display: flex;
  pointer-events: none;
}

.fi {
  width: 100%;
  background: rgba(5, 20, 8, .65);
  border: 1px solid rgba(60, 181, 84, .28);
  border-radius: 7px;
  padding: 8px 30px 8px 28px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 12.5px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.fi:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(60, 181, 84, .13);
}

.fi::placeholder { color: rgba(100, 160, 110, .35); }

.feye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(100, 160, 110, .5);
  display: flex;
  padding: 2px;
  transition: color .18s;
}
.feye:hover { color: var(--text); }

.forgot {
  display: block;
  text-align: right;
  font-size: 10.5px;
  color: var(--green-l);
  margin-top: 2px;
  text-decoration: none;
  opacity: .85;
}
.forgot:hover { opacity: 1; text-decoration: underline; }

/* ── BOTÃO ── */
.btn-enter {
  width: 100%;
  margin-top: 9px;
  padding: 10px;
  background: linear-gradient(135deg, #1e7a2e, var(--green));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 3px 14px rgba(30, 122, 46, .5);
  transition: filter .2s, transform .15s;
}
.btn-enter:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-enter:active { transform: translateY(0); }
.btn-enter:disabled { opacity: .5; cursor: not-allowed; }

/* ── DIVISOR ── */
.div-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 9px 0 7px;
  font-size: 10.5px;
  color: var(--muted);
}
.div-line { flex: 1; height: 1px; background: rgba(60, 181, 84, .18); }

/* ── SSO ── */
.sso { display: flex; gap: 8px; margin-bottom: 9px; }
.sso-btn {
  flex: 1;
  padding: 7px;
  border-radius: 7px;
  background: rgba(5, 20, 8, .55);
  border: 1px solid rgba(60, 181, 84, .22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .18s, background .18s;
}
.sso-btn:hover { border-color: rgba(60, 181, 84, .5); background: rgba(60, 181, 84, .08); }

/* ── CRIAR CONTA ── */
.create { text-align: center; font-size: 11px; color: var(--muted); }
.create a { color: var(--green-l); text-decoration: none; font-weight: 700; }
.create a:hover { text-decoration: underline; }

/* ═══ CADASTRO CARD ═══ */
#regCard { display: none; width: 100%; }

.rg {
  display: grid;
  grid-template-columns: 36% 64%;
  gap: 0;
  align-items: start;
}

.rg-left {
  padding-right: 20px;
  border-right: 1px solid rgba(180, 140, 40, .25);
}

.rg-title { font-size: 13px; font-weight: 800; color: var(--gold-l); margin-bottom: 5px; }
.rg-sub { font-size: 11px; color: var(--muted); line-height: 1.55; }

.quote {
  margin-top: 10px;
  padding: 7px 9px;
  background: rgba(60, 181, 84, .07);
  border-left: 3px solid var(--green);
  border-radius: 5px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

.rg-right { padding-left: 20px; }

.f2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 300;
  background: rgba(3, 14, 6, .97);
  border: 1px solid rgba(180, 140, 40, .65);
  border-radius: 10px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  max-width: 90vw;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* ══════════════════════════════════════════
   TABLET (≤860px) — colapsa colunas, card flutuante
══════════════════════════════════════════ */
@media (max-width: 860px) {
  html, body { overflow: auto; }

  .scene {
    height: auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bg { background-size: cover; }

  .form-box {
    position: relative;
    left: auto; right: auto; top: auto; bottom: auto;
    width: 92%;
    max-width: 500px;
    padding: 22px 20px;
    margin: 48px auto 40px;
    background: rgba(4, 14, 7, 0.85);
    border: 1px solid rgba(180, 140, 40, .35);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
    overflow: visible;
  }

  #loginCard, .rg { grid-template-columns: 1fr; }

  .lc-left {
    border-right: none;
    border-bottom: 1px solid rgba(180, 140, 40, .2);
    padding-right: 0;
    padding-bottom: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .dragon-ghost { display: none; }
  .lc-right { padding-left: 0; }

  .rg-left {
    border-right: none;
    border-bottom: 1px solid rgba(180, 140, 40, .2);
    padding-right: 0;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .rg-right { padding-left: 0; }
}

/* ══════════════════════════════════════════
   MOBILE (≤540px) — fundo-cell.png, scroll natural
══════════════════════════════════════════ */
@media (max-width: 540px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
  }

  .bg {
    background-image: url('images/fundo-cell.png');
    background-size: cover;
    background-position: top center;
    background-attachment: fixed;
  }

  .scene {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 38vh;
    padding-bottom: 24px;
  }

  .form-box {
    position: relative;
    left: auto; right: auto; top: auto; bottom: auto;
    width: 54vw;
    max-width: 220px;
    min-height: unset;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0 4px;
    margin: 0;
    display: block;
    overflow: visible;
    z-index: 10;
  }

  .lc-left { display: none; }
  .rg-left { display: none; }

  #loginCard, .rg {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .lc-right { padding-left: 0; }
  .rg-right { padding-left: 0; }

  .f2 { grid-template-columns: 1fr; gap: 0; }

  .fl { font-size: 9px; letter-spacing: 0; margin-bottom: 2px; }

  .fi {
    font-size: 12px;
    padding: 7px 26px 7px 24px;
    background: rgba(2, 12, 5, 0.82);
    border-color: rgba(60, 181, 84, .4);
  }

  .fg { margin-bottom: 5px; }

  .btn-enter {
    font-size: 11px;
    padding: 9px;
    letter-spacing: 1px;
    margin-top: 6px;
  }

  .div-row { font-size: 9px; margin: 5px 0 4px; }
  .sso-btn { padding: 6px; }
  .create { font-size: 10px; }
  .forgot { font-size: 9.5px; }

  .toast { bottom: 12px; font-size: 11px; padding: 8px 12px; }
}

/* ══════════════════════════════════════════
   MOBILE PEQUENO (≤390px)
══════════════════════════════════════════ */
@media (max-width: 390px) {
  .scene { padding-top: 35vh; }
  .form-box { width: 52vw; max-width: 200px; }
  .fi { font-size: 11px; }
  .btn-enter { font-size: 11px; padding: 8px; }
}

@media (max-width: 360px) {
  .scene { padding-top: 33vh; }
  .form-box { width: 50vw; max-width: 185px; }
}