/* Enterprise auth system for VulTech.
   Purposefully restrained: split-screen, low-noise surfaces, 8px radius max. */

:root {
  --vt-green: #A3E635;
  --vt-navy-start: #0B1220;
  --vt-navy-end: #0F172A;
  --vt-text-dark: #0F172A;
  --vt-text-light: #E2E8F0;
  --vt-muted: #64748B;
  --vt-border: #E2E8F0;
  --vt-white: #FFFFFF;
  --vt-error: #B91C1C;
  --vt-error-bg: #FEF2F2;
  --vt-success: #166534;
  --vt-success-bg: #F0FDF4;
  --vt-auth-page: #F4F7FB;
  --vt-auth-page-end: #EDF2F7;
  --vt-auth-panel: #FFFFFF;
  --vt-auth-field: #FFFFFF;
  --vt-auth-field-hover: #F1F5F9;
  --vt-auth-text: #0F172A;
  --vt-auth-muted: #52637A;
  --vt-auth-placeholder: #718096;
  --vt-auth-border: #CBD5E1;
  --vt-auth-toggle: #FFFFFF;
  --vt-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --vt-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

html.dark {
  --vt-auth-page: #050D18;
  --vt-auth-page-end: #091524;
  --vt-auth-panel: #0B1728;
  --vt-auth-field: #101F32;
  --vt-auth-field-hover: #17283C;
  --vt-auth-text: #F8FAFC;
  --vt-auth-muted: #B0BFD1;
  --vt-auth-placeholder: #8293AA;
  --vt-auth-border: #31445B;
  --vt-auth-toggle: #132238;
  --vt-error: #FCA5A5;
  --vt-error-bg: rgba(127, 29, 29, 0.28);
  --vt-success: #86EFAC;
  --vt-success-bg: rgba(20, 83, 45, 0.28);
}

html.dark,
html.light {
  background: var(--vt-navy-start);
}

.enterprise-auth {
  min-height: 100vh;
  margin: 0;
  color: var(--vt-auth-text);
  background: var(--vt-auth-page);
  color-scheme: light;
}

html.dark .enterprise-auth {
  color-scheme: dark;
}

/* A theme swap must never pass through a low-contrast intermediate palette. */
html.auth-theme-changing .enterprise-auth *,
html.auth-theme-changing .auth-theme-toggle {
  transition: none !important;
}

.enterprise-auth__shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 42vw) minmax(0, 1fr);
  min-width: 0;
}

.enterprise-auth__brand {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: var(--vt-text-light);
  background: linear-gradient(180deg, var(--vt-navy-start), var(--vt-navy-end));
  transition-property: none;
}

.enterprise-auth__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--vt-white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: opacity 140ms var(--vt-ease-out);
}

.enterprise-auth__logo:hover {
  opacity: 0.86;
}

.enterprise-auth__logo-mark {
  width: 24px;
  height: 24px;
  color: var(--vt-green);
}

.enterprise-auth__brand-copy {
  max-width: 460px;
}

.enterprise-auth__deployment-label {
  margin: 0 0 16px;
  color: var(--vt-green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.enterprise-auth__headline {
  margin: 0;
  color: var(--vt-white);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0;
}

.enterprise-auth__support {
  margin: 22px 0 0;
  color: var(--vt-text-light);
  font-size: 16px;
  line-height: 1.7;
}

.enterprise-auth__footnote {
  margin: 0;
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
  line-height: 1.6;
}

.enterprise-auth__form-side {
  display: flex;
  min-height: 100vh;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 84% 12%, rgba(163, 230, 53, 0.08), transparent 28%),
    linear-gradient(180deg, var(--vt-auth-page) 0%, var(--vt-auth-page-end) 100%);
  transition-property: none;
}

.enterprise-auth__panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 440px;
  padding: 40px;
  border: 1px solid var(--vt-auth-border);
  border-radius: 8px;
  background: var(--vt-auth-panel);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 28px 80px rgba(15, 23, 42, 0.10);
  transition-property: none;
}

.enterprise-auth__eyebrow {
  margin: 0 0 12px;
  color: var(--vt-auth-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.enterprise-auth__title {
  margin: 0;
  color: var(--vt-auth-text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.enterprise-auth__subtitle {
  margin: 10px 0 0;
  color: var(--vt-auth-muted);
  font-size: 15px;
  line-height: 1.6;
}

.enterprise-auth__form {
  margin-top: 28px;
  min-width: 0;
}

.enterprise-auth__field {
  margin-top: 18px;
  min-width: 0;
}

.enterprise-auth__field:first-child {
  margin-top: 0;
}

.enterprise-auth__field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.enterprise-auth__label {
  display: block;
  margin-bottom: 7px;
  color: var(--vt-auth-text);
  font-size: 14px;
  font-weight: 600;
}

.enterprise-auth__input-wrap {
  position: relative;
  min-width: 0;
}

.enterprise-auth__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--vt-auth-border);
  border-radius: 6px;
  background: var(--vt-auth-field);
  color: var(--vt-auth-text);
  caret-color: var(--vt-auth-text);
  font-size: 15px;
  line-height: 1.5;
  transition:
    border-color 150ms var(--vt-ease-out),
    box-shadow 150ms var(--vt-ease-out),
    background-color 150ms var(--vt-ease-out);
}

.enterprise-auth__input::placeholder {
  color: var(--vt-auth-placeholder);
  opacity: 1;
}

.enterprise-auth .enterprise-auth__input:-webkit-autofill,
.enterprise-auth .enterprise-auth__input:-webkit-autofill:hover,
.enterprise-auth .enterprise-auth__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--vt-auth-text) !important;
  caret-color: var(--vt-auth-text) !important;
  box-shadow: 0 0 0 1000px var(--vt-auth-field) inset !important;
}

.enterprise-auth__input:focus {
  outline: none;
  border-color: var(--vt-green);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.18);
}

.enterprise-auth__input[aria-invalid="true"],
.enterprise-auth__input.input-error,
.enterprise-auth__input.error {
  border-color: var(--vt-error);
}

.enterprise-auth__password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--vt-auth-muted);
  cursor: pointer;
  transition:
    color 140ms var(--vt-ease-out),
    background-color 140ms var(--vt-ease-out),
    transform 140ms var(--vt-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .enterprise-auth__password-toggle:hover {
    background: rgba(226, 232, 240, 0.22);
    color: var(--vt-auth-text);
  }
}

.enterprise-auth__password-toggle:active {
  transform: translateY(-50%) scale(0.94);
}

.enterprise-auth__password-toggle:focus-visible,
.enterprise-auth__link:focus-visible,
.enterprise-auth__checkbox:focus-visible,
.enterprise-auth__button:focus-visible,
.enterprise-auth__secondary:focus-visible,
.auth-theme-toggle:focus-visible {
  outline: 2px solid var(--vt-green);
  outline-offset: 2px;
}

.enterprise-auth__password-toggle svg {
  width: 18px;
  height: 18px;
}

.enterprise-auth__input--password {
  padding-right: 44px;
}

.enterprise-auth__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.enterprise-auth__check-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--vt-auth-muted);
  font-size: 14px;
}

.enterprise-auth__checkbox {
  display: grid;
  place-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  appearance: none;
  border: 1px solid var(--vt-auth-border);
  border-radius: 4px;
  background: var(--vt-auth-field);
  cursor: pointer;
  transition:
    background-color 140ms var(--vt-ease-out),
    border-color 140ms var(--vt-ease-out),
    box-shadow 140ms var(--vt-ease-out);
}

.enterprise-auth__checkbox::before {
  content: "";
  width: 8px;
  height: 8px;
  transform: scale(0.82);
  opacity: 0;
  border-radius: 2px;
  background: var(--vt-text-dark);
  transition:
    opacity 120ms var(--vt-ease-out),
    transform 120ms var(--vt-ease-out);
}

.enterprise-auth__checkbox:checked {
  border-color: var(--vt-green);
  background: var(--vt-green);
}

.enterprise-auth__checkbox:checked::before {
  transform: scale(1);
  opacity: 1;
}

.enterprise-auth__link {
  color: var(--vt-auth-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 140ms var(--vt-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .enterprise-auth__link:hover {
    color: var(--vt-auth-text);
    text-decoration: underline;
  }
}

.enterprise-auth__button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--vt-green);
  border-radius: 6px;
  background: var(--vt-green);
  color: var(--vt-text-dark);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms var(--vt-ease-out),
    filter 140ms var(--vt-ease-out),
    box-shadow 140ms var(--vt-ease-out),
    background-color 140ms var(--vt-ease-out),
    border-color 140ms var(--vt-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .enterprise-auth__button:hover {
    filter: brightness(0.97);
    box-shadow: 0 12px 26px rgba(163, 230, 53, 0.18);
  }
}

.enterprise-auth__button:active {
  transform: scale(0.97);
}

.enterprise-auth__button-label {
  transition:
    filter 180ms var(--vt-ease-out),
    opacity 180ms var(--vt-ease-out);
}

.enterprise-auth__button.is-loading .enterprise-auth__button-label {
  filter: blur(1px);
  opacity: 0.72;
}

.enterprise-auth__button:disabled {
  border-color: var(--vt-auth-border);
  background: var(--vt-auth-border);
  color: var(--vt-auth-muted);
  cursor: wait;
  box-shadow: none;
  transform: none;
}

.enterprise-auth__divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--vt-auth-muted);
  font-size: 13px;
}

.enterprise-auth__divider::before,
.enterprise-auth__divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--vt-auth-border);
}

.enterprise-auth__social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.enterprise-auth__secondary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--vt-auth-border);
  border-radius: 6px;
  background: var(--vt-auth-field);
  color: var(--vt-auth-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 140ms var(--vt-ease-out),
    background-color 140ms var(--vt-ease-out),
    border-color 140ms var(--vt-ease-out),
    box-shadow 140ms var(--vt-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .enterprise-auth__secondary:hover {
    border-color: var(--vt-auth-border);
    background: var(--vt-auth-field-hover);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  }
}

.enterprise-auth__secondary:active {
  transform: scale(0.97);
}

.enterprise-auth__secondary svg {
  width: 18px;
  height: 18px;
}

/* Keep the external provider choice as prominent and aligned as the primary action. */
.enterprise-auth__google-button {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 0 48px;
  border-color: var(--vt-auth-border);
  background: var(--vt-auth-field);
  font-size: 15px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.enterprise-auth__google-icon {
  position: absolute;
  left: 16px;
  width: 20px !important;
  height: 20px !important;
}

@media (hover: hover) and (pointer: fine) {
  .enterprise-auth__google-button:hover {
    border-color: #94A3B8;
    background: var(--vt-auth-field-hover);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
}

.enterprise-auth__bottom {
  margin: 22px 0 0;
  color: var(--vt-auth-muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.enterprise-auth__message {
  display: none;
  margin: 0 0 18px;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  transition:
    opacity 180ms var(--vt-ease-out),
    transform 180ms var(--vt-ease-out);
}

.enterprise-auth__message.is-visible {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);

  @starting-style {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
}

.enterprise-auth__message--error {
  border: 1px solid rgba(185, 28, 28, 0.22);
  background: var(--vt-error-bg);
  color: var(--vt-error);
}

.enterprise-auth__message--success {
  border: 1px solid rgba(22, 101, 52, 0.2);
  background: var(--vt-success-bg);
  color: var(--vt-success);
}

.enterprise-auth__error-text {
  display: none;
  margin-top: 6px;
  color: var(--vt-error);
  font-size: 13px;
  transition:
    opacity 150ms var(--vt-ease-out),
    transform 150ms var(--vt-ease-out);
}

.enterprise-auth__error-text:not(.hidden) {
  display: block;
  opacity: 1;
  transform: translateY(0);

  @starting-style {
    opacity: 0;
    transform: translateY(-3px);
  }
}

.enterprise-auth .input-success,
.enterprise-auth .valid {
  border-color: var(--vt-auth-border) !important;
  box-shadow: none !important;
}

.enterprise-auth .auth-theme-toggle {
  border-color: var(--vt-auth-border);
  background: var(--vt-auth-toggle);
  color: var(--vt-auth-muted);
}

.enterprise-auth .auth-theme-toggle:hover {
  border-color: var(--vt-auth-muted);
  color: var(--vt-auth-text);
}

.auth-theme-icon-sun {
  display: none;
}

html.dark .auth-theme-icon-moon {
  display: none;
}

html.dark .auth-theme-icon-sun {
  display: block;
}

.enterprise-auth .input-error,
.enterprise-auth .error {
  border-color: var(--vt-error) !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.08) !important;
}

.enterprise-auth__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15, 23, 42, 0.28);
  border-top-color: var(--vt-text-dark);
  border-radius: 50%;
  animation: enterprise-spin 0.8s linear infinite;
}

.enterprise-auth__spinner:not(.hidden) {
  display: inline-block;
}

@keyframes enterprise-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .enterprise-auth *,
  .enterprise-auth *::before,
  .enterprise-auth *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transform: none !important;
  }

  .enterprise-auth__password-toggle {
    transform: translateY(-50%) !important;
  }
}

@media (max-width: 900px) {
  .enterprise-auth__shell {
    display: block;
  }

  .enterprise-auth__brand {
    min-height: 250px;
    padding: 28px 24px;
  }

  .enterprise-auth__brand-copy {
    margin-top: 42px;
  }

  .enterprise-auth__headline {
    font-size: 32px;
  }

  .enterprise-auth__support {
    max-width: 620px;
    font-size: 15px;
  }

  .enterprise-auth__footnote {
    margin-top: 34px;
  }

  .enterprise-auth__form-side {
    min-height: auto;
    padding: 28px 16px 40px;
  }

  .enterprise-auth__panel {
    max-width: 560px;
    padding: 28px;
  }
}

@media (max-width: 520px) {
  .enterprise-auth__social {
    grid-template-columns: 1fr;
  }

  .enterprise-auth__options {
    align-items: flex-start;
    flex-direction: column;
  }

  .enterprise-auth__panel {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .enterprise-auth__form-side {
    padding: 20px 12px 32px;
  }

  .enterprise-auth__panel {
    padding: 24px 20px;
  }

  .enterprise-auth__field-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .enterprise-auth__field-row .enterprise-auth__label {
    margin-bottom: 0;
  }

  .enterprise-auth__bottom {
    overflow-wrap: anywhere;
  }
}
