/* ==========================================================================
   iTradeAIMS Portal Theme - 50/50 Split Pure Dark Theme Login Page
   ========================================================================== */

/* Universal Dark Overrides for Auth Layout */
html,
body,
#portal-app,
.portal-wrapper,
#portal-main,
.portal-page-container {
  background-color: #06090f !important;
  color: #f8fafc !important;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.portal-auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  background-color: #06090f !important;
  color: #f8fafc !important;
}

/* 50 / 50 Split Layout */
.auth-split-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Left Panel: Exactly 50% Width, Pure Radial Gradient, NO Grid, Centered Content
   -------------------------------------------------------------------------- */
.auth-branding-panel {
  flex: 0 0 50%;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background: radial-gradient(circle at 50% 50%, rgba(0, 122, 255, 0.22) 0%, rgba(0, 86, 204, 0.08) 50%, #06090f 90%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 440px;
  width: 100%;
}

.auth-logo-link {
  display: inline-block;
  margin-bottom: 24px;
  text-decoration: none;
}

.auth-logo-img {
  width: auto;
  max-width: 170px;
  height: auto;
  display: block;
  margin: 0;
}

.auth-welcome-title {
  font-size: clamp(2.25rem, 3.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 16px 0;
  color: #ffffff !important;
  text-align: left;
}

.auth-welcome-subtext {
  font-size: 1.125rem;
  color: #94a3b8 !important;
  line-height: 1.7;
  text-align: left;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Right Panel: Exactly 50% Width, Pure Dark Background
   -------------------------------------------------------------------------- */
.auth-form-panel {
  flex: 0 0 50%;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background-color: #080b11 !important;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  background: transparent !important;
}

.auth-card-header {
  margin-bottom: 28px;
}

.auth-card-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff !important;
  margin: 0 0 8px 0;
}

.auth-card-subtitle {
  font-size: 0.9375rem;
  color: #94a3b8 !important;
  margin: 0;
}

/* Inline Alerts */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.auth-alert-error {
  background: rgba(244, 63, 94, 0.12) !important;
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
  color: #fda4af !important;
}

.auth-alert-success {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  color: #34d399 !important;
}

.auth-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Form Groups & Inputs */
.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f8fafc !important;
  margin-bottom: 8px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.auth-form-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background-color: #0e131d !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 9px;
  color: #ffffff !important;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  outline: none;
}

.auth-form-input::placeholder {
  color: #475569;
}

.auth-form-input:focus {
  border-color: #007aff !important;
  background-color: #121824 !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25) !important;
}

.auth-form-input:focus ~ .auth-input-icon {
  color: #007aff;
}

/* Error States */
.auth-input-wrapper.has-error .auth-form-input {
  border-color: rgba(244, 63, 94, 0.55) !important;
  background-color: rgba(244, 63, 94, 0.04) !important;
}

.auth-input-wrapper.has-error .auth-form-input:focus {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2) !important;
}

.auth-input-wrapper.has-error .auth-input-icon {
  color: #f43f5e;
}

/* Password Toggle Button */
.auth-password-toggle {
  position: absolute;
  right: 12px;
  padding: 6px;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition-fast);
}

.auth-password-toggle:hover {
  color: #f8fafc;
}

/* Options Row: Remember Me & Forgot Password */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.875rem;
}

.auth-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8 !important;
  cursor: pointer;
  user-select: none;
}

.auth-remember-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.auth-remember-checkbox:checked {
  background-color: #007aff !important;
  border-color: #007aff !important;
}

.auth-remember-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-link {
  color: #007aff !important;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.auth-link:hover {
  color: #60a5fa !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Submit Button: Apple/Linear Style with Glow */
.auth-submit-btn {
  width: 100%;
  padding: 13px 24px;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #007aff 0%, #0056cc 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 24px -4px rgba(0, 122, 255, 0.55) !important;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-submit-btn:hover {
  background: linear-gradient(180deg, #0a84ff 0%, #0062d2 100%) !important;
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 32px -4px rgba(0, 122, 255, 0.75) !important;
}

/* Support Footer in Card */
.auth-support-row {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8 !important;
}

/* Responsive: Stack vertically below 900px */
@media (max-width: 900px) {
  .auth-split-wrapper {
    flex-direction: column;
  }

  .auth-branding-panel {
    flex: none;
    width: 100%;
    padding: 48px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .auth-form-panel {
    flex: none;
    width: 100%;
    padding: 48px 24px;
  }
}
