@import url("variables.css");

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body.honda-auth {
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

/* Full-page layout */
.login-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 64px;
  overflow: hidden;
}

/* Video background (plays when honda-molding-bg.mp4 is present) */
.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Animated industrial fallback - hidden when video loads */
.login-bg-animated {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, #030508 0%, #0a0f1a 35%, #060b14 100%);
  overflow: hidden;
  transition: opacity 0.6s ease;
}

.login-container.has-video .login-bg-animated {
  opacity: 0;
  pointer-events: none;
}

.login-bg-animated::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse 55% 45% at 30% 40%, rgba(0, 212, 255, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 70% 60%, rgba(228, 5, 33, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 45%);
  animation: bg-drift 18s ease-in-out infinite alternate;
}

.login-bg-animated::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(0, 212, 255, 0.03) 60px,
      rgba(0, 212, 255, 0.03) 61px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(0, 212, 255, 0.03) 60px,
      rgba(0, 212, 255, 0.03) 61px
    );
  animation: grid-scroll 24s linear infinite;
}

@keyframes bg-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(4%, -3%) scale(1.08); }
  100% { transform: translate(-3%, 4%) scale(1.05); }
}

@keyframes grid-scroll {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 120px 120px, 120px 120px; }
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 1;
  pointer-events: none;
}

/* Left brand panel */
.brand-content {
  position: relative;
  z-index: 2;
  flex: 1;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.welcome-heading {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-glass-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 360px;
  height: 360px;
  padding: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 212, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.logo-glass-container::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 60deg,
    rgba(0, 212, 255, 0.8) 90deg,
    rgba(228, 5, 33, 0.6) 120deg,
    rgba(0, 212, 255, 0.8) 150deg,
    transparent 180deg,
    transparent 360deg
  );
  animation: rotate-border 4s linear infinite;
  z-index: -1;
  filter: blur(8px);
}

@keyframes rotate-border {
  to { transform: rotate(360deg); }
}

.brand-logo-img {
  height: 240px;
  width: auto;
  position: relative;
  z-index: 2;
}

.tagline p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 420px;
}

/* Login card - match Titan indxo login proportions */
.login-card {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 100%;
  max-width: 380px;
  padding: 28px 30px 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 25px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), inset 0 1px rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 8px;
  line-height: 0;
}

.login-logo-img {
  width: auto;
  height: 40px;
  max-width: 140px;
  object-fit: contain;
  display: block;
  filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.login-subtitle {
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.7);
}

/* Alerts */
.login-alert {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.login-alert.is-visible { display: block; }

.login-alert--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

.login-alert--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

/* Form */
.login-form .form-group {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
}

.login-form .form-control {
  width: 100%;
  padding: 12px 15px;
  font-size: 1rem;
  font-family: var(--font-ui);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form .form-control::placeholder {
  color: var(--text-muted);
}

.login-form .form-control:focus {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.login-form .form-control:-webkit-autofill,
.login-form .form-control:-webkit-autofill:hover,
.login-form .form-control:-webkit-autofill:focus,
.login-form .form-control:-webkit-autofill:active {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.92) inset !important;
  box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.92) inset !important;
  transition: background-color 9999s ease-out, color 9999s ease-out;
}

.password-field {
  position: relative;
  display: block;
}

.password-field .form-control,
.password-field .input {
  padding-right: 46px;
}

.password-field > .password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 50%;
  background: rgba(8, 15, 30, 0.82);
  color: #00d4ff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.password-field > .password-toggle:hover,
.password-field > .password-toggle:focus {
  color: #fff;
  border-color: rgba(0, 212, 255, 0.7);
  background: rgba(0, 212, 255, 0.22);
  outline: none;
}

.password-toggle__icon {
  display: block;
  pointer-events: none;
}

.login-form .form-control.is-invalid {
  border-color: rgba(239, 68, 68, 0.65);
}

.field-error {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #fca5a5;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.remember-me input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
}

.forgot-password {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-decoration: none;
}

.forgot-password:hover {
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  padding: 12px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #00bcd4;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-login:hover:not(:disabled) {
  background: #00acc1;
}

.btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-footer {
  margin-top: 16px;
  padding-top: 0;
  border-top: none;
  text-align: center;
}

.login-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.login-footer a {
  color: var(--accent-cyan);
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover { text-decoration: underline; }

.validation-summary-errors {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-input);
  color: #fecaca;
  font-size: 0.875rem;
}

.validation-summary-valid {
  display: none;
  margin: 0;
  padding: 0;
}

.validation-summary-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .login-container {
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    gap: 32px;
  }

  .brand-content {
    align-items: center;
    text-align: center;
    max-width: 100%;
  }

  .logo-glass-container {
    width: 260px;
    height: 260px;
    padding: 36px;
  }

  .brand-logo-img { width: 160px; }

  .tagline p { max-width: 100%; }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 20px 22px; }
  .logo-glass-container { width: 220px; height: 220px; }
}
