/**
 * VelocityEHS Accelerate — Login Page
 * Requires tokens.css loaded first.
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--white);
  min-height: 100vh;
  margin: 0;
}

body.login-page {
  overflow: hidden;
  background: var(--white);
}

.background-pattern {
  display: none;
}

/* Full-bleed split: white login column (flex) + portrait hero pinned right */
.login-split {
  display: flex;
  align-items: stretch;
  height: 100vh;
  min-height: 100vh;
  width: 100%;
  background: var(--white);
}

.login-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  overflow-y: auto;
  padding: var(--space-5) var(--space-4);
}

.login-main-inner {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.login-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.login-brand-logo-wrap {
  display: block;
  height: 36px;
  width: 160px;
  overflow: hidden;
  flex-shrink: 0;
}

.login-brand-logo {
  display: block;
  height: 36px;
  width: 285px;
  max-width: none;
}

.login-brand-divider {
  display: inline-block;
  width: 1px;
  height: 32px;
  background: var(--gray-100);
  flex-shrink: 0;
}

.login-brand-product {
  font-size: var(--text-size-5);
  font-weight: var(--font-weight-regular);
  color: var(--gray-100);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.login-main-footer {
  margin-top: var(--space-5);
  font-size: var(--text-size-1);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.login-hero-panel {
  flex: 0 0 auto;
  align-self: stretch;
  position: relative;
  background: var(--gray-100);
}

/* Portrait hero — edge-to-edge full viewport height (823×1024 asset) */
.login-hero-panel--portrait {
  height: 100vh;
  width: calc(100vh * 823 / 1024);
  max-width: 50vw;
  min-width: 260px;
  overflow: hidden;
  line-height: 0;
}

/* Click target aligned to the baked-in CTA pill in ih-login-hero-ergo-ai.png (823×1024) */
.login-hero-demo-hit {
  position: absolute;
  left: 9%;
  top: 57.2%;
  width: 44%;
  height: 5.4%;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  z-index: 2;
  box-sizing: border-box;
}

.login-hero-demo-hit:hover,
.login-hero-demo-hit:focus-visible {
  outline: none;
  background: rgba(134, 188, 37, 0.12);
  box-shadow: 0 0 0 2px var(--green-65);
}

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

.login-hero-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
  object-position: center top;
}

.login-hero-panel--stacked {
  background-size: cover;
  background-position: center top;
}

.login-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: var(--space-6);
  background: linear-gradient(
    115deg,
    rgba(10, 49, 66, 0.92) 0%,
    rgba(10, 49, 66, 0.78) 45%,
    rgba(28, 31, 39, 0.55) 100%
  );
  box-sizing: border-box;
}

.login-hero-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.login-hero-brand {
  margin: 0 0 var(--space-4);
  font-size: var(--text-size-5);
  font-weight: var(--font-weight-semibold);
  color: var(--green-65);
  letter-spacing: 0.01em;
}

.login-hero-headline {
  margin: 0 0 var(--space-4);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: var(--font-weight-semibold);
  color: var(--white);
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.login-hero-highlight {
  color: var(--green-65);
}

.login-hero-sub {
  margin: 0 0 var(--space-4);
  font-size: var(--text-size-4);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 460px;
}

.login-demo-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px var(--space-4);
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--white);
  font-family: var(--font-family);
  font-size: var(--text-size-3);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.15s, transform 0.15s;
}

.login-demo-cta:hover {
  background: var(--gray-90);
  color: var(--white);
  transform: translateY(-1px);
}

.login-demo-cta:focus-visible {
  outline: 2px solid var(--green-65);
  outline-offset: 3px;
}

.login-demo-arrow {
  font-size: var(--text-size-4);
  line-height: 1;
}

.login-hero-frame {
  position: absolute;
  right: 8%;
  bottom: 12%;
  width: min(280px, 36vw);
  height: min(280px, 36vw);
  border: 3px solid var(--green-65);
  border-radius: 50%;
  opacity: 0.35;
  pointer-events: none;
}

.login-hero-frame::before {
  content: '';
  position: absolute;
  top: -18px;
  left: -18px;
  right: -18px;
  bottom: -18px;
  border: 2px solid var(--green-65);
  border-radius: 4px;
  opacity: 0.5;
}

/* Legacy card layout (fallback if old markup remains) */
.main-container {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  min-height: 500px;
  position: relative;
  z-index: 1;
  margin: auto;
}

.info-panel {
  flex: 1;
  background: var(--color-nav-bg);
  color: var(--white);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-panel h2 {
  font-size: var(--text-size-6);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-4);
}

.info-panel .velocity {
  font-weight: var(--font-weight-semibold);
}

.info-panel p {
  font-size: var(--text-size-4);
  line-height: 1.6;
  margin-bottom: var(--space-5);
  opacity: 0.9;
}

.feature-list {
  list-style: none;
}

.feature-list li {
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
  font-size: var(--text-size-3);
}

.feature-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green-65);
  font-weight: var(--font-weight-semibold);
}

.login-panel {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-card);
  box-shadow: none;
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-4);
  margin-top: 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.login-header h3 {
  color: var(--color-primary);
  font-size: var(--text-size-6);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.login-header p {
  color: var(--color-primary);
  font-size: var(--text-size-5);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.5px;
}

.form-group {
  margin-bottom: var(--space-4);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-size-3);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px var(--space-3);
  border: 1px solid var(--blue-45);
  border-radius: var(--radius-input);
  font-size: var(--text-size-4);
  font-family: var(--font-family);
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--color-background);
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(24, 123, 165, 0.2);
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 50px var(--white) inset;
  -webkit-text-fill-color: var(--color-text-primary);
}

.login-btn {
  width: 100%;
  background: var(--color-primary);
  color: var(--white);
  border: none;
  padding: var(--space-3);
  border-radius: var(--radius-btn);
  font-size: var(--text-size-4);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: var(--space-4);
}

.login-btn:hover {
  background: var(--blue-70);
  box-shadow: var(--shadow-hover);
}

.forgot-password,
.back-to-login {
  text-align: center;
  color: var(--color-link);
  text-decoration: none;
  font-size: var(--text-size-3);
  font-weight: var(--font-weight-semibold);
}

.forgot-password:hover,
.back-to-login:hover {
  text-decoration: underline;
}

.forgot-panel,
.reset-panel {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-card);
  box-shadow: none;
}

.forgot-header,
.reset-header {
  text-align: center;
  margin-bottom: var(--space-5);
}

.forgot-header h3,
.reset-header h3 {
  color: var(--color-primary);
  font-size: var(--text-size-6);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.forgot-header p,
.reset-header p {
  color: var(--color-text-secondary);
  font-size: var(--text-size-3);
}

.send-btn,
.reset-btn {
  width: 100%;
  background: var(--color-primary);
  color: var(--white);
  border: none;
  padding: var(--space-3);
  border-radius: var(--radius-btn);
  font-size: var(--text-size-4);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: var(--space-4);
}

.send-btn:hover,
.reset-btn:hover {
  background: var(--blue-70);
  box-shadow: var(--shadow-hover);
}

.instructions {
  background: var(--color-background);
  border-left: 4px solid var(--color-primary);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-input);
  font-size: var(--text-size-3);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

input[type="email"] {
  width: 100%;
  padding: 14px var(--space-3);
  border: 1px solid var(--blue-45);
  border-radius: var(--radius-input);
  font-size: var(--text-size-4);
  font-family: var(--font-family);
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--color-background);
}

input[type="email"]:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(24, 123, 165, 0.2);
}

.alert {
  padding: 12px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-input);
  font-size: var(--text-size-3);
  text-align: center;
}

.alert-error {
  background-color: var(--color-error-bg);
  color: var(--red-80);
  border: 1px solid var(--red-30);
}

.alert-success {
  background-color: var(--color-success-bg);
  color: var(--green-80);
  border: 1px solid var(--green-30);
}

/* Auth / session status page (autherr.jsp) */
.auth-panel {
  text-align: center;
}

.auth-header {
  margin-top: 0;
}

.auth-header h3 {
  color: var(--color-text-primary);
  font-size: var(--text-size-6);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
}

.auth-header p {
  color: var(--color-text-secondary);
  font-size: var(--text-size-3);
  font-weight: var(--font-weight-regular);
  letter-spacing: normal;
}

.auth-status-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

.auth-status-icon--logout {
  background: var(--color-success-bg);
  color: var(--green-70);
  border: 1px solid var(--green-30);
}

.auth-status-icon--session {
  background: var(--color-error-bg);
  color: var(--red-70);
  border: 1px solid var(--red-30);
}

a.login-btn.auth-return-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  line-height: 1.4;
}

form.auth-return-form {
  margin: 0;
  width: 100%;
}

button.login-btn.auth-return-btn {
  width: 100%;
}

.footer-restriction {
  font-size: 10px;
  font-weight: var(--font-weight-regular);
}

.language-selector {
  text-align: center;
  margin-top: var(--space-4);
}

.language-selector select {
  font-family: var(--font-family);
  font-size: var(--text-size-3);
  border: 1px solid var(--blue-45);
  border-radius: var(--radius-input);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-primary);
  background: var(--white);
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-size-1);
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  z-index: 1000;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-left {
  font-weight: var(--font-weight-semibold);
}

.footer-right {
  font-style: italic;
  color: var(--blue-45);
}

#login-language-switcher {
  text-align: center;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 960px) {
  body.login-page {
    overflow: auto;
  }

  .login-split {
    flex-direction: column;
  }

  .login-main {
    flex: none;
    min-height: auto;
    padding: var(--space-5) var(--space-3);
  }

  .login-hero-panel--portrait {
    height: auto;
    width: 100%;
    max-width: none;
    min-height: 0;
  }

  .login-hero-img {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    max-width: 100%;
    object-fit: cover;
    object-position: center top;
  }

  .login-hero-demo-hit {
    left: 10%;
    top: auto;
    bottom: 28%;
    width: 56%;
    height: 7%;
    transform: none;
  }

  .login-hero-demo-hit:hover,
  .login-hero-demo-hit:focus-visible {
    transform: none;
  }

  .login-hero-frame {
    display: none;
  }

  .login-hero-headline {
    font-size: var(--text-size-6);
  }
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
    margin: var(--space-3);
    max-width: 500px;
  }

  .info-panel {
    order: 2;
    text-align: center;
    padding: var(--space-5);
  }

  .login-panel {
    padding: var(--space-4);
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-1);
  }
}
