/* ==========================================================================
   COMPLAINTPOINT AUTHENTICATION SYSTEM STYLES (auth.css)
   Split-Screen CRO Layout | WCAG 2.2 AA Compliant | Fluid Responsive
   ========================================================================== */

/* Accessible Screen Reader Class */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
}

/* Layout Container */
.auth-page-body {
  min-height: 100vh;
  background-color: var(--color-background, #f8fafc);
  display: flex;
  flex-direction: column;
  color: var(--color-text, #0f172a);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  margin: 0;
  padding: 0;
}

.auth-header-mini {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.auth-header-mini .brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.auth-header-mini .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}

.auth-header-mini .brand-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.auth-header-mini .brand-tag {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-muted, #475569);
  font-weight: 500;
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Split-screen wrapper */
.auth-container {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 72px);
  flex: 1;
}

@media (min-width: 992px) {
  .auth-container {
    grid-template-columns: 1fr 1.15fr;
  }
}

/* Left Showcase Panel (Authority, Trust, Testimonial) */
.auth-showcase {
  display: none;
  background: linear-gradient(145deg, #091224 0%, #0f1e3d 50%, #1e3a8a 100%);
  color: #ffffff;
  padding: 4rem 3.5rem;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 992px) {
  .auth-showcase {
    display: flex;
  }
}

.auth-showcase::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.auth-showcase::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.auth-showcase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 2rem;
  width: fit-content;
}

.auth-showcase-badge svg {
  color: #60a5fa;
}

.auth-showcase-headline {
  font-size: clamp(1.875rem, 1.5rem + 1.2vw, 2.35rem);
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.auth-showcase-subtext {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0 0 2.5rem;
  max-width: 480px;
}

/* Stats Grid on Showcase */
.auth-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 2.5rem;
}

.auth-stat-item h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.auth-stat-item p {
  font-size: 0.775rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
  font-weight: 500;
}

/* Testimonial Quote in Showcase */
.auth-testimonial-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  position: relative;
}

.auth-testimonial-box blockquote {
  margin: 0 0 1rem;
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.auth-testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.auth-author-details {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.auth-author-name {
  font-weight: 700;
  color: #ffffff;
}

.auth-author-title {
  color: #94a3b8;
  font-size: 0.75rem;
}

/* Executive & Human Model Showcase Card */
.auth-model-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 1.25rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.45);
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-model-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 20px 42px -8px rgba(0, 0, 0, 0.55);
}

.auth-model-media {
  position: relative;
  width: 116px;
  height: 145px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.auth-model-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.auth-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 9999px;
  padding: 3px 9px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #86efac;
  letter-spacing: 0.015em;
  margin-bottom: 0.65rem;
  width: fit-content;
}

.auth-model-chip .chip-dot {
  width: 6px;
  height: 6px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #22c55e;
  animation: pulseModelDot 2s infinite ease-in-out;
}

@keyframes pulseModelDot {
  0% { opacity: 0.6; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.6; transform: scale(0.85); }
}

.auth-model-info {
  flex: 1;
  min-width: 0;
}

.auth-model-quote {
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #f1f5f9;
  margin: 0 0 0.75rem;
}

.auth-model-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-model-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.auth-model-name .verified-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.auth-model-title {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
}

@media (max-width: 1200px) {
  .auth-model-media {
    width: 96px;
    height: 120px;
  }
  .auth-model-chip {
    font-size: 0.58rem;
    padding: 1px 5px;
  }
  .auth-model-quote {
    font-size: 0.8125rem;
  }
}

.auth-showcase-footer {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.auth-showcase-footer svg {
  color: #10b981;
}

/* Right Panel: Form Card Container */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1.5rem;
  background-color: var(--color-background, #f8fafc);
}

@media (min-width: 640px) {
  .auth-form-panel {
    padding: 3.5rem 2.5rem;
  }
}

.auth-card {
  width: 100%;
  max-width: 490px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  padding: 2.25rem 2rem;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: 12px;
  }
}

.auth-card-header {
  margin-bottom: 1.75rem;
}

.auth-card-title {
  font-size: clamp(1.35rem, 1.2rem + 0.5vw, 1.625rem);
  font-weight: 800;
  color: var(--color-secondary, #0f172a);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.auth-card-subtitle {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, #475569);
  line-height: 1.5;
  margin: 0;
}

/* Tab Switcher for Business vs Consumer login */
.auth-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted, #475569);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.auth-tab-btn:hover {
  color: var(--color-secondary, #0f172a);
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--color-primary, #1d4ed8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Business Enterprise Policy Notice */
.business-auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.8125rem;
  line-height: 1.45;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.business-auth-notice svg {
  color: #1d4ed8;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Authentication Error Alert */
.auth-alert-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-size: 0.8125rem;
  line-height: 1.45;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.auth-alert-error svg {
  color: #dc2626;
  flex-shrink: 0;
  margin-top: 2px;
}

/* SSO Social Buttons */
.auth-sso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 420px) {
  .auth-sso-grid {
    grid-template-columns: 1fr;
  }
}

.btn-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-secondary, #0f172a);
  background: #ffffff;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-sso:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-sso:focus-visible {
  outline: 2px solid var(--color-primary, #1d4ed8);
  outline-offset: 2px;
}

/* Form Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--color-text-subtle, #64748b);
  font-size: 0.775rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-subtle, #e2e8f0);
}

.auth-divider span {
  padding: 0 0.875rem;
}

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

.form-label-auth {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-secondary, #0f172a);
  margin-bottom: 0.375rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-left {
  position: absolute;
  left: 0.875rem;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.form-control-auth {
  width: 100%;
  padding: 0.72rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--color-secondary, #0f172a);
  background-color: #ffffff;
  border: 1.5px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.form-control-auth:hover {
  border-color: #94a3b8;
}

.form-control-auth:focus {
  outline: none;
  border-color: var(--color-primary, #1d4ed8);
  box-shadow: 0 0 0 3.5px rgba(29, 78, 216, 0.12);
}

.input-with-icon .form-control-auth {
  padding-left: 2.6rem;
}

.input-password-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  border-radius: 4px;
}

.input-password-toggle:hover {
  color: #0f172a;
}

.input-password-toggle:focus-visible {
  outline: 2px solid var(--color-primary, #1d4ed8);
}

/* Form Row for First / Last Name */
.form-row-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 480px) {
  .form-row-auth {
    grid-template-columns: 1fr;
  }
}

/* Remember me & Forgot Password Row */
.auth-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.84rem;
}

.auth-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--color-text-muted, #475569);
  user-select: none;
}

.auth-checkbox-wrap input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--color-primary, #1d4ed8);
  border-radius: 4px;
  cursor: pointer;
}

.auth-link {
  color: var(--color-primary, #1d4ed8);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.auth-link:hover {
  color: #1e40af;
  text-decoration: underline;
}

.auth-link:focus-visible {
  outline: 2px solid var(--color-primary, #1d4ed8);
  outline-offset: 2px;
}

/* Submit Button */
.btn-auth-submit {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  background-color: var(--color-primary, #1d4ed8);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
  transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn-auth-submit:hover {
  background-color: #1e40af;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}

.btn-auth-submit:active {
  transform: translateY(1px);
}

.btn-auth-submit:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.btn-auth-submit:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Password Strength Indicator */
.pwd-strength-container {
  margin-top: 0.5rem;
}

.pwd-meter-bars {
  display: flex;
  gap: 4px;
  height: 4px;
  margin-bottom: 0.375rem;
}

.pwd-meter-bar {
  flex: 1;
  height: 100%;
  background: #e2e8f0;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.pwd-strength-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-subtle, #64748b);
}

.pwd-req-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.pwd-req-chip {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pwd-req-chip.met {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
  font-weight: 600;
}

/* OTP 6-Digit Grid */
.otp-inputs-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

@media (max-width: 380px) {
  .otp-inputs-grid {
    gap: 0.35rem;
  }
}

.otp-digit-input {
  width: 50px;
  height: 58px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  background: #ffffff;
  border: 2px solid var(--color-border, #cbd5e1);
  border-radius: 10px;
  box-sizing: border-box;
  font-family: var(--font-mono, monospace);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 380px) {
  .otp-digit-input {
    width: 44px;
    height: 52px;
    font-size: 1.25rem;
  }
}

.otp-digit-input:focus {
  outline: none;
  border-color: var(--color-primary, #1d4ed8);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.otp-digit-input.filled {
  border-color: #64748b;
  background-color: #f8fafc;
}

.otp-helper-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: #1e40af;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.otp-resend-row {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.84rem;
  color: var(--color-text-muted, #475569);
}

.btn-resend-otp {
  background: none;
  border: none;
  color: var(--color-primary, #1d4ed8);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: 0.25rem;
  text-decoration: underline;
}

.btn-resend-otp:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: none;
}

/* Card Footer with switcher link */
.auth-card-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-subtle, #e2e8f0);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted, #475569);
}

/* Language selector widget in header */
.auth-lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.auth-lang-select {
  padding: 0.35rem 0.65rem 0.35rem 1.8rem;
  border-radius: 6px;
  border: 1px solid var(--color-border, #cbd5e1);
  background: #ffffff;
  font-size: 0.8125rem;
  color: #334155;
  font-weight: 500;
  cursor: pointer;
}

.auth-lang-icon {
  position: absolute;
  left: 0.5rem;
  pointer-events: none;
  font-size: 0.875rem;
}

/* Alert notifications within form */
.auth-feedback-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.84rem;
  margin-bottom: 1.25rem;
  display: none;
  align-items: center;
  gap: 0.625rem;
  line-height: 1.4;
}

.auth-feedback-alert.error {
  display: flex;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.auth-feedback-alert.success {
  display: flex;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.auth-feedback-alert.info {
  display: flex;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.auth-input-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Focus styles for keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary, #1d4ed8);
  outline-offset: 2px;
}

/* Minimal auth footer */
.auth-minimal-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #334155;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
}
.auth-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.auth-footer-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.auth-footer-links a {
  color: #334155;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-footer-links a:hover {
  color: #0f172a;
  text-decoration: underline;
}
@media (min-width: 768px) {
  .auth-footer-inner {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
}
