/* Telas de autenticação inspiradas nos frames Login/Cadastro do Figma. */
body #page-login.active,
body #page-cadastro.active {
  display: block !important;
  min-height: 100svh !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #160137 url('/img/auth-background.jpg?v=138') center top / cover no-repeat fixed !important;
  color: #fff;
}

html:has(#page-login.active),
html:has(#page-cadastro.active),
body:has(#page-login.active),
body:has(#page-cadastro.active) { background: #160137; }

.jc-auth-shell {
  width: min(100%, 650px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(38px, 8vh, 104px) 24px 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jc-auth-logo {
  width: min(72vw, 350px);
  height: auto;
  margin: 0 auto clamp(26px, 4vh, 44px);
  filter: drop-shadow(0 10px 12px rgba(36, 0, 75, .52));
  animation: jcAuthEnter .45s cubic-bezier(.2,.8,.2,1) both;
}

.jc-auth-tabs {
  width: min(100%, 438px);
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 1px;
  margin-bottom: clamp(65px, 8vh, 92px);
  border: 1px solid rgba(174, 68, 255, .20);
  border-radius: 17px;
  background: rgba(27, 0, 65, .38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  overflow: hidden;
}

.jc-auth-tab {
  min-height: 60px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  transition: transform .18s ease, filter .18s ease, background .18s ease;
}

.jc-auth-tab:hover { filter: brightness(1.08); }
.jc-auth-tab:active { transform: scale(.98); }
.jc-auth-tab.is-active {
  background: linear-gradient(180deg, #b64cff 0%, #9827f5 100%);
  box-shadow:
    inset 0 8px 8px rgba(255,255,255,.22),
    inset 0 -5px 7px rgba(255,255,255,.16),
    0 8px 17px rgba(80, 3, 152, .42);
}

.jc-auth-card {
  position: relative;
  width: min(100%, 520px);
  padding: 102px 52px 54px;
  border: 1px solid rgba(158, 69, 229, .25);
  border-radius: 30px;
  background: rgba(35, 0, 77, .87);
  box-shadow: 0 28px 70px rgba(8,0,30,.28), inset 0 1px 0 rgba(255,255,255,.02);
  animation: jcAuthEnter .52s .06s cubic-bezier(.2,.8,.2,1) both;
}

#page-login .jc-auth-card {
  min-height: 760px;
  display: flex;
  flex-direction: column;
}
#page-login .jc-auth-form { flex: 1; }
#page-login .jc-auth-submit { margin-top: auto; }

.jc-auth-medal {
  position: absolute;
  top: 0;
  left: 50%;
  width: 145px;
  height: 145px;
  transform: translate(-50%, -51%);
  object-fit: contain;
  filter: drop-shadow(0 11px 0 rgba(110, 44, 0, .16));
}

.jc-auth-title {
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -.035em;
}

.jc-auth-subtitle {
  margin: 22px auto 40px;
  color: #d2c8e5;
  text-align: center;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
}

.jc-auth-subtitle strong { color: #ffdc19; font-weight: 800; }
.jc-auth-form { display: flex; flex-direction: column; gap: 16px; }
.jc-auth-field { display: flex; flex-direction: column; gap: 7px; }
.jc-auth-input-wrap { position: relative; }

.jc-auth-field-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 25px;
  height: 25px;
  transform: translateY(-50%);
  color: #a89bcd;
  pointer-events: none;
}

.jc-auth-input {
  width: 100%;
  height: 66px;
  padding: 0 54px 0 62px;
  border: 1.5px solid rgba(154, 96, 208, .48);
  border-radius: 16px;
  outline: none;
  background: rgba(38, 0, 82, .55);
  color: #fff;
  font: 500 16px/1 'Poppins', sans-serif;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.jc-auth-input::placeholder { color: #a99cc7; opacity: .92; }
.jc-auth-input:focus {
  border-color: #b44cff;
  background: rgba(52, 3, 103, .72);
  box-shadow: 0 0 0 4px rgba(174, 68, 255, .11);
}
.jc-auth-input.error { border-color: #ff6b87; box-shadow: 0 0 0 4px rgba(255,107,135,.1); }
.jc-auth-input.valid { border-color: #69dc74; }
.jc-auth-input.locked { cursor: not-allowed; color: #d7cbed; }

.jc-auth-eye {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #a89bcd;
  cursor: pointer;
}
.jc-auth-eye svg { width: 22px; height: 22px; }
.jc-auth-eye:hover { color: #fff; }
.jc-auth-error { display: none; color: #ff8098; font-size: 12px; font-weight: 600; }

.jc-auth-forgot {
  align-self: flex-end;
  margin-top: 1px;
  border: 0;
  background: transparent;
  color: #b6aacd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.jc-auth-forgot:hover { color: #fff; }

.jc-auth-submit {
  position: relative;
  width: 100%;
  aspect-ratio: 719 / 180;
  min-height: 82px;
  margin-top: 20px;
  padding: 0 28px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  isolation: isolate;
  overflow: visible;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: 400 clamp(22px, 4.2vw, 31px)/1 'Luckiest Guy', cursive;
  letter-spacing: -.01em;
  text-shadow: 2px 3px 0 #a84c05;
  white-space: nowrap;
  transition: transform .16s ease, filter .16s ease;
}

.jc-auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('/img/auth-button.svg?v=138') center / 100% 100% no-repeat;
  filter: drop-shadow(0 11px 14px rgba(17,0,41,.28));
}
.jc-auth-submit:hover:not(:disabled) { transform: translateY(-2px) scale(1.012); filter: brightness(1.04); }
.jc-auth-submit:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.jc-auth-submit:disabled { opacity: .7; cursor: wait; }
.jc-auth-submit svg { width: 22px; height: 22px; filter: drop-shadow(1px 2px 0 #a84c05); }

.jc-auth-footer {
  margin-top: 22px;
  color: #fff;
  text-align: center;
  font-size: 15px;
  line-height: 1.45;
}
.jc-auth-footer a { color: #ffdc19; font-weight: 800; cursor: pointer; }
.jc-auth-footer a:hover { color: #fff15f; }

.jc-auth-back {
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #9d8dbd;
  cursor: pointer;
  font-size: 13px;
}
.jc-auth-back svg { width: 18px; height: 18px; }
.jc-auth-back:hover { color: #fff; }

.jc-auth-strength { display: none; margin-top: 3px; }
.jc-auth-strength-row { display: flex; justify-content: space-between; color: #9f91bb; font-size: 11px; margin-bottom: 5px; }
.jc-auth-strength-track { height: 4px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.1); }
.jc-auth-strength-fill { height: 100%; width: 0; border-radius: inherit; transition: width .3s ease; }
.jc-auth-terms { color: #a99ec0; text-align: center; font-size: 12px; line-height: 1.5; }
.jc-auth-terms strong { color: #ffdc19; }

@keyframes jcAuthEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  body #page-login.active,
  body #page-cadastro.active { background-attachment: scroll !important; }
  .jc-auth-shell { padding: 34px 20px 52px; }
  .jc-auth-logo { width: min(70vw, 280px); margin-bottom: 26px; }
  .jc-auth-tabs { width: min(100%, 386px); min-height: 56px; margin-bottom: 66px; }
  .jc-auth-tab { min-height: 54px; font-size: 15px; }
  .jc-auth-card { padding: 82px 20px 32px; border-radius: 26px; }
  #page-login .jc-auth-card { min-height: 745px; }
  .jc-auth-medal { width: 118px; height: 118px; }
  .jc-auth-title { font-size: 34px; }
  .jc-auth-subtitle { margin: 16px auto 27px; font-size: 14px; }
  .jc-auth-form { gap: 12px; }
  .jc-auth-input { height: 58px; padding-left: 55px; border-radius: 14px; }
  .jc-auth-field-icon { left: 17px; width: 23px; height: 23px; }
  .jc-auth-submit { min-height: 74px; margin-top: 14px; font-size: clamp(20px, 7vw, 28px); padding-inline: 17px; }
  .jc-auth-footer { margin-top: 17px; font-size: 14px; }
}

@media (max-width: 380px) {
  .jc-auth-shell { padding-inline: 20px; }
  .jc-auth-card { padding-inline: 15px; }
  .jc-auth-title { font-size: 29px; white-space: nowrap; }
  .jc-auth-input { padding-left: 50px; padding-right: 45px; font-size: 14px !important; }
  .jc-auth-field-icon { left: 15px; }
  .jc-auth-submit { gap: 6px; padding-inline: 8px; font-size: clamp(17px, 6vw, 21px); }
  .jc-auth-submit svg { width: 18px; height: 18px; }
}

/* Mantém toda a ação principal visível sem rolagem nos celulares comuns. */
@media (max-width: 560px) and (max-height: 950px) {
  .jc-auth-shell {
    min-height: 100svh;
    padding: 16px 20px 18px;
  }
  .jc-auth-logo {
    width: min(53vw, 208px);
    margin-bottom: 10px;
  }
  .jc-auth-tabs {
    width: min(100%, 360px);
    min-height: 46px;
    margin-bottom: 44px;
    border-radius: 14px;
  }
  .jc-auth-tab {
    min-height: 44px;
    border-radius: 13px;
    font-size: 14px;
  }
  .jc-auth-card {
    width: min(100%, 430px);
    padding: 58px 16px 16px;
    border-radius: 23px;
  }
  #page-login .jc-auth-card { min-height: 466px; }
  .jc-auth-medal {
    width: 88px;
    height: 88px;
  }
  .jc-auth-title {
    font-size: 27px;
    line-height: 1.05;
    white-space: nowrap;
  }
  .jc-auth-subtitle {
    margin: 8px auto 13px;
    font-size: 12px;
    line-height: 1.38;
  }
  .jc-auth-form { gap: 7px; }
  .jc-auth-field { gap: 3px; }
  .jc-auth-input {
    height: 46px;
    padding-left: 48px;
    padding-right: 43px;
    border-radius: 12px;
    font-size: 14px !important;
  }
  .jc-auth-field-icon {
    left: 15px;
    width: 21px;
    height: 21px;
  }
  .jc-auth-eye {
    right: 8px;
    width: 34px;
    height: 34px;
  }
  .jc-auth-eye svg { width: 19px; height: 19px; }
  .jc-auth-error { font-size: 10px; }
  .jc-auth-forgot {
    margin-top: 0;
    font-size: 11px;
  }
  .jc-auth-strength { margin-top: 0; }
  .jc-auth-strength-row { margin-bottom: 2px; font-size: 9px; }
  .jc-auth-strength-track { height: 3px; }
  .jc-auth-terms {
    font-size: 9px;
    line-height: 1.3;
  }
  .jc-auth-submit {
    min-height: 57px;
    margin-top: 3px;
    padding: 0 10px 5px;
    gap: 6px;
    font-size: clamp(18px, 5.5vw, 24px);
  }
  .jc-auth-submit svg { width: 18px; height: 18px; }
  .jc-auth-footer {
    margin-top: 8px;
    font-size: 11px;
  }
  .jc-auth-back {
    margin-top: 7px;
    font-size: 10px;
  }
  .jc-auth-back svg { width: 14px; height: 14px; }
}

@media (max-width: 350px) and (max-height: 760px) {
  .jc-auth-shell { padding-top: 10px; }
  .jc-auth-logo { width: 165px; margin-bottom: 7px; }
  .jc-auth-tabs { min-height: 42px; margin-bottom: 38px; }
  .jc-auth-tab { min-height: 40px; }
  .jc-auth-card { padding-top: 51px; padding-bottom: 11px; }
  #page-login .jc-auth-card { min-height: 464px; }
  .jc-auth-medal { width: 78px; height: 78px; }
  .jc-auth-title { font-size: 24px; }
  .jc-auth-subtitle { margin: 6px auto 9px; font-size: 10px; }
  .jc-auth-input { height: 42px; }
  .jc-auth-submit { min-height: 52px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .jc-auth-logo, .jc-auth-card { animation: none; }
  .jc-auth-tab, .jc-auth-submit { transition: none; }
}
