:root {
  --control-height: 2.5rem;
  --font-interface: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-login: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Impede que textos longos invadam a coluna vizinha em qualquer tabela. */
:where(table) :is(th, td) {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

/* Cabeçalhos e células apenas para ações não possuem texto a truncar. */
:where(table) :is(th, td)[aria-label],
:where(table) :is(th, td)[aria-hidden="true"],
:where(table) .table-cell-action {
  text-overflow: clip;
}

.theme-light {
  color-scheme: light;
  --page-bg: #f5f7fb;
  --page-text: #17233b;
  --surface: #ffffff;
  --border: #dbe3ef;
  --muted: #4a5875;
  --control-accent: #0a3d62;
  --login-autofill-text: rgba(7, 15, 30, 0.95);
  --login-autofill-background: rgba(255, 255, 255, 0.58);
}

.theme-dark {
  color-scheme: dark;
  --page-bg: #212121;
  --page-text: #ececec;
  --surface: #2b2b2b;
  --border: #3f3f3f;
  --muted: #a9a9a9;
  --control-accent: #171717;
  --login-autofill-text: rgba(238, 243, 251, 0.96);
  --login-autofill-background: rgba(4, 10, 19, 0.46);
}

.site-body {
  min-width: 1200px;
  margin: 0;
  overflow: hidden;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: var(--font-interface);
}

.site-layout,
.site-main { min-height: 100vh; }
.site-layout { display: flex; flex-direction: column; }
.site-main { padding: 1.25rem; }

.login2-page {
  position: relative;
  min-height: 100vh;
  margin: -1.25rem;
  padding: 5.6rem 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-login);
}

.login2-bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login2-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 19, 39, 0.45), rgba(6, 14, 28, 0.7));
}

.login2-nav-wrap {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 1200;
  width: min(1120px, calc(100vw - 2rem));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #f4f8ff;
}

.login2-brand {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.login2-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 2vw, 2rem);
}

.login2-nav a {
  color: rgba(244, 248, 255, 0.94);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
}

.login2-nav a:hover { color: #ffffff; }
.login2-nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.login2-theme-form { margin: 0; }
.theme-toggle { min-height: var(--control-height); cursor: pointer; }

.login2-theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  padding: 0.56rem 0.86rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  backdrop-filter: blur(3px);
}

.login2-theme-toggle:hover { background: rgba(255, 255, 255, 0.2); }

.login2-card {
  position: relative;
  z-index: 2;
  width: 460px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  padding: 1.35rem 1.8rem 1.45rem;
  background: linear-gradient(180deg, rgba(229, 239, 255, 0.56), rgba(200, 219, 245, 0.4));
  box-shadow: 0 28px 50px rgba(7, 16, 32, 0.4);
  backdrop-filter: blur(10px);
  animation: login-card-enter 450ms ease-out;
}

@keyframes login-card-enter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login2-title {
  margin: 0 0 1.15rem;
  color: rgba(7, 15, 30, 0.9);
  font-size: clamp(2rem, 4vw, 2.4rem);
  line-height: 1.1;
  text-align: center;
}

.login2-form { margin: 0; }

.login2-label {
  display: block;
  margin: 0.25rem 0 0.35rem;
  color: rgba(10, 24, 47, 0.8);
  font-size: 0.9rem;
  font-weight: 600;
}

.login2-input {
  width: 100%;
  min-height: var(--control-height);
  margin-bottom: 1.1rem;
  appearance: none;
  border: 1px solid rgba(10, 24, 47, 0.18);
  border-radius: 4px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(7, 15, 30, 0.95);
  caret-color: currentColor;
  font-size: 1rem;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.login2-input::placeholder { color: rgba(15, 31, 56, 0.58); }

.login2-input:focus-visible {
  outline: none;
  border-color: #0a3d62;
  box-shadow: 0 0 0 3px rgba(15, 34, 65, 0.12);
}

.login2-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: -0.12rem 0 1rem;
}

.login2-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(10, 24, 47, 0.84);
  font-size: 0.85rem;
}

.login2-remember input {
  width: 0.92rem;
  height: 0.92rem;
  accent-color: var(--control-accent);
}

.login2-link {
  color: rgba(10, 24, 47, 0.86);
  font-size: 0.84rem;
  text-decoration: none;
}

.login2-link:hover,
.login2-register a:hover { text-decoration: underline; }

.login2-submit {
  width: 100%;
  min-height: var(--control-height);
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(204, 197, 233, 0.36);
  border-radius: 999px;
  padding: 0.84rem 1rem;
  background: rgba(57, 58, 106, 0.34);
  color: rgba(245, 244, 255, 0.96);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.login2-submit:hover {
  border-color: rgba(235, 233, 255, 0.55);
  background: rgba(67, 68, 118, 0.42);
}

.login2-divider {
  margin-top: 1.05rem;
  border-top: 1px solid rgba(204, 197, 233, 0.3);
}

.login2-social-title {
  margin: 1.2rem 0 0.8rem;
  color: rgba(242, 240, 255, 0.92);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-align: center;
}

.login2-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.05rem;
}

.login2-socials a {
  width: var(--control-height);
  height: var(--control-height);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  text-decoration: none;
}

.login2-social-icon { display: block; width: 1.45rem; height: 1.45rem; }
.login2-social-apple { padding: 0.56rem; }

.login2-register {
  margin: 1rem 0 0.1rem;
  color: rgba(10, 24, 47, 0.9);
  font-size: 0.92rem;
  text-align: center;
}

.login2-register a {
  color: rgba(10, 24, 47, 1);
  font-weight: 700;
  text-decoration: none;
}

.theme-light .login2-bg-overlay { background: transparent; }

.theme-light .login2-social-title,
.theme-light .login2-register { color: rgba(29, 36, 67, 0.88); }

.theme-light .login2-divider { border-top-color: rgba(88, 102, 157, 0.3); }

.theme-light .login2-submit {
  border-color: rgba(105, 118, 177, 0.4);
  background: rgba(255, 255, 255, 0.76);
  color: rgba(29, 36, 67, 0.9);
}

.theme-light .login2-submit:hover {
  border-color: rgba(89, 103, 165, 0.52);
  background: rgba(255, 255, 255, 0.86);
}

.theme-dark .login2-bg-overlay {
  background: linear-gradient(180deg, rgba(2, 7, 18, 0.55), rgba(1, 5, 13, 0.78));
}

.theme-dark .login2-card {
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(18, 26, 40, 0.92), rgba(10, 16, 29, 0.86));
}

.theme-dark .login2-title,
.theme-dark .login2-label,
.theme-dark .login2-input,
.theme-dark .login2-remember,
.theme-dark .login2-link,
.theme-dark .login2-register,
.theme-dark .login2-register a { color: rgba(238, 243, 251, 0.96); }

.theme-dark .login2-input {
  border-color: rgba(238, 243, 251, 0.18);
  background: rgba(4, 10, 19, 0.46);
}

.theme-dark .login2-input::placeholder { color: rgba(238, 243, 251, 0.62); }

.theme-dark .login2-input:focus-visible {
  border-color: rgba(238, 243, 251, 0.32);
  box-shadow: 0 0 0 3px rgba(207, 224, 255, 0.12);
}

/* O navegador aplica estilos próprios às credenciais salvas.
   Mantém a mesma aparência de autofill do login original em cada tema. */
.site-body .login2-input:-webkit-autofill,
.site-body .login2-input:-webkit-autofill:hover,
.site-body .login2-input:-webkit-autofill:focus,
.site-body .login2-input:autofill {
  -webkit-text-fill-color: var(--login-autofill-text);
  -webkit-box-shadow: 0 0 0 1000px var(--login-autofill-background) inset;
  box-shadow: 0 0 0 1000px var(--login-autofill-background) inset;
}

.site-body .login2-input:-webkit-autofill::first-line {
  font-size: 0.92rem;
}

.growl-container {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2100;
  width: 430px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.growl-item {
  position: relative;
  border: 1px solid var(--border);
  border-left: 4px solid #ef7d00;
  border-radius: 10px;
  padding: 0.62rem 2rem 0.62rem 0.74rem;
  background: var(--surface);
  color: var(--page-text);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.growl-item-info { border-left-color: #27d17f; }
.growl-item-warn { border-left-color: #ef7d00; }
.growl-item-error,
.growl-item-fatal { border-left-color: #e04f5f; }

.growl-item.is-closing { opacity: 0; transform: translateX(10px); }

.client-quick-status {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
}

.client-quick-status.is-visible { opacity: 1; }

.client-quick-status-card {
  width: min(10.75rem, 48vw);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1.75rem;
  background: linear-gradient(180deg, rgb(20, 27, 38), rgb(11, 16, 25));
  box-shadow: 0 1.8rem 4rem rgba(2, 6, 10, .34);
  text-align: center;
}

.client-quick-status-icon {
  width: 4.15rem;
  height: 4.15rem;
  object-fit: contain;
  filter: drop-shadow(0 0.45rem 0.9rem rgba(39, 209, 127, 0.18));
}

.client-quick-status-text {
  max-width: 8.4rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.theme-light .client-quick-status-card {
  border-color: rgba(214, 225, 239, .92);
  background: linear-gradient(135deg, #faf6f8 0%, #f3f6fb 58%, #f9eef3 100%);
}
.growl-title { display: block; font-size: 0.86rem; font-weight: 700; line-height: 1.2; }
.growl-text { margin-top: 0.28rem; color: var(--muted); font-size: 0.79rem; line-height: 1.35; }

.growl-close {
  position: absolute;
  top: 0.38rem;
  right: 0.38rem;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
