*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.portal-login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  color: #ffffff;
  background:
    linear-gradient(rgba(14, 34, 68, 0.78), rgba(14, 34, 68, 0.78)),
    url("./church-growth.png") center center / cover no-repeat;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* =========================
   SHARED TOPBAR SPACING
========================= */
.with-shared-topbar {
  min-height: calc(100vh - 78px);
  padding-top: 28px;
}

/* =========================
   MAIN SHELL
========================= */
.portal-login-shell {
  width: 100%;
  flex: 1 0 auto;
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 30px;
  position: relative;
}

/* =========================
   FORCE SAFE TYPOGRAPHY
   Prevent homepage/global styles
   from breaking the login chooser
========================= */
.portal-login-shell h1,
.portal-login-shell h2,
.portal-login-shell h3,
.portal-login-shell h4,
.portal-login-shell h5,
.portal-login-shell h6,
.portal-login-shell p,
.portal-login-shell a,
.portal-login-shell button,
.portal-login-shell span,
.portal-login-shell label {
  max-width: 100%;
  word-break: break-word;
}

.portal-login-shell h1,
.portal-login-shell h2,
.portal-login-shell h3,
.portal-login-shell h4,
.portal-login-shell h5,
.portal-login-shell h6 {
  font-family: Arial, sans-serif;
  line-height: 1.2;
}

/* =========================
   CHOOSER VIEW
========================= */
.login-chooser-view {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 170px);
}

.login-chooser-card {
  width: 100%;
  max-width: 580px;
  padding: 28px 24px 28px;
  border-radius: 28px;
  background: rgba(120, 150, 198, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-chooser-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  color: #ffffff;
}

.login-chooser-card p {
  margin: 0 0 22px;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  font-family: Arial, sans-serif;
}

/* =========================
   FORM VIEW
========================= */
.login-form-view {
  width: 100%;
  min-height: calc(100vh - 180px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 500px);
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 1;
}

.portal-login-left {
  width: 100%;
  max-width: 620px;
  position: relative;
  z-index: 2;
}

.portal-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 0.9rem;
}

.portal-role-badge i {
  color: #ffd24a;
}

.login-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 0;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.login-back-btn:hover {
  opacity: 0.85;
}

.portal-login-heading {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -1px;
  color: #ffffff;
}

.portal-login-description {
  margin: 0 0 18px;
  max-width: 560px;
  font-size: 0.92rem;
  line-height: 1.55;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: rgba(255, 255, 255, 0.94);
}

.portal-feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.portal-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  min-width: 240px;
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.portal-feature-pill i {
  color: #ffd24a;
}

.portal-login-right {
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: center;
}

.portal-login-card {
  width: 100%;
  padding: 18px 18px;
  border-radius: 24px;
  background: rgba(120, 150, 198, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

/* =========================
   ROLE BUTTONS
========================= */
.portal-role-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-role-buttons.chooser-mode {
  margin-top: 6px;
}

.portal-role-buttons.compact-mode {
  margin-bottom: 18px;
}

.portal-role-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 16px 12px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  background: #f4f6fb;
  color: #1e2f57;
  border: 1px solid #d9dde6;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.96rem;
  min-height: 98px;
  text-align: center;
  font-family: Arial, sans-serif;
  line-height: 1.3;
}

.portal-role-btn i {
  font-size: 1.3rem;
}

.portal-role-btn:hover {
  background: #243b72;
  color: #ffffff;
  transform: translateY(-2px);
}

.portal-role-btn.active {
  background: #243b72;
  color: #ffffff;
  border-color: #243b72;
  box-shadow: 0 8px 20px rgba(36, 59, 114, 0.25);
}

/* =========================
   FORM CARD
========================= */
.portal-login-card-header {
  text-align: center;
  margin-bottom: 16px;
}

.portal-login-card-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.3rem, 2.7vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  color: rgb(234, 231, 6);
  font-family: Tahoma, Geneva, Verdana, sans-serif;
}

.portal-login-card-header p {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.portal-login-form {
  display: flex;
  flex-direction: column;
}

.portal-login-form label {
  margin: 10px 0 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  font-family: Arial, sans-serif;
}

.portal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(236, 241, 249, 0.95);
  border-radius: 16px;
  padding: 0 14px;
  min-height: 46px;
}

.portal-input-wrap i {
  color: #4b6692;
  font-size: 0.95rem;
}

.portal-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  min-height: 46px;
  font-size: 0.92rem;
  color: #111827;
  font-family: Arial, sans-serif;
}

.portal-input-wrap input::placeholder {
  color: #6b7280;
}

.portal-login-btn {
  margin-top: 18px;
  border: none;
  border-radius: 16px;
  min-height: 48px;
  background: linear-gradient(180deg, #f6d34d, #efc53a);
  color: #111827;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 211, 77, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.18s ease, opacity 0.18s ease;
  font-family: Arial, sans-serif;
}

.portal-login-btn:hover {
  transform: translateY(-1px);
}

.portal-login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.portal-message {
  min-height: 22px;
  margin-top: 12px;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 700;
  font-family: Arial, sans-serif;
}

.portal-message.error {
  color: #ffd4d4;
}

.portal-message.success {
  color: #d6ffd9;
}

.portal-message.info {
  color: #eef4ff;
}

.portal-login-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  text-align: center;
}

.portal-login-note i {
  color: rgba(255, 255, 255, 0.88);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1180px) {
  .portal-login-shell {
    padding: 18px 16px 26px;
  }

  .login-form-view {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
    min-height: auto;
  }

  .portal-login-left,
  .portal-login-right {
    max-width: 100%;
  }

  .portal-feature-list {
    max-width: 100%;
  }

  .portal-feature-pill {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .with-shared-topbar {
    padding-top: 20px;
  }

  .portal-login-shell {
    padding: 18px 14px 28px;
  }

  .portal-role-buttons {
    grid-template-columns: 1fr;
  }

  .login-chooser-card {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .portal-login-card {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .portal-login-heading {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
  }

  .portal-feature-pill {
    font-size: 0.86rem;
    padding: 10px 14px;
  }

  .portal-login-card-header h2 {
    font-size: clamp(1.2rem, 6.5vw, 1.65rem);
  }
}
