/* ==========================================================================
   Kingdom Auto & Detail - Auth Pages (Login / Staff Login)
   Split-screen layout with BC landscape photography
   ========================================================================== */

/* --------------------------------------------------------------------------
   Container: Full viewport split-screen
   -------------------------------------------------------------------------- */
.auth-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Photo Panel (Left Side - 55% on desktop)
   -------------------------------------------------------------------------- */
.auth-photo-panel {
  width: 55%;
  position: relative;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Dark gradient overlay at bottom for caption readability */
.auth-photo-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
  pointer-events: none;
}

/* Photo caption overlay */
.auth-photo-caption {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 2;
  color: #fff;
}

.auth-photo-caption .caption-location {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.auth-photo-caption .caption-region {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 0.25rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   Form Panel (Right Side - 45% on desktop)
   -------------------------------------------------------------------------- */
.auth-form-panel {
  width: 45%;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 1rem 3rem;
  background: #fff;
  overflow-y: auto;
}

.auth-form {
  max-width: 380px;
  width: 100%;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Brand Logo
   -------------------------------------------------------------------------- */
.auth-brand-logo {
  margin-bottom: 0.4rem;
  text-align: center;
}

.auth-logo {
  display: inline-block;
  width: 80px;
  height: auto;
}

/* Dark mode: invert logo to white */
[data-bs-theme="dark"] .auth-logo:not(.auth-logo-invert) {
  filter: brightness(0) invert(1);
}

/* Mobile header logo (always inverted — sits on dark background) */
.auth-logo.auth-logo-invert {
  filter: brightness(0) invert(1);
  width: 80px;
  margin: 0 auto;
}

.auth-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-heading, #1E293B);
  margin-bottom: 0.1rem;
  text-align: center;
}

.auth-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted, #64748B);
  margin-bottom: 0.75rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Form Inputs
   -------------------------------------------------------------------------- */
.auth-form .form-label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-body, #334155);
  margin-bottom: 0.2rem;
  display: block;
  text-align: center;
}

.auth-form .mb-3 {
  margin-bottom: 0.5rem !important;
}

.auth-form .form-control {
  padding: 0.4rem 0.7rem;
  font-size: 0.875rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form .form-control:focus {
  border-color: var(--primary, #3B82F6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-form .form-check {
  margin-bottom: 0.4rem !important;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.auth-form .form-check-label {
  font-size: 0.8rem;
  color: var(--text-muted, #64748B);
}

/* --------------------------------------------------------------------------
   Social Login (Google Identity Services button wrapper)
   -------------------------------------------------------------------------- */
.auth-social-section {
  margin-bottom: 0.5rem;
}

.g-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.auth-fb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background: #1877F2;
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.auth-fb-btn:hover {
  background: #166ad8;
  color: #fff;
  text-decoration: none;
}

.auth-fb-btn svg {
  flex-shrink: 0;
}

.auth-social-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.auth-social-divider::before,
.auth-social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-social-divider span {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Submit Button
   -------------------------------------------------------------------------- */
.auth-btn {
  display: block;
  width: 100%;
  padding: 0.45rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #fff;
  background-color: var(--primary, #3B82F6);
  border: 2px solid var(--primary, #3B82F6);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.auth-btn:hover {
  background-color: var(--primary-hover, #2563EB);
  border-color: var(--primary-hover, #2563EB);
}

.auth-btn:active {
  transform: scale(0.99);
}

/* --------------------------------------------------------------------------
   Links & Footer Text
   -------------------------------------------------------------------------- */
.auth-links {
  margin-top: 0.5rem;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.auth-links a {
  color: var(--primary, #3B82F6);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-links a:hover {
  color: var(--primary-hover, #2563EB);
  text-decoration: underline;
}

.auth-links p {
  margin-bottom: 0;
}

.auth-footer {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
  text-align: center;
}

.auth-footer a {
  color: var(--text-muted, #64748B);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: var(--primary, #3B82F6);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Mobile Header (shown only on mobile when photo panel is hidden)
   -------------------------------------------------------------------------- */
.auth-mobile-header {
  display: none;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.auth-mobile-header .auth-logo {
  width: 80px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* --------------------------------------------------------------------------
   Responsive: Mobile (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .auth-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .auth-photo-panel {
    display: none;
  }

  .auth-mobile-header {
    display: block;
  }

  .auth-form-panel {
    width: 100%;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 100px);
  }

  .auth-links {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* --------------------------------------------------------------------------
   Portal Buttons Section
   -------------------------------------------------------------------------- */
.auth-portals {
  margin-top: 0.75rem;
}

.auth-portals-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.auth-portals-divider::before,
.auth-portals-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-portals-divider span {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748B);
  white-space: nowrap;
}

.auth-portals-grid {
  display: flex;
  gap: 0.5rem;
}

.auth-portal-btn {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text-body, #334155);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.auth-portal-btn:hover {
  border-color: var(--primary, #3B82F6);
  background: #eff6ff;
  color: var(--primary, #3B82F6);
  text-decoration: none;
}

.auth-portal-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.auth-portal-btn:hover svg {
  opacity: 1;
}

.auth-portal-btn-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.auth-portal-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--text-muted, #94a3b8);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Responsive: Tablet (768px - 991px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 991.98px) {
  .auth-photo-panel {
    width: 45%;
  }

  .auth-form-panel {
    width: 55%;
    padding: 1rem 1.5rem;
  }

  .auth-photo-caption .caption-location {
    font-size: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Responsive: Short viewports (laptops)
   -------------------------------------------------------------------------- */
@media (max-height: 700px) and (min-width: 768px) {
  .auth-brand-logo {
    margin-bottom: 0.25rem;
  }

  .auth-logo {
    width: 65px;
  }

  .auth-title {
    font-size: 1.15rem;
  }

  .auth-subtitle {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
  }

  .auth-form .mb-3 {
    margin-bottom: 0.35rem !important;
  }

  .auth-form .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
  }

  .auth-form .form-control {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  .auth-btn {
    padding: 0.35rem;
    font-size: 0.85rem;
  }

  .auth-links {
    margin-top: 0.35rem;
  }

  .auth-portals {
    margin-top: 0.5rem;
  }

  .auth-portals-divider {
    margin-bottom: 0.35rem;
  }
}

/* --------------------------------------------------------------------------
   Responsive: Mobile portal buttons
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .auth-portals-grid {
    flex-direction: column;
  }

  .auth-portal-btn {
    flex-direction: row;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }
}
