/* ==================================================
   BLOCKDEAF - AUTH
   Login / Register / Forgot
================================================== */

:root {
  --auth-page-bg: #dfe7ef;

  --auth-container-radius: 20px;
  --auth-container-width: min(1460px, calc(100vw - 64px));
  --auth-container-height: min(860px, calc(100vh - 64px));

  --auth-panel-bg: rgba(247, 248, 250, 0.97);
  --auth-panel-shadow: -20px 0 60px rgba(0, 0, 0, 0.08);

  --auth-text: #111111;
  --auth-muted: #8e96a3;

  --auth-input-bg: #dde2e8;
  --auth-input-text: #3a3f47;
  --auth-input-placeholder: #a0a7b2;

  --auth-primary: #f6e327;
  --auth-primary-hover: #eedc16;
  --auth-primary-text: #111111;

  --auth-link: #d9b800;
  --auth-divider: #cfd5dc;

  --auth-error-bg: #fff1f1;
  --auth-error-border: #ffcfcf;
  --auth-error-text: #a02323;

  --auth-success-bg: #eafcf1;
  --auth-success-border: #c6efd4;
  --auth-success-text: #157347;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", Arial, sans-serif;
  color: var(--auth-text);
  background:
    radial-gradient(circle at 18% 18%, rgba(246, 227, 39, 0.10), transparent 25%),
    radial-gradient(circle at 82% 80%, rgba(130, 150, 175, 0.14), transparent 28%),
    var(--auth-page-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow-x: hidden;
}

/* ==================================================
   CONTAINER CENTRAL
================================================== */

.auth-bg {
  width: var(--auth-container-width);
  height: var(--auth-container-height);
  min-height: 700px;
  border-radius: var(--auth-container-radius);
  background-image:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.02) 55%,
      rgba(0, 0, 0, 0.03) 100%
    ),
    var(--auth-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: 0 28px 90px rgba(37, 45, 55, 0.16);
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  position: relative;
}

/* ==================================================
   PAINEL DIREITO
   Desktop: 50% do container
================================================== */

.auth-side-panel {
  width: 50%;
  height: 100%;
  margin-left: auto;
  background: var(--auth-panel-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--auth-panel-shadow);
  border-radius: 20px 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 44px;
  position: relative;
  animation: panelEnter 0.7s ease both;
}

.auth-side-panel.is-switching {
  animation: panelSwitch 0.6s ease both;
}

.auth-panel-content {
  width: 100%;
  max-width: 430px;
}

/* ==================================================
   TEXTOS
================================================== */

.auth-title {
  text-align: center;
  margin-bottom: 28px;
}

.auth-title h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #111111;
}

.auth-title p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.65;
}

/* ==================================================
   ALERTAS
================================================== */

.auth-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.auth-alert.error {
  background: var(--auth-error-bg);
  border: 1px solid var(--auth-error-border);
  color: var(--auth-error-text);
}

.auth-alert.success {
  background: var(--auth-success-bg);
  border: 1px solid var(--auth-success-border);
  color: var(--auth-success-text);
}

/* ==================================================
   VIEWS
================================================== */

.auth-view {
  display: none;
  opacity: 0;
  transform: translateX(18px);
}

.auth-view.is-active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.auth-view.is-leaving {
  display: block;
  animation: authViewLeave 0.22s ease both;
}

.auth-view.is-entering {
  display: block;
  animation: authViewEnter 0.26s ease both;
}

/* ==================================================
   FORM
================================================== */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-field label {
  display: block;
  margin-bottom: 9px;
  color: #757d87;
  font-size: 15px;
  font-weight: 800;
}

.auth-input-wrap {
  position: relative;
}

.auth-field input,
.auth-field select {
  width: 100%;
  height: 54px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--auth-input-bg);
  color: var(--auth-input-text);
  padding: 0 48px 0 18px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.auth-field input::placeholder,
.auth-field select::placeholder {
  color: var(--auth-input-placeholder);
}

.auth-field input:focus,
.auth-field select:focus {
  background: #ffffff;
  border-color: rgba(246, 227, 39, 0.9);
  box-shadow: 0 0 0 4px rgba(246, 227, 39, 0.18);
  transform: translateY(-1px);
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  width: 30px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 16px;
  color: #7e8894;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-password-toggle:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #111111;
}

/* ==================================================
   LINKS / TEXTS
================================================== */

.auth-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: -2px;
}

.auth-link {
  color: var(--auth-link);
  font-weight: 800;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: #111111;
}

.auth-link-button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.auth-under-text {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-under-text .auth-link,
.auth-under-text .auth-link-button {
  margin-left: 4px;
}

.auth-back-button {
  border: 0;
  background: transparent;
  padding: 0;
  margin-bottom: 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #8a92a0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-back-button:hover {
  color: #111111;
  transform: translateX(-3px);
}

/* ==================================================
   BOTÃO PRINCIPAL
================================================== */

.auth-submit {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 10px;
  background: var(--auth-primary);
  color: var(--auth-primary-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-top: 2px;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
  box-shadow: 0 12px 26px rgba(246, 227, 39, 0.25);
}

.auth-submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.7),
    transparent
  );
  transform: skewX(-25deg);
  transition: left 0.7s ease;
}

.auth-submit:hover {
  background: var(--auth-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(246, 227, 39, 0.32);
}

.auth-submit:hover::before {
  left: 140%;
}

.auth-submit:active {
  transform: translateY(0);
}

/* ==================================================
   DIVISOR
================================================== */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 20px;
  color: #a8b0bb;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-divider);
}

/* ==================================================
   BOTÕES SOCIAIS
================================================== */

.auth-socials {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.auth-social {
  width: 100%;
  height: 46px;
  border: 1px solid #cdd4db;
  border-radius: 12px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  text-decoration: none;
  color: #6f7883;
  font-size: 13px;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.auth-social:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: #bcc4cd;
}

.auth-social-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}

.auth-social-icon--google {
  background: #ffffff;
  color: #db4437;
  border: 1px solid #e2e6eb;
}

.auth-social-icon--facebook {
  background: #1877f2;
  color: #ffffff;
}

/* ==================================================
   RODAPÉ
================================================== */

.auth-bottom {
  margin-top: 42px;
  text-align: center;
  color: #7f8893;
  font-size: 14px;
}

.auth-admin {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
}

.auth-admin a {
  color: #8b94a0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-admin a:hover {
  color: #111111;
}

/* ==================================================
   BOTÃO TEMPORÁRIO PARA ZERAR CACHE
================================================== */

.auth-cache-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.auth-cache-button:hover {
  background: #f6e327;
  color: #111111;
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.auth-cache-button:active {
  transform: translateY(0);
}

/* ==================================================
   REVEAL
================================================== */

.auth-reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.55s ease forwards;
}

.auth-reveal:nth-child(1) { animation-delay: 0.04s; }
.auth-reveal:nth-child(2) { animation-delay: 0.10s; }
.auth-reveal:nth-child(3) { animation-delay: 0.16s; }
.auth-reveal:nth-child(4) { animation-delay: 0.22s; }
.auth-reveal:nth-child(5) { animation-delay: 0.28s; }
.auth-reveal:nth-child(6) { animation-delay: 0.34s; }

/* ==================================================
   ANIMAÇÕES
================================================== */

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateX(70px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes panelSwitch {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  40% {
    opacity: 0;
    transform: translateX(60px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================================================
   RESPONSIVO
================================================== */

/* Tablet e mobile */
@media (max-width: 900px) {
  body.auth-page {
    padding: 0;
    min-height: 100dvh;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  .auth-bg {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.04) 0%,
        rgba(0, 0, 0, 0.12) 48%,
        rgba(0, 0, 0, 0.28) 100%
      );
    pointer-events: none;
    z-index: 1;
  }

  .auth-side-panel {
    width: 100%;
    height: 60dvh;
    min-height: 60dvh;
    max-height: 60dvh;
    border-radius: 24px 24px 0 0;
    padding: 26px 24px;
    box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.22);
    align-items: flex-start;
    overflow-y: auto;
    position: relative;
    z-index: 2;
    animation: panelMobileEnter 0.7s ease both;
  }

  .auth-side-panel.is-switching {
    animation: panelMobileSwitch 0.6s ease both;
  }

  .auth-panel-content {
    max-width: 520px;
    margin: 0 auto;
    padding-bottom: 24px;
  }

  .auth-title {
    margin-bottom: 20px;
  }

  .auth-title h1 {
    font-size: 25px;
  }

  .auth-title p {
    font-size: 13px;
    line-height: 1.45;
  }

  .auth-form {
    gap: 14px;
  }

  .auth-field label {
    font-size: 13px;
    margin-bottom: 7px;
  }

  .auth-field input,
  .auth-field select {
    height: 48px;
    font-size: 14px;
  }

  .auth-submit {
    height: 50px;
    font-size: 15px;
  }

  .auth-under-text {
    margin-top: 10px;
    font-size: 13px;
  }

  .auth-divider {
    margin: 20px 0 14px;
  }

  .auth-socials {
    gap: 10px;
  }

  .auth-social {
    height: 42px;
    font-size: 12px;
  }

  .auth-bottom {
    margin-top: 24px;
    font-size: 12px;
  }

  .auth-admin {
    font-size: 12px;
  }

  .auth-cache-button {
    right: 12px;
    bottom: 12px;
    height: 38px;
    padding: 0 13px;
    font-size: 11px;
  }
}

/* Celulares menores */
@media (max-width: 520px) {
  .auth-bg {
    background-position: center top;
  }

  .auth-side-panel {
    height: 60dvh;
    min-height: 60dvh;
    max-height: 60dvh;
    padding: 24px 18px;
    border-radius: 22px 22px 0 0;
  }

  .auth-title h1 {
    font-size: 23px;
  }

  .auth-title p {
    font-size: 12px;
  }

  .auth-field input,
  .auth-field select {
    height: 46px;
  }

  .auth-submit {
    height: 48px;
  }

  .auth-social {
    height: 40px;
  }
}

/* Celulares muito baixos */
@media (max-height: 720px) and (max-width: 900px) {
  .auth-side-panel {
    height: 60dvh;
    min-height: 60dvh;
    max-height: 60dvh;
  }

  .auth-title {
    margin-bottom: 16px;
  }

  .auth-form {
    gap: 12px;
  }

  .auth-divider {
    margin: 16px 0 12px;
  }

  .auth-bottom {
    margin-top: 18px;
  }
}

/* ==================================================
   ANIMAÇÕES MOBILE
================================================== */

@keyframes panelMobileEnter {
  from {
    opacity: 0;
    transform: translateY(90px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelMobileSwitch {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  42% {
    opacity: 0;
    transform: translateY(60px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}