/**
 * MAUA Hub Portals - Unified Shared Auth Modal Premium Styling
 */

/* Modal Backdrop Fading Animation */
.shared-auth-modal {
  display: none !important;
  opacity: 0;
  transition: opacity 0.25s ease-out;
  z-index: 10000000 !important;
}

.shared-auth-modal.is-active {
  display: flex !important;
  opacity: 1;
}

.shared-auth-modal .modal-background {
  background-color: rgba(0, 0, 0, 0.65) !important;
}

/* Modal Card Glassmorphism & Transition Animation */
.shared-auth-modal .modal-card {
  max-width: 420px;
  width: 90%;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  transform: scale(0.96);
  transition: transform 0.2s ease-out;
  overflow: visible;
}

.shared-auth-modal.is-active .modal-card {
  transform: scale(1);
}

/* Dark Mode Support */
[data-theme="dark"] .shared-auth-modal .modal-card {
  background: rgba(26, 32, 44, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Header & Card Sections */
.shared-auth-modal .modal-card-head {
  background: transparent;
  border-bottom: none !important;
  padding: 1.5rem 1.5rem 0.5rem 1.5rem !important;
}

.shared-auth-modal .modal-card-body {
  background: transparent !important;
  padding: 1.5rem !important;
}

/* Custom Channel Tile Selection */
.channel-tiles-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.channel-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.65);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: center;
  user-select: none;
}

[data-theme="dark"] .channel-tile {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.channel-tile:hover:not(.is-disabled) {
  border-color: var(--primary-color, #E38D03);
  background: rgba(227, 141, 3, 0.03);
  transform: translateY(-2px);
}

[data-theme="dark"] .channel-tile:hover:not(.is-disabled) {
  background: rgba(227, 141, 3, 0.06);
}

.channel-tile.is-selected {
  border-color: var(--primary-color, #E38D03) !important;
  background: rgba(227, 141, 3, 0.08) !important;
  box-shadow: 0 4px 12px rgba(227, 141, 3, 0.12);
}

[data-theme="dark"] .channel-tile.is-selected {
  background: rgba(227, 141, 3, 0.18) !important;
}

.channel-tile .tile-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.channel-tile .tile-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4a4a4a;
}

[data-theme="dark"] .channel-tile .tile-label {
  color: #e2e8f0;
}

.channel-tile .tile-status {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 0.3rem;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  line-height: 1.4;
  height: auto;
}

.channel-tile.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="dark"] .channel-tile.is-disabled {
  background: rgba(255, 255, 255, 0.01) !important;
  border-color: rgba(255, 255, 255, 0.03) !important;
}


/* Brand circle styles */
.shared-auth-modal .brand-logo-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(227, 141, 3, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  transition: background-color 0.3s;
}

[data-theme="dark"] .shared-auth-modal .brand-logo-circle {
  background-color: rgba(227, 141, 3, 0.18);
}

/* Button & input customization */
.shared-auth-modal .input,
.shared-auth-modal .select select {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  height: 44px;
  color: #1a202c;
  transition: all 0.2s ease;
}

[data-theme="dark"] .shared-auth-modal .input,
[data-theme="dark"] .shared-auth-modal .select select {
  background-color: rgba(45, 55, 72, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.shared-auth-modal .input:focus,
.shared-auth-modal .select select:focus {
  border-color: var(--primary-color, #E38D03) !important;
  box-shadow: 0 0 0 3px rgba(227, 141, 3, 0.18) !important;
}

.shared-auth-modal .btn-primary {
  background-color: var(--primary-color, #E38D03) !important;
  color: white !important;
  border: none !important;
  border-radius: 10px !important;
  font-weight: 800 !important;
  height: 48px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.shared-auth-modal .btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(227, 141, 3, 0.25);
  transform: translateY(-1px);
}

.shared-auth-modal .btn-primary:active {
  transform: translateY(0);
}

.shared-auth-modal .btn-secondary {
  border-radius: 10px !important;
  font-weight: 700 !important;
  height: 48px;
}

/* Micro-transitions between login step 1 and step 2 */
.shared-auth-step {
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.shared-auth-step.fade-out {
  opacity: 0;
  transform: translateX(-15px);
}

.shared-auth-step.fade-in {
  opacity: 1;
  transform: translateX(0);
}

/* Close icon */
.shared-auth-modal .modal-close-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #718096;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

[data-theme="dark"] .shared-auth-modal .modal-close-icon {
  background: rgba(255, 255, 255, 0.08);
  color: #a0aec0;
}

.shared-auth-modal .modal-close-icon:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #2d3748;
}

[data-theme="dark"] .shared-auth-modal .modal-close-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f7fafc;
}

/* Shared Landing Page Login Layouts
 * Same flat/dimmed language as .shared-auth-modal's backdrop (no page content to
 * blur here, so a subtle static brand glow stands in for it) instead of the
 * previous animated rainbow gradient, which was a different visual system from
 * every other MAUA ID surface. */
.login-wrapper {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 999999 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow-y: auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 1.5rem 1rem !important;
  background-color: var(--bg-color, #ffffff);
  background-image: radial-gradient(circle at 50% 20%, rgba(227, 141, 3, 0.10), transparent 60%);
}

[data-theme="dark"] .login-wrapper {
  background-color: var(--bg-color, #0f172a);
  background-image: radial-gradient(circle at 50% 20%, rgba(227, 141, 3, 0.14), transparent 60%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(227, 141, 3, 0.2) !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  padding: 2.5rem 2rem !important;
  transition: transform 0.2s ease-out, border-color 0.2s ease-out;
}

[data-theme="dark"] .login-card {
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(227, 141, 3, 0.35) !important;
}

.login-card:hover {
  transform: translateY(-4px);
  border-color: rgba(227, 141, 3, 0.45) !important;
}

.login-card:hover .brand-logo-circle {
  transform: scale(1.05) rotate(5deg);
}

/* Ensure full screen fit under driver & vendor PWA wrappers during login */
.view-login .driver-app-content-wrapper,
.view-login main.section {
  padding: 0 !important;
  margin: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  position: fixed !important;
  z-index: 100000 !important;
  overflow-y: auto !important;
  background: var(--bg-color) !important;
  height: 100vh !important;
  width: 100vw !important;
}

.view-login .container,
.view-login .columns,
.view-login .column,
.view-login #content-area,
.view-login .admin-layout,
.view-login .main-wrapper,
.view-login .main-content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.view-login .navbar,
.view-login .footer {
  display: none !important;
}

/* Eliminate double card borders and padding on the outer content area for both merchant and driver PWA portals */
.merchant-app-body #content-area.glass-card,
.driver-app-body #content-area.glass-card {
  border: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Full-width premium styling for vendor PWA dashboard shell when logged in */
.merchant-app-body .container {
  max-width: none !important;
  width: 100% !important;
  padding: 0 1rem !important;
}

.merchant-app-body main.section {
  padding: 1.5rem 1rem !important;
}

