/* Upper Room DFW — Member & Admin Portal */

.portal-login {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: stretch;
}

.portal-login-split {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  min-height: calc(100vh - 4rem);
}

@media (min-width: 992px) {
  .portal-login-split {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.portal-login-brand {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  color: #fff;
  background: linear-gradient(145deg, #0c4a6e 0%, #0369a1 55%, #0284c7 100%);
  overflow: hidden;
}

@media (min-width: 992px) {
  .portal-login-brand {
    display: flex;
  }
}

.portal-login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('images/8.jpg') center/cover no-repeat;
  opacity: 0.22;
}

.portal-login-brand > * {
  position: relative;
  z-index: 1;
}

/* Admin login — DFW church hero photo */
.portal-login-brand-admin {
  justify-content: center;
  gap: 2rem;
  padding: 2.5rem 3rem;
}

.portal-login-brand-admin::before {
  background-image: url('images/1.jpg');
  background-position: center 35%;
  opacity: 0.38;
}

.portal-login-brand-admin::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(12, 74, 110, 0.88) 0%,
    rgba(3, 105, 161, 0.72) 50%,
    rgba(2, 132, 199, 0.55) 100%
  );
  z-index: 0;
}

.portal-brand-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow:
    0 28px 56px -12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

.portal-brand-photo-img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center 42%;
}

.portal-brand-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.75rem 1.25rem 1rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.82) 0%, transparent 100%);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.portal-brand-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* Member login — welcoming church community photo */
.portal-login-brand-member {
  justify-content: center;
  gap: 2rem;
  padding: 2.5rem 3rem;
}

.portal-login-brand-member::before {
  background-image: url('images/10.jpg');
  background-position: center 25%;
  opacity: 0.38;
}

.portal-login-brand-member::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(12, 74, 110, 0.86) 0%,
    rgba(3, 105, 161, 0.7) 50%,
    rgba(14, 165, 233, 0.5) 100%
  );
  z-index: 0;
}

.portal-brand-photo-img-member {
  object-position: center 22%;
}

.portal-login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: #f8fafc;
}

.portal-login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 20px 50px -12px rgb(3 105 161 / 0.15);
}

.portal-login-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.portal-badge-admin {
  background: #1e293b;
  color: #e2e8f0;
}

.portal-badge-member {
  background: #e0f2fe;
  color: #0369a1;
}

.portal-field {
  display: block;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-field:focus {
  outline: none;
  border-color: #0369a1;
  box-shadow: 0 0 0 3px rgb(3 105 161 / 0.12);
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.portal-btn:hover {
  transform: translateY(-1px);
}

.portal-btn-primary {
  background: #0369a1;
  color: #fff;
}

.portal-btn-primary:hover {
  background: #0284c7;
}

.portal-btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.portal-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8;
  font-size: 0.75rem;
  margin: 1.25rem 0;
}

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

.portal-quick-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.portal-quick-link:hover {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

/* Dashboard shell */
.portal-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 8rem);
  gap: 0;
}

@media (max-width: 1024px) {
  .portal-app {
    grid-template-columns: 1fr;
  }
  .portal-sidebar {
    display: none;
  }
  .portal-sidebar.mobile-open {
    display: flex;
    position: fixed;
    inset: 4rem 0 0 0;
    z-index: 40;
    width: 280px;
    box-shadow: 4px 0 24px rgb(0 0 0 / 0.12);
  }
}

.portal-sidebar {
  background: #0f172a;
  color: #cbd5e1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-sidebar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.5rem 0.75rem 1.25rem;
  border-bottom: 1px solid #334155;
  margin-bottom: 0.5rem;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.portal-nav-item:hover,
.portal-nav-item.active {
  background: #1e293b;
  color: #fff;
}

.portal-nav-item.active {
  background: #0369a1;
}

.portal-main {
  padding: 1.5rem;
  background: #f1f5f9;
  overflow-x: auto;
}

.portal-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
}

.portal-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.portal-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 1rem;
}

.portal-stat-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0369a1;
  margin-top: 0.25rem;
}

.portal-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
}

.portal-api-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
}

.portal-api-status.offline {
  background: #fef3c7;
  color: #b45309;
}

.portal-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  background: #0f172a;
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 0.85rem;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
  animation: portal-slide-in 0.3s ease;
}

@keyframes portal-slide-in {
  from { transform: translateY(1rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.member-portal-shell .member-tab.active {
  border-bottom-color: #0369a1;
  color: #0369a1;
}

.member-portal-app {
  min-height: calc(100vh - 4rem);
}

.portal-sidebar-member {
  background: linear-gradient(180deg, #0c4a6e 0%, #0f172a 100%);
}

#dashboard-main .portal-panel {
  margin-bottom: 1rem;
}

#dashboard-main .member-tab-content.hidden {
  display: none;
}