/* Portal Selector & Portal Auth styles (frontend) */

.mclightning-portal-selector,
.mclightning-portal-auth {
  /*
   * The portal runs inside the page content area.
   * Do NOT force full-viewport height or set a page-wide background,
   * otherwise it will visually bleed behind the theme header/footer.
   */
  min-height: auto;
  padding: 0;
  position: relative;
  background: transparent;
  /* Center these views within the content column */
  display: flex;
  justify-content: center;
  width: 100%;
}

.mclightning-portal-selector::before,
.mclightning-portal-auth::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='2' fill='rgba(255,255,255,0.12)'/%3E%3C/svg%3E");
  opacity: 0.0;
  pointer-events: none;
}

.portal-selector-container,
.portal-auth-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.portal-auth-container { max-width: 520px; }

.portal-selector-header { text-align: center; color: #fff; margin-bottom: 40px; }
.portal-selector-header .selector-logo { font-size: 72px; margin-bottom: 10px; }
.portal-selector-header h1 { font-size: 40px; margin: 0 0 10px 0; }
.portal-selector-header p { font-size: 18px; margin: 0; opacity: 0.95; }

.portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

/*
 * IMPORTANT:
 * Some themes/builders force white text globally.
 * Keep auth/selector cards dark so text stays readable.
 */
.portal-card {
  background: rgba(0,0,0,0.70) !important;
  color: #fff !important;
  border-radius: 16px;
  padding: 28px 22px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

.portal-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 14px;
  color: #fff;
}

.portal-name { text-align: center; font-size: 22px; margin: 0 0 8px 0; color: #fff !important; }
.portal-description { text-align: center; font-size: 14px; margin: 0 0 16px 0; color: rgba(255,255,255,0.82) !important; }

.portal-actions { display: grid; gap: 10px; }
.portal-actions .btn { width: 100%; padding: 12px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; }
.portal-actions .btn.btn-primary { background: linear-gradient(135deg, #DC143C 0%, #0047AB 100%); color: #fff; }
.portal-actions .btn.btn-secondary { background: transparent; border: 2px solid #DC143C; color: #DC143C; }
.portal-actions .btn.btn-secondary:hover { background: #DC143C; color: #fff; }

.guest-access-section { margin-top: 36px; padding: 26px; border-radius: 16px; background: rgba(255,255,255,0.12); color: #fff; text-align: center; backdrop-filter: blur(10px); }
.divider { margin: 18px 0; position: relative; }
.divider:before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(255,255,255,0.25); }
.divider span { position: relative; padding: 0 14px; background: linear-gradient(135deg, #DC143C 0%, #0047AB 100%); font-weight: 700; }

.portals-loading, .portals-empty { text-align: center; color: #fff; padding: 40px 0; }
.loading-spinner { width: 50px; height: 50px; border-radius: 50%; border: 5px solid rgba(255,255,255,0.3); border-top-color: #fff; margin: 0 auto 14px; animation: mcls_spin 1s linear infinite; }
@keyframes mcls_spin { to { transform: rotate(360deg);} }

/* Portal login */
.auth-back { margin-bottom: 14px; }
.back-link { color: #fff; text-decoration: none; font-weight: 700; }

.portal-auth-header { background: rgba(0,0,0,0.60) !important; border-radius: 16px 16px 0 0; padding: 26px 22px; text-align: center; border: 1px solid rgba(255,255,255,0.10); border-bottom: 0; }
.portal-badge { width: 90px; height: 90px; border-radius: 50%; margin: 0 auto 14px; display:flex; align-items:center; justify-content:center; color: #fff; font-size: 42px; }
.portal-auth-header h2 { margin: 0 0 6px 0; color: #fff !important; }
.portal-auth-header p { margin: 0; color: rgba(255,255,255,0.82) !important; }

.auth-tabs { display:flex; background: rgba(0,0,0,0.55) !important; border-bottom: 1px solid rgba(255,255,255,0.12); }
.auth-tab { flex:1; padding: 14px; border:none; background:none; cursor:pointer; font-weight:800; color: rgba(255,255,255,0.78) !important; border-bottom: 3px solid transparent; }
.auth-tab.active { color: var(--portal-color, #DC143C); border-bottom-color: var(--portal-color, #DC143C); }

.auth-tab-content { display:none; background: rgba(0,0,0,0.60) !important; padding: 22px; border-radius: 0 0 16px 16px; border: 1px solid rgba(255,255,255,0.10); border-top: 0; }
.auth-tab-content.active { display:block; }

.form-group { margin-bottom: 16px; }
.form-group label { display:block; margin-bottom: 8px; font-weight: 700; color:#fff !important; }
.input-with-icon { position:relative; }
.input-with-icon .input-icon { position:absolute; left: 14px; top: 50%; transform: translateY(-50%); }
.input-with-icon input { width: 100%; padding: 12px 12px 12px 48px; border: 1px solid rgba(255,255,255,0.18) !important; border-radius: 10px; background: rgba(0,0,0,0.35) !important; color: #fff !important; }
.toggle-password { position:absolute; right: 10px; top: 50%; transform: translateY(-50%); background:none; border:none; cursor:pointer; }

.form-row { display:flex; justify-content: space-between; align-items:center; gap: 12px; margin-bottom: 14px; }
.checkbox-label { display:flex; align-items:center; gap: 8px; font-size: 14px; }
.link-secondary { color: var(--portal-color, #DC143C); font-weight: 700; text-decoration: none; }

.btn-block { width:100%; padding: 12px; border-radius: 10px; border:none; cursor:pointer; font-weight: 800; }
.btn-primary { background: linear-gradient(135deg, var(--portal-color, #DC143C) 0%, #0047AB 100%); color:#fff; }

.alert { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.alert-success { background: rgba(34,197,94,0.18); color: #bbf7d0 !important; border: 1px solid rgba(34,197,94,0.28); }
.alert-error { background: rgba(239,68,68,0.20); color: #fecaca !important; border: 1px solid rgba(239,68,68,0.30); }

@media (max-width: 768px) {
  .portal-selector-header h1 { font-size: 32px; }
}
