/* Aviveil Split-Screen Login & B1 Solutions Branding Stylesheet */

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-tight-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-tight-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Full Viewport Login Layer */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: #000000;
  color: #ffffff;
  font-family: "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, "Inter Tight", Inter, Arial, sans-serif;
  display: flex;
  align-items: stretch;
  padding: 14px;
  box-sizing: border-box;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 0;
  -webkit-font-smoothing: antialiased;
}

/* Dynamic Interactive 3D Particle Wave Canvas */
.login-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  background-color: #000000;
  display: block;
}

/* Left Panel */
.login-left-panel {
  flex: 1 1 50%;
  min-width: 0;
  position: relative;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  user-select: none;
  z-index: 2;
  pointer-events: none;
}

/* SVG Geometric Guidelines */
.login-lines-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Top-Left Brand Wordmark */
.login-brand-top {
  position: absolute;
  top: 24px;
  left: 28px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
  text-decoration: none;
  pointer-events: auto;
}

.login-brand-logo-small {
  height: 26px;
  width: auto;
  object-fit: contain;
  display: block;
}

.login-brand-text {
  color: #ffffff;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Centre B1 Mark */
.login-center-mark-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}

.login-center-mark {
  height: 136px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
  animation: b1FadeIn 600ms ease-out forwards;
}

@keyframes b1FadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Bottom-Left Copyright */
.login-left-footer {
  position: absolute;
  bottom: 24px;
  left: 28px;
  z-index: 5;
  font-size: 11px;
  color: #6b6b6b;
  letter-spacing: -0.01em;
  line-height: 1.4;
  pointer-events: auto;
}

/* 1px Vertical Divider */
.login-divider {
  width: 1px;
  background-color: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  margin: 0 10px;
  z-index: 2;
}

/* Right Rounded Glassmorphism Card */
.login-right-card {
  flex: 1 1 50%;
  min-width: 0;
  position: relative;
  border-radius: 28px;
  background-color: rgba(18, 19, 23, 0.74);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  z-index: 3;
}

/* Top-Right Language Switch */
.login-lang-switch {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.login-lang-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  font-size: 12px;
  color: #8a8a8a;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: color 0.15s ease;
}

.login-lang-btn:hover {
  color: #ffffff;
}

.login-lang-btn.active {
  color: #ffffff;
  font-weight: 600;
  cursor: default;
}

.login-lang-sep {
  color: #4a4a4a;
  user-select: none;
}

/* Card Content Flow */
.login-card-content {
  margin-top: clamp(80px, 16vh, 180px);
  padding: 0 clamp(28px, 6vw, 64px);
  max-width: 580px;
  width: 100%;
  box-sizing: border-box;
}

.login-overline {
  font-size: 11px;
  color: #8a8a8a;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}

.login-heading {
  font-size: clamp(48px, 5.2vw, 72px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0 0 clamp(24px, 4vh, 38px) 0;
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.login-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin-bottom: 14px;
}

.login-field-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.login-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.login-input-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #4a4a4a;
  border-radius: 0;
  color: #ffffff;
  font-size: 17px;
  font-weight: 400;
  padding: 8px 0;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.login-input:focus {
  border-bottom-color: #ffffff;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.login-eye-btn {
  position: absolute;
  right: 0;
  bottom: 8px;
  background: none;
  border: none;
  padding: 2px 4px;
  margin: 0;
  cursor: pointer;
  color: #8a8a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: color 0.15s ease;
}

.login-eye-text {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-eye-btn:hover,
.login-eye-btn:focus-visible {
  color: #ffffff;
}

/* Options Row: Remember Me & Forgot */
.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  width: 100%;
  font-size: 12px;
}

.login-remember-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: #8a8a8a;
  transition: color 0.15s ease;
}

.login-remember-wrap:hover {
  color: #ffffff;
}

.login-hidden-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.login-checkbox-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #4a4a4a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.login-hidden-checkbox:checked + .login-checkbox-circle {
  border-color: #ffffff;
}

.login-hidden-checkbox:focus-visible + .login-checkbox-circle {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.login-check-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.login-hidden-checkbox:checked + .login-checkbox-circle .login-check-indicator {
  opacity: 1;
}

.login-subtext {
  font-size: 12px;
  letter-spacing: -0.01em;
}

.login-forgot-btn {
  background: none;
  border: none;
  padding: 4px 0;
  margin: 0;
  font-size: 12px;
  color: #8a8a8a;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease;
}

.login-forgot-btn:hover,
.login-forgot-btn:focus-visible {
  color: #ffffff;
}

/* Inline Error Message */
.login-error {
  color: #eab5c0;
  font-size: 12px;
  font-weight: 500;
  margin-top: 16px;
  min-height: 18px;
  line-height: 1.35;
}

/* White Circle SIGN IN Button */
.login-circle-btn {
  position: absolute;
  bottom: 28px;
  right: 28px;
  z-index: 10;
  width: clamp(80px, 8vw, 110px);
  height: clamp(80px, 8vw, 110px);
  border-radius: 50%;
  background-color: #ffffff;
  color: #000000;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: inherit;
  transition: transform 0.15s ease, opacity 0.15s ease;
  outline: none;
  user-select: none;
}

.login-circle-btn:hover:not(:disabled) {
  transform: scale(1.03);
}

.login-circle-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.login-circle-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

.login-circle-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.login-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-top-color: #000000;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

/* Forgot Password Modal */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

.login-modal-card {
  background-color: #171717;
  border: 1px solid #262626;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  animation: modalScaleIn 0.2s ease-out;
}

.login-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.login-modal-body {
  font-size: 13px;
  color: #8a8a8a;
  line-height: 1.5;
  margin-bottom: 24px;
}

.login-modal-btn {
  background-color: #ffffff;
  color: #000000;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
  font-family: inherit;
}

.login-modal-btn:hover {
  transform: scale(1.02);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive Breakpoints */
@media (max-width: 1023px) {
  .login-screen {
    flex-direction: column;
    padding: 12px;
  }
  .login-divider {
    display: none;
  }
  .login-left-panel {
    flex: 0 0 38vh;
    min-height: 240px;
    border-radius: 20px 20px 0 0;
  }
  .login-right-card {
    flex: 1 1 auto;
    min-height: calc(62vh - 24px);
    border-radius: 20px;
    margin-top: 12px;
  }
  .login-card-content {
    margin-top: clamp(40px, 10vh, 80px);
    padding: 0 clamp(20px, 4vw, 36px) 100px;
    max-width: 520px;
  }
  .login-heading {
    font-size: clamp(38px, 6vw, 56px);
    margin-bottom: 24px;
  }
}

@media (max-width: 639px) {
  .login-left-panel {
    flex: 0 0 calc(64px + env(safe-area-inset-top, 0px));
    min-height: calc(64px + env(safe-area-inset-top, 0px));
  }
  .login-lines-svg {
    display: none;
  }
  .login-center-mark-wrap {
    display: none;
  }
  .login-left-footer {
    display: none;
  }
  .login-brand-top {
    top: max(18px, calc(env(safe-area-inset-top, 0px) + 12px));
    left: max(18px, calc(env(safe-area-inset-left, 0px) + 12px));
  }
  .login-lang-switch {
    top: max(18px, calc(env(safe-area-inset-top, 0px) + 12px));
    right: max(18px, calc(env(safe-area-inset-right, 0px) + 12px));
  }
  .login-right-card {
    border-radius: 20px;
  }
  .login-card-content {
    margin-top: 24px;
    padding: 20px 20px max(110px, calc(env(safe-area-inset-bottom, 0px) + 90px));
  }
  .login-input {
    font-size: 16px;
  }
  .login-fields-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .login-circle-btn {
    bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 14px));
    right: max(20px, calc(env(safe-area-inset-right, 0px) + 14px));
    width: 80px;
    height: 80px;
    font-size: 10px;
    touch-action: manipulation;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .login-screen * {
    animation: none !important;
    transition: none !important;
  }
  .login-center-mark {
    opacity: 1 !important;
    transform: none !important;
  }
}
