/* Shared SaaS auth shell — staff Identity + customer portal */

.auth-shell {
  --auth-accent: var(--color-primary, #1f3a5f);
  --auth-accent-hover: var(--color-primary-hover, #162a45);
  --auth-accent-fill: var(--color-primary-action, var(--auth-accent));
  --auth-accent-fill-hover: var(--color-primary-action-hover, var(--auth-accent-hover));
  --auth-accent-soft: rgba(31, 58, 95, 0.12);
  --auth-accent-glow: rgba(59, 130, 246, 0.15);
  --auth-focus-ring: var(--focus-ring, 0 0 0 3px rgba(31, 58, 95, 0.22));
  --auth-font-body: var(--font-family-ui, Inter, system-ui, sans-serif);
  --auth-panel-dark: #0f172a;
  --auth-panel-dark-elevated: #1e293b;
  --auth-panel-photo: url("/images/auth-panel.jpg");

  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  position: relative;
  font-family: var(--auth-font-body);
  color: var(--color-text, #111827);
  background: var(--color-surface, #fff);
}

/* --- Brand panel -------------------------------------------------------- */

.auth-shell__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-5, 24px) var(--space-6, 32px);
  overflow: hidden;
  background-color: var(--auth-panel-dark);
  color: #fff;
  isolation: isolate;
}

.auth-shell__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--auth-panel-photo);
  background-size: cover;
  background-position: center 35%;
  transform: scale(1.04);
  pointer-events: none;
}

.auth-shell__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(155deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.55) 42%, rgba(15, 23, 42, 0.88) 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.35));
  pointer-events: none;
}

.auth-shell__brand-inner {
  position: relative;
  z-index: 2;
  max-width: 22rem;
}

.auth-shell__identity {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-4, 16px);
}

.auth-shell__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-3, 12px);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-shell__mark svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.auth-shell__logo {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

.auth-shell__tagline {
  margin: 0;
  font-size: var(--font-size-base, 1rem);
  line-height: var(--line-height-relaxed, 1.5);
  color: rgba(255, 255, 255, 0.62);
}

.auth-shell__persona {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-5, 24px);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* --- Form panel --------------------------------------------------------- */

.auth-shell__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5, 24px);
  padding-bottom: calc(var(--space-6, 32px) + env(safe-area-inset-bottom, 0px));
  background: var(--color-surface, #fff);
}

.auth-shell__main-inner {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 24px);
  animation: auth-shell-enter 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-shell__toolbar {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2, 8px);
}

.auth-shell__theme.ga-theme,
.auth-shell__culture {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-3, 12px);
  background: color-mix(in srgb, var(--color-surface, #fff) 92%, transparent);
  border: 1px solid var(--color-border, #e5e7eb);
  box-shadow: var(--elevation-1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-shell__culture .ga-culture-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-2, 8px);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #6b7280);
  text-decoration: none;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.auth-shell__culture .ga-culture-link:hover {
  color: var(--auth-accent);
}

.auth-shell__culture .ga-culture-link.is-active {
  color: var(--auth-accent);
  background: var(--color-surface, #fff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.auth-shell__culture .ga-culture-sep {
  display: none;
}

.auth-card,
.auth-shell__content {
  width: 100%;
}

.auth-card__title {
  margin: 0 0 var(--space-2, 8px);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text-strong, #111827);
}

.auth-card__subtitle {
  margin: 0 0 var(--space-5, 24px);
  font-size: var(--font-size-base, 1rem);
  line-height: var(--line-height-relaxed, 1.5);
  color: var(--color-text-muted, #6b7280);
}

.auth-shell__footer {
  margin: 0;
  text-align: center;
  font-size: var(--font-size-sm, 0.875rem);
}

.auth-shell__footer-link {
  color: var(--color-text-muted, #6b7280);
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease;
}

.auth-shell__footer-link:hover {
  color: var(--auth-accent);
}

.auth-shell__footer-link::before {
  content: "← ";
}

@keyframes auth-shell-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Desktop split ------------------------------------------------------ */

@media (min-width: 900px) {
  .auth-shell {
    grid-template-columns: 42fr 58fr;
    grid-template-rows: 1fr;
  }

  .auth-shell__brand {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(2.5rem, 5vw, 4rem);
  }

  .auth-shell__brand-inner {
    max-width: 24rem;
  }

  .auth-shell__logo {
    font-size: 1.75rem;
  }

  .auth-shell__tagline {
    font-size: 1.0625rem;
  }

  .auth-shell__main {
    padding: clamp(2rem, 4vw, 3rem);
  }

  .auth-shell__main-inner {
    max-width: 24rem;
  }

  .auth-card__title {
    font-size: 1.75rem;
  }
}

@media (max-width: 899px) {
  .auth-shell__brand {
    min-height: 7.5rem;
    padding: var(--space-4, 16px) var(--space-5, 24px);
    padding-right: 6.5rem;
  }

  .auth-shell__brand::before {
    background-position: center 45%;
  }

  .auth-shell__brand::after {
    background:
      linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.75) 100%);
  }

  .auth-shell__identity {
    margin-bottom: 0;
  }

  .auth-shell__tagline,
  .auth-shell__persona {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell__main-inner {
    animation: none;
  }

  .auth-shell__culture .ga-culture-link,
  .auth-shell__footer-link {
    transition: none;
  }
}
