/* Fthyrk authentication surface. Scoped with :has() so the CRM itself is untouched. */
body:has(#login-email) {
  background: #f8fafc;
  color: #15223a;
}

body:has(#login-email)::before {
  position: fixed;
  inset: 0 0 0 48%;
  z-index: 0;
  display: block;
  content: "FTHYRK CRM\A\A Atendimento, vendas e automacoes em um so lugar.\A\A Uma plataforma segura para equipes que precisam responder rapido, acompanhar cada conversa e transformar relacionamento em resultado.";
  box-sizing: border-box;
  padding: max(5rem, 12vh) clamp(3rem, 7vw, 9rem);
  overflow: hidden;
  background-color: #0b1d39;
  background-image: url('/brand-assets/fthyrk-symbol-1024-source.png');
  background-repeat: no-repeat;
  background-position: calc(100% + 17rem) calc(100% + 10rem);
  background-size: min(63vw, 52rem);
  color: #f8fbff;
  font-size: clamp(1rem, 1.15vw, 1.2rem);
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0;
  white-space: pre-line;
}

body:has(#login-email)::after {
  position: fixed;
  right: clamp(3rem, 7vw, 9rem);
  bottom: max(3rem, 7vh);
  z-index: 1;
  content: "Fthyrk Software  |  Conecte sua operacao";
  color: #9db9dc;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
}

body:has(#login-email) #root {
  min-height: 100svh;
}

body:has(#login-email) #root > .min-h-screen {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  background: transparent !important;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 {
  width: min(48%, 48rem);
  min-height: 100svh;
  justify-content: center;
  padding: clamp(2rem, 6vh, 5rem) clamp(1.5rem, 7vw, 7.5rem);
  background: #ffffff;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md {
  max-width: 27rem;
  margin: 0;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 15rem;
  height: 3rem;
  margin-bottom: 2.5rem;
  background: url('/brand-assets/fthyrk-symbol-1024-source.png') left center / 2.9rem no-repeat;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center img {
  visibility: hidden;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center::after {
  content: 'Fthyrk CRM';
  color: #10213c;
  font-size: 1.35rem;
  font-weight: 760;
  letter-spacing: 0;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > div:not(.text-center) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body:has(#login-email) #root h2 {
  color: #10213c;
  font-size: clamp(1.8rem, 2.3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: 0;
}

body:has(#login-email) #root p,
body:has(#login-email) #root label,
body:has(#login-email) #root .text-muted-foreground {
  color: #536276 !important;
}

body:has(#login-email) #root label {
  color: #24344e !important;
  font-weight: 650;
}

body:has(#login-email) #root input {
  height: 3.1rem;
  border-color: #c7d2e2;
  border-radius: 0.55rem;
  background: #ffffff !important;
  color: #10213c !important;
  box-shadow: none !important;
}

body:has(#login-email) #root input::placeholder {
  color: #7c8aa0 !important;
}

body:has(#login-email) #root input:focus {
  border-color: #1769e0;
  outline: 3px solid rgba(23, 105, 224, 0.16);
  outline-offset: 0;
}

body:has(#login-email) #root button[type='submit'] {
  height: 3.15rem;
  border-radius: 0.55rem;
  background: #155dde;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(21, 93, 222, 0.22);
  font-weight: 700;
}

body:has(#login-email) #root button[type='submit']:hover:not(:disabled) {
  background: #104cb5;
}

body:has(#login-email) #root [role='tablist'] {
  justify-content: flex-start;
  height: auto;
  padding: 0;
  gap: 1.5rem;
  border-bottom: 1px solid #e1e7ef;
  border-radius: 0;
  background: transparent;
}

body:has(#login-email) #root [role='tab'] {
  min-height: 2.9rem;
  padding: 0 0.15rem;
  border-radius: 0;
  background: transparent !important;
  color: #65748a;
  font-size: 0.92rem;
  font-weight: 700;
}

body:has(#login-email) #root [role='tab'][data-state='active'] {
  border-bottom: 2px solid #155dde;
  color: #155dde;
  box-shadow: none;
}

body:has(#login-email) #root .absolute.top-4.right-4 {
  top: 1.5rem;
  right: clamp(1.5rem, 5vw, 4rem);
  left: auto;
}

body:has(#login-email) #root .absolute.top-4.right-4 button {
  border-color: #d8e0eb;
  background: #ffffff;
  color: #263650;
}

body:has(#login-email) #root a,
body:has(#login-email) #root .text-primary {
  color: #155dde !important;
}

@media (max-width: 900px) {
  body:has(#login-email)::before,
  body:has(#login-email)::after {
    display: none;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    width: 100%;
    padding: 7rem max(1.25rem, 7vw) 2.5rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md {
    max-width: 31rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    align-items: flex-start;
    padding-top: 6.75rem;
  }

  body:has(#login-email) #root h2 {
    font-size: 1.75rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    width: 13.5rem;
    height: 2.55rem;
  }

  body:has(#login-email) #root [role='tablist'] {
    gap: 1rem;
  }
}

/* v42: keeps the Fthyrk identity while making the single sign-on path
   immediate and visually primary, in the same compact, high-contrast style
   used by modern dashboard sign-in surfaces. */
body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) {
  display: flex;
  flex-direction: column;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > .space-y-2.mb-6 {
  order: 1;
  margin-bottom: 1.5rem;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > button[type='button'] {
  order: 3;
  min-height: 3.15rem;
  border-color: #cbd7e7;
  border-radius: 0.55rem;
  background: #ffffff;
  color: #1b2d49;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 35, 65, 0.04);
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > button[type='button']:hover:not(:disabled) {
  border-color: #8eadd1;
  background: #f8fbff;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > .relative.my-4 {
  order: 4;
  margin: 1.35rem 0;
  color: #6a7b91;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > form {
  order: 5;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > .text-center.mt-4 {
  order: 6;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > [role='alert'] {
  order: 2;
  margin-bottom: 1.25rem;
  border-color: #f2b8b5;
  border-radius: 0.55rem;
  background: #fff8f7;
  color: #8e2420;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > [role='alert'] * {
  color: inherit !important;
}

body:has(#login-email) #root button:focus-visible,
body:has(#login-email) #root input:focus-visible {
  outline: 3px solid rgba(21, 93, 222, 0.24);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > button[type='button'] {
    min-height: 3.25rem;
  }
}

/* A cleaner, two-surface layout inspired by the supplied reference. The
   selectors remain restricted to the login fields, so no CRM route inherits
   this presentation. */
@media (min-width: 901px) {
  body:has(#login-email)::before {
    inset: 0 0 0 42%;
    padding: max(5rem, 12vh) clamp(3rem, 6vw, 7rem);
    background-position: calc(100% + 16rem) calc(100% + 11rem);
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    width: min(42%, 42rem);
    padding: clamp(2.5rem, 6vh, 5rem) clamp(3rem, 6vw, 5rem);
    padding-top: clamp(5rem, 10vh, 6rem);
    justify-content: flex-start !important;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md {
    max-width: 24rem;
  }
}

body:has(#login-email) #root .w-full.max-w-md > div:not(.text-center) {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:has(#login-email) #root [role='tablist'] {
  display: flex !important;
  justify-content: flex-start !important;
  gap: 1.25rem !important;
  border: 0 !important;
  border-bottom: 1px solid #dce5f0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:has(#login-email) #root [role='tab'] {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  padding: 0 0.15rem !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:has(#login-email) #root h2 {
  font-size: clamp(1.7rem, 2vw, 2rem);
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > .relative.my-4 > .relative {
  font-size: 0;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > .relative.my-4 > .relative > span {
  padding: 0 0.75rem !important;
}

body:has(#login-email) #root [role='tabpanel'][data-state='active']:has(#login-email) > .relative.my-4 > .relative > span::after {
  content: 'ou';
  color: #718096;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* v43: presentation-only refinement. Authentication routes and behavior remain untouched. */
body:has(#login-email) {
  background: #f6f8fc;
  color: #13233d;
}

body:has(#login-email)::before {
  inset: 0 0 0 45.5%;
  padding: max(5.75rem, 14vh) clamp(3.5rem, 7.25vw, 10rem);
  background-color: #071a34;
  background-image:
    radial-gradient(circle at 14% 12%, rgba(69, 180, 255, 0.24), transparent 28%),
    radial-gradient(circle at 88% 83%, rgba(255, 126, 42, 0.2), transparent 36%),
    linear-gradient(132deg, rgba(3, 20, 47, 0.18) 0%, rgba(8, 50, 93, 0.08) 48%, rgba(4, 20, 43, 0.56) 100%),
    url('/brand-assets/fthyrk-symbol-1024-source.png');
  background-repeat: no-repeat;
  background-position: center, center, center, calc(100% + 18rem) calc(100% + 12rem);
  background-size: auto, auto, auto, min(66vw, 56rem);
  font-size: clamp(1.02rem, 1.16vw, 1.24rem);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.16);
}

body:has(#login-email)::after {
  right: clamp(3.5rem, 7.25vw, 10rem);
  bottom: max(3.25rem, 7.5vh);
  color: rgba(198, 220, 245, 0.74);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 {
  position: relative;
  isolation: isolate;
  width: min(45.5%, 48rem);
  padding: clamp(2.25rem, 6vh, 5.5rem) clamp(1.75rem, 7vw, 7.75rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 6% 4%, rgba(35, 121, 255, 0.09), transparent 31rem),
    linear-gradient(148deg, #ffffff 0%, #fbfcff 56%, #f4f7fc 100%);
  box-shadow: 18px 0 56px rgba(8, 28, 59, 0.14);
}

body:has(#login-email) #root > .min-h-screen > .flex-1::before {
  position: absolute;
  top: -15rem;
  right: -18rem;
  z-index: -1;
  width: 37rem;
  height: 37rem;
  border: 1px solid rgba(49, 111, 208, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 3.8rem rgba(49, 111, 208, 0.028), 0 0 0 8.2rem rgba(49, 111, 208, 0.018);
  content: '';
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md {
  position: relative;
  z-index: 1;
  max-width: 27.5rem;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
  height: 3.15rem;
  margin-bottom: 3.1rem;
  background-size: 3.05rem;
  filter: drop-shadow(0 6px 12px rgba(16, 57, 113, 0.1));
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center::after {
  color: #0d2445;
  font-size: 1.46rem;
  font-weight: 790;
  letter-spacing: -0.04em;
}

body:has(#login-email) #root h2 {
  color: #0c2140;
  font-size: clamp(1.78rem, 2.2vw, 2.25rem);
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: -0.045em;
}

body:has(#login-email) #root h2 + p {
  margin-top: 0.7rem;
  color: #64748b !important;
  font-size: 0.93rem;
  line-height: 1.55;
}

body:has(#login-email) #root label {
  color: #263b57 !important;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.005em;
}

body:has(#login-email) #root input {
  height: 3.25rem;
  border-color: #d4deeb;
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 1px 2px rgba(22, 42, 76, 0.025) !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

body:has(#login-email) #root input:hover {
  border-color: #b9c8dc;
}

body:has(#login-email) #root input:focus {
  border-color: #256fe5;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(37, 111, 229, 0.14), 0 2px 5px rgba(21, 58, 112, 0.06) !important;
}

body:has(#login-email) #root button[type='submit'] {
  height: 3.25rem;
  border: 1px solid rgba(9, 76, 188, 0.2);
  border-radius: 0.72rem;
  background: linear-gradient(135deg, #155dde 0%, #287ce7 100%);
  box-shadow: 0 12px 24px rgba(21, 93, 222, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 740;
  letter-spacing: -0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body:has(#login-email) #root button[type='submit']:hover:not(:disabled) {
  background: linear-gradient(135deg, #104fc6 0%, #226fd2 100%);
  box-shadow: 0 15px 28px rgba(21, 93, 222, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

body:has(#login-email) #root [role='tablist'] {
  gap: 1.55rem !important;
  border-bottom-color: #dce5f0 !important;
}

body:has(#login-email) #root [role='tab'] {
  min-height: 3rem;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

body:has(#login-email) #root [role='tab'][data-state='active'] {
  color: #0e55c5;
}

body:has(#login-email) #root [role='tabpanel'] button:not([type='submit']) {
  min-height: 3.15rem;
  border-color: #d6e0ec !important;
  border-radius: 0.72rem !important;
  background: linear-gradient(145deg, #ffffff 0%, #f9fbfe 100%) !important;
  box-shadow: 0 2px 5px rgba(18, 42, 82, 0.035) !important;
  font-weight: 680;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body:has(#login-email) #root [role='tabpanel'] button:not([type='submit']):hover {
  border-color: #b9c9dd !important;
  box-shadow: 0 7px 16px rgba(18, 42, 82, 0.08) !important;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    width: 100%;
    max-width: none;
    padding: clamp(2rem, 6vh, 3.5rem) clamp(1.35rem, 6vw, 3rem);
    box-shadow: none;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md {
    max-width: 27.5rem;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  body:has(#login-email) #root .absolute.top-4.right-4 {
    top: 1.25rem;
    right: 1.5rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    padding-top: max(2rem, env(safe-area-inset-top));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    margin-top: 3.9rem;
    margin-bottom: 2.2rem;
  }
}

/* v44: full-page Fthyrk authentication experience, inspired by the split-screen clarity of the supplied reference. */
body:has(#login-email) {
  background: #f5f8fd;
}

body:has(#login-email)::before {
  inset: 0 0 0 42%;
  padding: clamp(4.5rem, 9vh, 7rem) clamp(3.5rem, 7vw, 9.5rem);
  content: 'FTHYRK CRM  /  PLATAFORMA DE RELACIONAMENTO';
  background-color: #061b38;
  background-image:
    radial-gradient(circle at 21% 15%, rgba(42, 187, 255, 0.6) 0, rgba(25, 117, 223, 0.19) 17%, transparent 39%),
    radial-gradient(circle at 89% 89%, rgba(255, 124, 33, 0.58) 0, rgba(255, 124, 33, 0.1) 25%, transparent 50%),
    linear-gradient(131deg, rgba(4, 19, 45, 0.1), rgba(9, 56, 111, 0.38) 55%, rgba(3, 17, 39, 0.66)),
    url('/brand-assets/fthyrk-symbol-1024-source.png');
  background-position: center, center, center, calc(100% + 16rem) calc(100% + 10rem);
  background-repeat: no-repeat;
  background-size: auto, auto, auto, min(70vw, 63rem);
  color: rgba(224, 239, 255, 0.84);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-shadow: none;
}

body:has(#login-email)::after {
  top: 42%;
  right: clamp(3.5rem, 7vw, 9.5rem);
  bottom: auto;
  width: min(32rem, 41vw);
  content: 'Uma operação\A conectada para\A crescer.';
  color: #ffffff;
  font-size: clamp(2.2rem, 3vw, 3.7rem);
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 1.04;
  text-transform: none;
  white-space: pre-line;
  text-shadow: 0 8px 28px rgba(0, 17, 45, 0.27);
}

body:has(#login-email) #root > .min-h-screen::after {
  position: fixed;
  right: clamp(3.5rem, 7vw, 9.5rem);
  bottom: max(2.5rem, 6vh);
  z-index: 2;
  content: 'FTHYRK SOFTWARE  /  CONECTE SUA OPERAÇÃO';
  color: rgba(205, 226, 249, 0.76);
  font-size: 0.66rem;
  font-weight: 720;
  letter-spacing: 0.13em;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 {
  width: min(42%, 46rem);
  padding: clamp(2.5rem, 6.5vh, 5.75rem) clamp(1.75rem, 6.5vw, 7.5rem);
  background:
    radial-gradient(circle at 0 0, rgba(42, 112, 226, 0.12), transparent 31rem),
    linear-gradient(148deg, #ffffff 0%, #fbfcff 54%, #f2f6fc 100%);
  box-shadow: 24px 0 70px rgba(3, 28, 67, 0.18);
}

body:has(#login-email) #root > .min-h-screen > .flex-1::before {
  border-color: rgba(50, 115, 209, 0.14);
  box-shadow: 0 0 0 3.8rem rgba(50, 115, 209, 0.03), 0 0 0 8.2rem rgba(50, 115, 209, 0.02);
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md {
  max-width: 28rem;
}

body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
  margin-bottom: clamp(2.5rem, 5vh, 3.5rem);
}

body:has(#login-email) #root [role='tabpanel'] button:not([type='submit']) {
  background: linear-gradient(145deg, #ffffff 0%, #f7faff 100%) !important;
}

@media (max-width: 900px) {
  body:has(#login-email) #root > .min-h-screen::after {
    display: none;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    width: 100%;
    padding-left: clamp(1.35rem, 6vw, 3rem);
    padding-right: clamp(1.35rem, 6vw, 3rem);
  }
}

/* v45: prevent a shadow/gap between the two panes and preserve all controls at short desktop heights. */
@media (min-width: 901px) {
  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    width: 42%;
    max-width: none;
    border-right: 1px solid rgba(199, 213, 231, 0.72);
    box-shadow: none;
  }
}

@media (min-width: 901px) and (max-height: 760px) {
  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 2rem;
    padding-bottom: 2rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    margin-bottom: 2rem;
  }
}

/* v48: keep every login control in the initial viewport on compact desktop screens.
   The pane remains scrollable as a fallback, while this density adjustment affects
   only the authentication route and does not alter its fields or access rules. */
@media (min-width: 901px) and (max-height: 680px) {
  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    padding-top: 1.05rem;
    padding-bottom: 1.15rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    height: 2.45rem;
    margin-bottom: 0.8rem;
    background-size: 2.35rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center::after {
    font-size: 1.18rem;
  }

  body:has(#login-email) #root [role='tablist'] {
    gap: 1.1rem !important;
  }

  body:has(#login-email) #root [role='tab'] {
    min-height: 2.3rem;
    font-size: 0.79rem;
  }

  body:has(#login-email) #root h2 {
    font-size: 1.55rem;
    line-height: 1.08;
  }

  body:has(#login-email) #root h2 + p {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  body:has(#login-email) #root label {
    font-size: 0.77rem;
  }

  body:has(#login-email) #root input,
  body:has(#login-email) #root button[type='submit'],
  body:has(#login-email) #root [role='tabpanel'] button:not([type='submit']) {
    min-height: 0;
    height: 2.62rem;
  }

  body:has(#login-email) #root [role='tabpanel'] .space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.65rem;
  }

  body:has(#login-email) #root [role='tabpanel'] .my-4 {
    margin-top: 0.62rem;
    margin-bottom: 0.62rem;
  }
}

@media (min-width: 901px) and (max-height: 560px) {
  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    padding-top: 0.7rem;
    padding-bottom: 0.8rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    height: 2.05rem;
    margin-bottom: 0.45rem;
    background-size: 1.98rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center::after {
    font-size: 1.04rem;
  }

  body:has(#login-email) #root h2 {
    font-size: 1.38rem;
  }

  body:has(#login-email) #root input,
  body:has(#login-email) #root button[type='submit'],
  body:has(#login-email) #root [role='tabpanel'] button:not([type='submit']) {
    height: 2.42rem;
  }

  body:has(#login-email) #root [role='tabpanel'] {
    margin-top: 0.7rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] > .space-y-2.mb-6 {
    margin-bottom: 0.6rem !important;
  }

  body:has(#login-email) #root h2 + p {
    display: none;
  }

  body:has(#login-email) #root [role='tabpanel'] > button {
    height: 2.28rem !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  body:has(#login-email) #root .relative.my-4 {
    margin-top: 0.45rem !important;
    margin-bottom: 0.45rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] form.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.45rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] form .space-y-2 > label {
    margin-bottom: 0.3rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] form .text-xs.text-muted-foreground {
    margin-top: 0.45rem !important;
    margin-bottom: 0.45rem !important;
    font-size: 0.7rem;
    line-height: 1.22;
  }

  body:has(#login-email) #root [role='tabpanel'] > .text-center.mt-4 {
    margin-top: 0.65rem !important;
  }
}

/* v49: compact phones (including Galaxy S10e) must keep the password action
   reachable without clipping the authentication pane. */
@media (max-width: 430px) and (max-height: 820px) {
  body:has(#login-email) #root,
  body:has(#login-email) #root > .min-h-screen {
    min-height: 100dvh;
  }

  body:has(#login-email) #root > .min-h-screen {
    height: auto;
    overflow-y: visible;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 {
    flex: 0 0 auto;
    min-height: 100dvh;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    height: 2.65rem;
    margin-top: 2.75rem;
    margin-bottom: 0.75rem;
    background-size: 2.5rem;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center::after {
    font-size: 1.2rem;
  }

  body:has(#login-email) #root [role='tablist'] {
    min-height: 2.45rem;
  }

  body:has(#login-email) #root [role='tab'] {
    min-height: 2.3rem;
    font-size: 0.81rem;
  }

  body:has(#login-email) #root [role='tabpanel'] {
    margin-top: 0.65rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] > .space-y-2.mb-6 {
    margin-bottom: 0.65rem !important;
  }

  body:has(#login-email) #root h2 {
    font-size: 1.5rem;
    line-height: 1.12;
  }

  body:has(#login-email) #root h2 + p {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    line-height: 1.28;
  }

  body:has(#login-email) #root [role='tabpanel'] > button,
  body:has(#login-email) #root input,
  body:has(#login-email) #root button[type='submit'] {
    height: 2.75rem !important;
    min-height: 2.75rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] > button {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  body:has(#login-email) #root .relative.my-4 {
    margin-top: 0.45rem !important;
    margin-bottom: 0.45rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] form.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.6rem !important;
  }

  body:has(#login-email) #root [role='tabpanel'] form .space-y-2 > label {
    margin-bottom: 0.35rem !important;
    font-size: 0.78rem;
  }

  body:has(#login-email) #root [role='tabpanel'] form .text-xs.text-muted-foreground {
    margin-top: 0.6rem !important;
    margin-bottom: 0.6rem !important;
    font-size: 0.7rem;
    line-height: 1.22;
  }

  body:has(#login-email) #root [role='tabpanel'] > .text-center.mt-4 {
    margin-top: 0.7rem !important;
  }
}

@media (max-width: 430px) and (max-height: 660px) {
  body:has(#login-email) #root h2 + p {
    display: none;
  }

  body:has(#login-email) #root > .min-h-screen > .flex-1 > .max-w-md > .text-center {
    margin-top: 2.35rem;
    margin-bottom: 0.45rem;
  }
}
