/* Login shell — same treatment as crm.ih.uy (suite dark + module accent). */
:root {
  --header-text: #f9fafb;
  --module-accent: hsl(275 70% 62%);
  --module-accent-on: #ffffff;
  --space: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--header-text);
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--module-accent);
  color: var(--module-accent-on);
  font-weight: 600;
  text-decoration: none;
}

.login-skip:focus,
.skip-link:focus {
  top: var(--space);
  z-index: 10;
  outline: 3px solid #22d3ee;
  outline-offset: 2px;
}

.login {
  --login-deep: #050818;
  --login-mid: #0c1445;
  --login-cyan: #22d3ee;
  --login-purple: #7c3aed;
  --login-magenta: #ec4899;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  color-scheme: dark;
  background:
    radial-gradient(ellipse 100% 80% at 50% -10%, rgba(34, 211, 238, 0.18), transparent 55%),
    radial-gradient(circle at 85% 70%, rgba(236, 72, 153, 0.16), transparent 42%),
    radial-gradient(circle at 10% 75%, rgba(124, 58, 237, 0.2), transparent 40%),
    linear-gradient(165deg, var(--login-mid) 0%, var(--login-deep) 52%, #020617 100%);
}

.login-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.65;
  animation: login-float 14s ease-in-out infinite;
}

.login-orb-a {
  width: min(46vw, 360px);
  height: min(46vw, 360px);
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 211, 238, 0.35);
  animation-name: login-float-center;
}

.login-orb-b {
  width: min(36vw, 280px);
  height: min(36vw, 280px);
  bottom: 8%;
  right: 6%;
  background: rgba(236, 72, 153, 0.28);
  animation-delay: -4s;
}

.login-orb-c {
  width: min(28vw, 220px);
  height: min(28vw, 220px);
  bottom: 18%;
  left: 8%;
  background: rgba(124, 58, 237, 0.32);
  animation-delay: -8s;
}

.login-orb-module {
  width: min(22vw, 180px);
  height: min(22vw, 180px);
  top: 42%;
  right: 18%;
  background: color-mix(in srgb, var(--module-accent) 55%, transparent);
  opacity: 0.5;
  animation-delay: -6s;
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 88%);
  animation: login-grid-drift 24s linear infinite;
}

.login-shimmer {
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 58%
  );
  animation: login-shimmer 9s ease-in-out infinite;
}

.login-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 420px);
  padding: 12px 28px 32px;
  text-align: center;
  background: rgba(8, 14, 40, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 20px;
  box-shadow:
    0 28px 64px rgba(2, 6, 23, 0.55),
    0 0 0 1px color-mix(in srgb, var(--module-accent) 18%, transparent) inset,
    0 0 48px rgba(34, 211, 238, 0.08);
  animation: login-card-glow 6s ease-in-out infinite;
}

.login-logo-badge {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* PNG has ~7.5% empty canvas above the art; pull that into the card padding. */
  margin: -6% auto 0;
  background: transparent;
  box-shadow: none;
}

.login-logo {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin-inline: auto;
  background: transparent;
}

.login-card h1,
.login-card p,
.login-btn,
.locale-link,
.login-foot {
  font-family: var(--font);
}

.login-card h1 {
  margin: 0;
  color: var(--header-text);
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.45rem);
  font-weight: 650;
  font-style: normal;
  line-height: 1.25;
}

.login-card .lede,
.login-card .hint {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 22rem;
}

.login-card .lede {
  margin-bottom: 12px;
}

.login-turnstile {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  min-height: 0;
  margin: 0;
  overflow: visible;
  color-scheme: dark;
  background: transparent;
}

.login-turnstile:has(iframe) {
  margin-top: 8px;
}

.login-turnstile iframe {
  color-scheme: dark;
  background: transparent !important;
  border: 0;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: min(100%, 280px);
  margin-top: 4px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--module-accent) 88%, white) 0%,
    var(--module-accent) 52%,
    hsl(265 70% 48%) 100%
  );
  color: var(--module-accent-on);
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 32px color-mix(in srgb, var(--module-accent) 45%, transparent);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.login-error {
  margin: 12px 0 0;
  max-width: 22rem;
  color: #fecaca;
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  text-decoration: none;
}

.login-btn:focus-visible {
  outline: 3px solid var(--login-cyan);
  outline-offset: 3px;
}

.tenant-select {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  text-align: left;
}

.tenant-select-label {
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.tenant-select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 44px 12px 16px;
  border: 1px solid color-mix(in srgb, var(--module-accent) 65%, white);
  border-radius: 12px;
  background-color: rgba(5, 8, 24, 0.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23f9fafb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  color: var(--header-text);
  color-scheme: dark;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
}

.tenant-select select:focus-visible {
  outline: 3px solid var(--login-cyan);
  outline-offset: 3px;
}

.tenant-select .login-btn {
  width: 100%;
  margin-top: 0;
}

.login-card .hint {
  margin-top: 14px;
  font-size: 0.82rem;
}

.login-privacy {
  margin: 24px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.login-privacy a {
  color: #e2e8f0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-privacy a:focus-visible {
  outline: 3px solid var(--login-cyan);
  outline-offset: 3px;
}

.locale-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 20px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.locale-bar .bar-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.locale-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  background: transparent;
}

.locale-link[aria-current="true"] {
  background: color-mix(in srgb, var(--module-accent) 85%, black);
  color: var(--module-accent-on);
}

.locale-link:focus-visible {
  outline: 3px solid var(--login-cyan);
  outline-offset: -3px;
}

.login-card .login-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 0;
  max-width: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: rgba(148, 163, 184, 0.55);
}

.login-mid-logo {
  display: block;
  width: 48px;
  height: 48px;
  background: transparent;
  opacity: 0.92;
}

.login-foot a {
  display: inline-flex;
  line-height: 0;
  color: var(--login-cyan);
  text-decoration: none;
}

.login-foot a:hover {
  color: #f8fafc;
}

.login-foot a:focus-visible {
  outline: 2px solid var(--login-cyan);
  outline-offset: 2px;
}

@keyframes login-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -18px, 0);
  }
}

@keyframes login-float-center {
  0%,
  100% {
    transform: translateX(-50%) translate3d(0, 0, 0);
  }
  50% {
    transform: translateX(-50%) translate3d(0, -18px, 0);
  }
}

@keyframes login-grid-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(40px, 40px, 0);
  }
}

@keyframes login-shimmer {
  0%,
  100% {
    transform: translateX(-30%) rotate(8deg);
    opacity: 0.35;
  }
  50% {
    transform: translateX(30%) rotate(8deg);
    opacity: 0.75;
  }
}

@keyframes login-card-glow {
  0%,
  100% {
    box-shadow:
      0 28px 64px rgba(2, 6, 23, 0.55),
      0 0 0 1px color-mix(in srgb, var(--module-accent) 12%, transparent) inset,
      0 0 48px rgba(34, 211, 238, 0.08);
  }
  50% {
    box-shadow:
      0 28px 64px rgba(2, 6, 23, 0.55),
      0 0 0 1px color-mix(in srgb, var(--module-accent) 22%, transparent) inset,
      0 0 64px rgba(34, 211, 238, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-orb,
  .login-grid,
  .login-shimmer,
  .login-card {
    animation: none;
  }

  .login-orb {
    filter: blur(40px);
    opacity: 0.45;
  }

  .login-btn {
    transition: none;
  }
}

.login-providers {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 280px;
  gap: 12px;
  margin-top: 24px;
}

.login-providers form {
  margin: 0;
}

.auth-cta {
  display: inline-flex;
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 18px rgba(237, 28, 36, 0.55),
    0 0 36px rgba(167, 139, 250, 0.42);
}
.auth-cta:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}
.auth-cta .auth-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.login-providers button[aria-busy="true"] {
  opacity: 1;
  cursor: wait;
}
.login-providers button.is-held:disabled {
  opacity: 1;
  background: #cbd5e1;
  color: #1e293b;
  box-shadow: none;
  cursor: not-allowed;
}
