html,
body {
  overflow-x: hidden;
}

/* =========================================
   AUTH THEME TOKENS
========================================= */

.auth-page {
  --auth-bg: #080914;
  --auth-bg-soft: #111827;

  --auth-card: rgba(255, 255, 255, 0.94);
  --auth-card-text: #111827;
  --auth-card-muted: #6b7280;

  --auth-brand-text: #ffffff;
  --auth-brand-muted: rgba(255, 255, 255, 0.72);

  --auth-border: rgba(255, 255, 255, 0.14);

  --auth-primary: #0bc28c;
  --auth-primary-dark: #09a979;
  --auth-secondary: #1edd7f;

  --auth-glass: rgba(255, 255, 255, 0.12);
  --auth-glass-hover: rgba(255, 255, 255, 0.18);

  --auth-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);

  min-height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;

  position: relative;
  overflow: hidden;

  background:
    linear-gradient(135deg, var(--auth-bg), var(--auth-bg-soft));

  color: var(--auth-brand-text);
}

/* Tema claro apenas para login/cadastro */

html.theme-light .auth-page,
body.theme-light .auth-page {
  --auth-bg: #f4f7fb;
  --auth-bg-soft: #dff7ee;

  --auth-card: rgba(255, 255, 255, 0.96);
  --auth-card-text: #111827;
  --auth-card-muted: #64748b;

  --auth-brand-text: #111827;
  --auth-brand-muted: #64748b;

  --auth-border: rgba(15, 23, 42, 0.08);

  --auth-glass: rgba(255, 255, 255, 0.58);
  --auth-glass-hover: rgba(255, 255, 255, 0.72);

  --auth-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

/* Tema escuro apenas para login/cadastro */

html.theme-dark .auth-page,
body.theme-dark .auth-page {
  --auth-bg: #080914;
  --auth-bg-soft: #111827;

  --auth-card: rgba(16, 24, 39, 0.94);
  --auth-card-text: #f9fafb;
  --auth-card-muted: #9ca3af;

  --auth-brand-text: #ffffff;
  --auth-brand-muted: rgba(255, 255, 255, 0.72);

  --auth-border: rgba(255, 255, 255, 0.12);

  --auth-glass: rgba(255, 255, 255, 0.10);
  --auth-glass-hover: rgba(255, 255, 255, 0.16);

  --auth-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.auth-page::before {
  content: "";

  position: absolute;
  inset: -30%;

  background:
    radial-gradient(circle at 20% 25%, rgba(11, 194, 140, 0.35), transparent 32%),
    radial-gradient(circle at 70% 65%, rgba(30, 221, 127, 0.28), transparent 34%),
    radial-gradient(circle at 50% 10%, rgba(9, 189, 149, 0.18), transparent 30%);

  filter: blur(10px);

  z-index: 0;
}

.auth-container {
  width: 100%;
  max-width: 1600px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 50px;

  z-index: 1;
}

.auth-brand,
.auth-card {
  position: relative;
  z-index: 1;
}

/* =========================================
   BRAND
========================================= */

.auth-brand {
  color: var(--auth-brand-text);

  max-width: 680px;
}

.brand-badge,
.auth-chip {
  display: inline-flex;
  align-items: center;

  width: fit-content;

  border-radius: 999px;

  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-badge {
  padding: 10px 16px;

  margin-bottom: 28px;

  color: #ffffff;

  background: var(--auth-glass);

  border: 1px solid var(--auth-border);

  backdrop-filter: blur(16px);
}

.auth-brand h1 {
  margin: 0;

  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.auth-brand h1 span {
  display: block;

  line-height: 1.12;
  margin-top: -0.22em;
  padding-bottom: .08em;

  background:
    linear-gradient(135deg,
      var(--auth-primary),
      var(--auth-secondary));

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand p {
  max-width: 560px;

  margin: 26px 0 0;

  color: var(--auth-brand-muted);

  font-size: 1.12rem;
  line-height: 1.7;

  font-weight: 700;
}

html.theme-light .brand-badge,
body.theme-light .brand-badge {
  color: #047857;

  background: rgba(255, 255, 255, 0.68);

  border: 1px solid rgba(15, 23, 42, 0.08);
}

/* =========================================
   AUTH PREVIEW
========================================= */

.auth-preview-card {
  margin-top: 36px;

  width: fit-content;
  min-width: 340px;

  display: flex;
  align-items: center;

  gap: 14px;

  padding: 16px;

  border-radius: 22px;

  color: #ffffff;

  background: var(--auth-glass);

  border: 1px solid var(--auth-border);

  backdrop-filter: blur(18px);

  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
}

.preview-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;

  display: grid;
  place-items: center;

  border-radius: 18px;

  color: #ffffff;

  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;

  background:
    radial-gradient(circle at 30% 25%,
      rgba(255, 255, 255, 0.35),
      transparent 28%),
    linear-gradient(135deg,
      var(--auth-primary),
      var(--auth-secondary));

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(11, 194, 140, 0.28);

  transition:
    transform .2s ease,
    box-shadow .2s ease;
}

.preview-avatar:hover {
  transform: translateY(-2px) scale(1.03);
}

.auth-preview-content {
  min-width: 0;

  text-align: left;
}

.auth-preview-card strong,
.auth-preview-card span,
.auth-preview-content strong,
.auth-preview-content span {
  display: block;

  overflow-wrap: anywhere;
}

.auth-preview-card strong {
  color: #ffffff;
}

.auth-preview-card span {
  margin-top: 4px;

  color: rgba(255, 255, 255, 0.65);

  font-size: 0.84rem;
}

html.theme-light .auth-preview-card,
body.theme-light .auth-preview-card {
  color: #111827;

  background: rgba(255, 255, 255, 0.66);

  border: 1px solid rgba(15, 23, 42, 0.08);

  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.12);
}

html.theme-light .auth-preview-card strong,
body.theme-light .auth-preview-card strong {
  color: #111827;
}

html.theme-light .auth-preview-card span,
body.theme-light .auth-preview-card span {
  color: #64748b;
}

/* =========================================
   AUTH CARD
========================================= */

.auth-card {
  width: 100%;
  max-width: 460px;

  justify-self: center;

  padding: 36px;

  border-radius: var(--radius-lg);

  background: var(--auth-card);

  color: var(--auth-card-text);

  box-shadow: var(--auth-shadow);
}

.auth-card-header {
  margin-bottom: 26px;
}

.auth-chip {
  padding: 8px 12px;

  margin-bottom: 14px;

  color: var(--auth-primary-dark);

  background: rgba(11, 194, 140, 0.12);
}

.auth-card h2 {
  margin: 0;

  color: var(--auth-card-text);

  font-size: 2rem;
  letter-spacing: -0.04em;
}

.auth-card p {
  margin: 8px 0 0;

  color: var(--auth-card-muted);
}

.auth-card .form-group {
  margin-bottom: 18px;
}

.auth-card .form-group:nth-child(2) {
  margin-bottom: 0;
}

.auth-card .form-group:has(#password-feedback) {
  margin-bottom: 14px;
}

.auth-footer-text {
  text-align: center;

  font-size: 0.94rem;

  margin-top: 22px !important;
}

.auth-footer-text a {
  color: var(--auth-primary);

  font-weight: 900;
}

/* =========================================
   LINKS
========================================= */

.auth-forgot-link {
  margin: -6px 0 18px;

  text-align: right;
}

.auth-forgot-link a {
  color: var(--auth-primary);

  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

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

/* =========================================
   FIELD FEEDBACK
========================================= */

.field-feedback {
  display: block;

  min-height: 18px;

  margin-top: 8px;

  font-size: 0.82rem;
  font-weight: 800;
}

.field-feedback:empty {
  min-height: 8px;
}

.field-feedback.is-valid {
  color: var(--auth-primary);
}

.field-feedback.is-invalid {
  color: #ef4444;
}

/* =========================================
   TOP BUTTONS
========================================= */

.auth-theme-toggle {
  position: absolute;
  top: 22px;
  right: 22px;

  z-index: 5;
}

.auth-theme-toggle .theme-toggle {
  width: 44px;
  height: 44px;

  padding: 0;

  border: 1px solid var(--auth-border);
  border-radius: 999px;

  background: var(--auth-glass);

  backdrop-filter: blur(14px);

  display: grid;
  place-items: center;

  cursor: pointer;

  transition:
    transform .2s ease,
    background .2s ease;
}

.auth-theme-toggle .theme-toggle:hover {
  transform: translateY(-2px);

  background: var(--auth-glass-hover);
}

.auth-theme-toggle .theme-icon {
  width: 19px;
  height: 19px;

  filter: brightness(0) invert(1);
}

.auth-home-link {
  position: absolute;
  top: 22px;
  left: 22px;

  z-index: 5;

  display: grid;
  place-items: center;

  cursor: pointer;

  width: 44px;
  height: 44px;

  border-radius: 999px;

  color: #ffffff;

  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;

  background: var(--auth-glass);

  border: 1px solid var(--auth-border);

  backdrop-filter: blur(14px);

  transition:
    transform .2s ease,
    background .2s ease;
}

.auth-home-link:hover {
  transform: translateY(-2px);

  background: var(--auth-glass-hover);
}

.auth-home-link img {
  width: 28px;
  height: 28px;

  object-fit: contain;

  border-radius: 8px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 920px) {
  .auth-page {
    min-height: 100dvh;

    padding: 82px 28px 28px;

    align-items: flex-start;

    overflow-x: hidden;
    overflow-y: visible;
  }

  .auth-container {
    width: 100%;

    flex-direction: column;

    justify-content: flex-start;
    align-items: center;

    gap: 36px;
  }

  .auth-brand {
    max-width: 680px;

    text-align: center;

    margin: 0 auto;
  }

  .brand-badge {
    margin-left: auto;
    margin-right: auto;
  }

  .auth-brand p {
    margin-left: auto;
    margin-right: auto;
  }

  .auth-preview-card {
    margin-left: auto;
    margin-right: auto;
  }

  .auth-card {
    width: 100%;
    max-width: 460px;
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 74px 16px 20px;

    overflow: hidden;
  }

  .auth-container {
    gap: 28px;
  }

  .auth-brand {
    margin-top: 2rem;
  }

  .auth-brand h1 {
    font-size: clamp(2.1rem, 11vw, 2.7rem);
    line-height: 1;

    text-align: left;
  }

  .auth-brand h1 span {
    margin-top: -0.12em;

    line-height: 1.12;

    padding-bottom: .08em;
  }

  .auth-brand p {
    font-size: 0.98rem;
    line-height: 1.55;

    text-align: left;
  }

  .auth-preview-card {
    width: 100%;
    min-width: 0;

    padding: 14px;

    gap: 12px;
  }

  .preview-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;

    font-size: 1.2rem;

    border-radius: 16px;
  }

  .auth-card {
    width: 100%;
    max-width: 100%;

    padding: 26px 18px;
  }

  .auth-card h2 {
    font-size: 1.7rem;
  }

  .auth-theme-toggle {
    top: 14px;
    right: 14px;
  }

  .auth-home-link {
    top: 14px;
    left: 14px;
  }
}

/* =========================================
   SCROLLBAR - AUTH
========================================= */

/* CHROME / EDGE / SAFARI */

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: #060816;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  border-radius: 999px;

  border: 2px solid #060816;

  background:
    linear-gradient(180deg,
      #0bc28c,
      #1edd7f);

  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg,
      #1edd7f,
      #0bc28c);
}

/* FIREFOX */

html,
body {
  scrollbar-width: thin;

  scrollbar-color:
    #0bc28c #060816;
}

/* =========================================
   AUTH FORM OVERRIDES
========================================= */

.auth-card .form-group label {
  color: var(--auth-card-muted);
}

.auth-card .form-group input,
.auth-card .form-group textarea,
.auth-card .form-group select,
.auth-card .input-prefix,
.auth-card .password-input {
  background: color-mix(in srgb, var(--auth-card) 88%, transparent);

  color: var(--auth-card-text);

  border-color: rgba(148, 163, 184, 0.22);
}

html.theme-dark .auth-card .form-group input,
html.theme-dark .auth-card .form-group textarea,
html.theme-dark .auth-card .form-group select,
html.theme-dark .auth-card .input-prefix,
html.theme-dark .auth-card .password-input,
body.theme-dark .auth-card .form-group input,
body.theme-dark .auth-card .form-group textarea,
body.theme-dark .auth-card .form-group select,
body.theme-dark .auth-card .input-prefix,
body.theme-dark .auth-card .password-input {
  background: rgba(255, 255, 255, 0.06);

  color: #f9fafb;

  border-color: rgba(255, 255, 255, 0.12);
}

html.theme-light .auth-card .form-group input,
html.theme-light .auth-card .form-group textarea,
html.theme-light .auth-card .form-group select,
html.theme-light .auth-card .input-prefix,
html.theme-light .auth-card .password-input,
body.theme-light .auth-card .form-group input,
body.theme-light .auth-card .form-group textarea,
body.theme-light .auth-card .form-group select,
body.theme-light .auth-card .input-prefix,
body.theme-light .auth-card .password-input {
  background: #f9fafb;

  color: #111827;

  border-color: #e5e7eb;
}

.auth-card .password-input input {
  background: transparent !important;

  border: 0 !important;

  box-shadow: none !important;

  color: var(--auth-card-text);

  caret-color: var(--auth-card-text);
}

/* Placeholder padrão */

.auth-card .form-group input::placeholder,
.auth-card .form-group textarea::placeholder,
.auth-card .password-input input::placeholder {
  opacity: 1;
}

/* Placeholder no tema escuro */

html.theme-dark .auth-card .form-group input::placeholder,
html.theme-dark .auth-card .form-group textarea::placeholder,
html.theme-dark .auth-card .password-input input::placeholder,
body.theme-dark .auth-card .form-group input::placeholder,
body.theme-dark .auth-card .form-group textarea::placeholder,
body.theme-dark .auth-card .password-input input::placeholder {
  color: rgba(249, 250, 251, 0.42);
}

/* Placeholder no tema claro */

html.theme-light .auth-card .form-group input::placeholder,
html.theme-light .auth-card .form-group textarea::placeholder,
html.theme-light .auth-card .password-input input::placeholder,
body.theme-light .auth-card .form-group input::placeholder,
body.theme-light .auth-card .form-group textarea::placeholder,
body.theme-light .auth-card .password-input input::placeholder {
  color: #94a3b8;
}

.auth-card .form-group input:focus,
.auth-card .form-group textarea:focus,
.auth-card .form-group select:focus,
.auth-card .input-prefix:focus-within,
.auth-card .password-input:focus-within {
  border-color: transparent;

  background:
    linear-gradient(var(--auth-card), var(--auth-card)) padding-box,
    linear-gradient(135deg, var(--auth-primary), var(--auth-secondary)) border-box;

  box-shadow:
    0 0 0 4px rgba(11, 194, 140, 0.14);

  outline: none;
}

/* Autofill: somente aqui usa -webkit-text-fill-color */

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus,
.auth-card input:-webkit-autofill:active,
.auth-card textarea:-webkit-autofill,
.auth-card textarea:-webkit-autofill:hover,
.auth-card textarea:-webkit-autofill:focus,
.auth-card textarea:-webkit-autofill:active {
  -webkit-text-fill-color: var(--auth-card-text) !important;

  caret-color: var(--auth-card-text) !important;

  border-color: rgba(148, 163, 184, 0.22) !important;

  transition: background-color 9999s ease-in-out 0s !important;
}

html.theme-dark .auth-card input:-webkit-autofill,
html.theme-dark .auth-card input:-webkit-autofill:hover,
html.theme-dark .auth-card input:-webkit-autofill:focus,
html.theme-dark .auth-card input:-webkit-autofill:active,
body.theme-dark .auth-card input:-webkit-autofill,
body.theme-dark .auth-card input:-webkit-autofill:hover,
body.theme-dark .auth-card input:-webkit-autofill:focus,
body.theme-dark .auth-card input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #182233 inset !important;

  box-shadow: 0 0 0 1000px #182233 inset !important;

  -webkit-text-fill-color: #f9fafb !important;

  caret-color: #f9fafb !important;
}

html.theme-light .auth-card input:-webkit-autofill,
html.theme-light .auth-card input:-webkit-autofill:hover,
html.theme-light .auth-card input:-webkit-autofill:focus,
html.theme-light .auth-card input:-webkit-autofill:active,
body.theme-light .auth-card input:-webkit-autofill,
body.theme-light .auth-card input:-webkit-autofill:hover,
body.theme-light .auth-card input:-webkit-autofill:focus,
body.theme-light .auth-card input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #f9fafb inset !important;

  box-shadow: 0 0 0 1000px #f9fafb inset !important;

  -webkit-text-fill-color: #111827 !important;

  caret-color: #111827 !important;
}

html.theme-dark .auth-card .password-toggle-icon,
body.theme-dark .auth-card .password-toggle-icon {
  filter: brightness(0) invert(1);
}

html.theme-light .auth-card .password-toggle-icon,
body.theme-light .auth-card .password-toggle-icon {
  filter: brightness(0);
}

html.theme-light .auth-home-link,
body.theme-light .auth-home-link,
html.theme-light .auth-theme-toggle .theme-toggle,
body.theme-light .auth-theme-toggle .theme-toggle {
  background: rgba(255, 255, 255, 0.68);

  border-color: rgba(15, 23, 42, 0.08);
}

html.theme-light .auth-home-link:hover,
body.theme-light .auth-home-link:hover,
html.theme-light .auth-theme-toggle .theme-toggle:hover,
body.theme-light .auth-theme-toggle .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.82);
}

/* =========================================
   AUTH THEME BUTTON ICON
========================================= */

html.theme-light .auth-theme-toggle .theme-icon,
body.theme-light .auth-theme-toggle .theme-icon {
  filter: brightness(0) saturate(100%);

  opacity: .72;
}

html.theme-light .auth-theme-toggle .theme-toggle:hover .theme-icon,
body.theme-light .auth-theme-toggle .theme-toggle:hover .theme-icon {
  opacity: 1;
}

html.theme-dark .auth-theme-toggle .theme-icon,
body.theme-dark .auth-theme-toggle .theme-icon {
  filter: brightness(0) invert(1);

  opacity: .9;
}

html.theme-dark .auth-theme-toggle .theme-toggle:hover .theme-icon,
body.theme-dark .auth-theme-toggle .theme-toggle:hover .theme-icon {
  opacity: 1;
}

/* =========================================
   AUTH INPUT PREFIX FIX
========================================= */

.auth-card .input-prefix {
  background: color-mix(in srgb, var(--auth-card) 88%, transparent);
  color: var(--auth-card-text);
  border-color: rgba(148, 163, 184, 0.22);
}

.auth-card .input-prefix span {
  height: 100%;

  padding-left: 16px;
  padding-right: 8px;

  display: flex;
  align-items: center;

  color: var(--auth-card-muted);
  background: transparent;

  font-weight: 800;
}

.auth-card .input-prefix input {
  background: transparent !important;
  color: var(--auth-card-text);

  border: 0 !important;
  box-shadow: none !important;

  padding-left: 0;

  caret-color: var(--auth-card-text);
}

.auth-card .input-prefix input::placeholder {
  color: var(--auth-card-muted);
  opacity: 0.7;
}

/* DARK */
html.theme-dark .auth-card .input-prefix,
body.theme-dark .auth-card .input-prefix {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

html.theme-dark .auth-card .input-prefix span,
body.theme-dark .auth-card .input-prefix span {
  color: rgba(249, 250, 251, 0.42);
}

html.theme-dark .auth-card .input-prefix input,
body.theme-dark .auth-card .input-prefix input {
  background: transparent !important;
  color: #f9fafb;
  caret-color: #f9fafb;
}

html.theme-dark .auth-card .input-prefix input::placeholder,
body.theme-dark .auth-card .input-prefix input::placeholder {
  color: rgba(249, 250, 251, 0.42);
  opacity: 1;
}

/* LIGHT */
html.theme-light .auth-card .input-prefix,
body.theme-light .auth-card .input-prefix {
  background: #f9fafb;
  border-color: #e5e7eb;
}

html.theme-light .auth-card .input-prefix span,
body.theme-light .auth-card .input-prefix span {
  color: #94a3b8;
}

html.theme-light .auth-card .input-prefix input,
body.theme-light .auth-card .input-prefix input {
  background: transparent !important;
  color: #111827;
  caret-color: #111827;
}

html.theme-light .auth-card .input-prefix input::placeholder,
body.theme-light .auth-card .input-prefix input::placeholder {
  color: #94a3b8;
  opacity: 1;
}
