/* GIS4AG MemberPress Unauthorized & Inline Login Gate Styling */

/* Shared branded header card inside MemberPress unauthorized message */
.gis4ag-unauth-box {
  background: #ffffff;
  color: #1b2a31;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  text-align: left;
  margin: 0 !important;
  padding: 0 !important;
}

.gis4ag-unauth-brand {
  background: linear-gradient(135deg, #162730 0%, #243b47 100%);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(145, 175, 188, 0.25);
}

.gis4ag-unauth-logo {
  height: 24px !important;
  width: auto !important;
  display: block !important;
  margin: 0 !important;
}

.gis4ag-unauth-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(231, 169, 72, 0.16);
  border: 1px solid rgba(231, 169, 72, 0.45);
  color: #f3c472;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gis4ag-unauth-body {
  padding: 24px 24px 18px;
}

.gis4ag-unauth-title {
  margin: 0 0 8px !important;
  padding: 0 !important;
  font-size: 21px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  color: #162730 !important;
  text-transform: none !important;
}

.gis4ag-unauth-copy {
  margin: 0 0 16px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: #4f646e !important;
}

.gis4ag-unauth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.gis4ag-unauth-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border: 1px solid #c7d5dc !important;
  background: #f4f7f9 !important;
  color: #1b2a31 !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gis4ag-unauth-btn:hover {
  background: #e7eef2 !important;
  border-color: #91afbc !important;
  color: #0f1c24 !important;
}

.gis4ag-unauth-btn.primary {
  background: #1f6b50 !important;
  border-color: #1f6b50 !important;
  color: #ffffff !important;
}

.gis4ag-unauth-btn.primary:hover {
  background: #17543e !important;
  border-color: #17543e !important;
  color: #ffffff !important;
}

.gis4ag-unauth-hint {
  margin: 0 !important;
  font-size: 12px !important;
  color: #6b808a !important;
}

/* Full-screen dark slate stage for standalone GIS4AG templates & Divi Blank Page gates */
.gis4ag-gate-stage {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 36px 16px 48px;
  background: radial-gradient(circle at 50% 0%, #1d3441 0%, #0f1c24 72%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.gis4ag-gate-page-title {
  margin: 0 0 16px;
  color: #eef5f8;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

.gis4ag-gate-card {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(145, 175, 188, 0.28);
  box-shadow: 0 28px 64px -22px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

/* Automatically apply the dark-slate centered stage on Divi Blank Pages (e.g. /soil-map/, /soil-map-premium/) */
body.page-template-page-template-blank:has(.mepr-unauthorized-message),
body.page-template-page-template-blank:has(.gis4ag-unauth-box),
body.et_blank_page:has(.mepr-unauthorized-message),
body.et_blank_page:has(.gis4ag-unauth-box) {
  background: radial-gradient(circle at 50% 0%, #1d3441 0%, #0f1c24 72%) !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.page-template-page-template-blank:has(.mepr-unauthorized-message) #page-container,
body.page-template-page-template-blank:has(.mepr-unauthorized-message) #main-content,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) #page-container,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) #main-content {
  background: transparent !important;
  padding-top: 0 !important;
}

/* Remove Divi's 1px vertical sidebar divider line */
body.page-template-page-template-blank:has(.mepr-unauthorized-message) #main-content .container::before,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) #main-content .container::before,
body.et_blank_page:has(.mepr-unauthorized-message) #main-content .container::before,
body.et_blank_page:has(.gis4ag-unauth-box) #main-content .container::before {
  display: none !important;
  content: none !important;
}

body.page-template-page-template-blank:has(.mepr-unauthorized-message) #main-content .container,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) #main-content .container,
body.et_blank_page:has(.mepr-unauthorized-message) #main-content .container,
body.et_blank_page:has(.gis4ag-unauth-box) #main-content .container {
  width: 100% !important;
  max-width: 532px !important;
  margin: 0 auto !important;
  padding: 40px 16px 56px !important;
}

body.page-template-page-template-blank:has(.mepr-unauthorized-message) #left-area,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) #left-area,
body.et_blank_page:has(.mepr-unauthorized-message) #left-area,
body.et_blank_page:has(.gis4ag-unauth-box) #left-area {
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
}

body.page-template-page-template-blank:has(.mepr-unauthorized-message) #sidebar,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) #sidebar,
body.et_blank_page:has(.mepr-unauthorized-message) #sidebar,
body.et_blank_page:has(.gis4ag-unauth-box) #sidebar {
  display: none !important;
}

/* Crisp light page title above the card on dark slate background */
body.page-template-page-template-blank:has(.mepr-unauthorized-message) h1.entry-title,
body.page-template-page-template-blank:has(.mepr-unauthorized-message) h1.main_title,
body.page-template-page-template-blank:has(.mepr-unauthorized-message) #left-area > article > h1,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) h1.entry-title,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) h1.main_title,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) #left-area > article > h1,
body.et_blank_page:has(.mepr-unauthorized-message) h1.entry-title,
body.et_blank_page:has(.mepr-unauthorized-message) h1.main_title,
body.et_blank_page:has(.gis4ag-unauth-box) h1.entry-title,
body.et_blank_page:has(.gis4ag-unauth-box) h1.main_title {
  color: #eef5f8 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  text-align: center !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  letter-spacing: 0.01em !important;
}

body.page-template-page-template-blank:has(.mepr-unauthorized-message) .entry-content,
body.page-template-page-template-blank:has(.gis4ag-unauth-box) .entry-content,
body.et_blank_page:has(.mepr-unauthorized-message) .entry-content,
body.et_blank_page:has(.gis4ag-unauth-box) .entry-content {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(145, 175, 188, 0.28);
  box-shadow: 0 28px 64px -22px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  padding: 0 !important;
}

/* Remove extra outer padding on any MemberPress wrapper that holds .gis4ag-unauth-box so dark header sits flush */
.mp_wrapper:has(.gis4ag-unauth-box),
.mepr-unauthorized-message,
.mepr-unauthorized-message .mp_wrapper {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.mepr-unauthorized-message blockquote {
  border-left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Inline MemberPress Login Form styling inside any unauthorized gate */
.gis4ag-gate-card .mp_wrapper.mp_login_form,
.gis4ag-gate-card .mp_wrapper:has(#mepr_loginform):not(:has(.gis4ag-unauth-box)),
.gis4ag-gate-card .mepr-login-form-wrap,
.entry-content:has(.gis4ag-unauth-box) .mp_wrapper.mp_login_form,
.entry-content:has(.gis4ag-unauth-box) .mp_wrapper:has(#mepr_loginform):not(:has(.gis4ag-unauth-box)),
.entry-content:has(.gis4ag-unauth-box) .mepr-login-form-wrap,
.entry-content:has(.mepr-unauthorized-message) .mp_wrapper.mp_login_form,
.entry-content:has(.mepr-unauthorized-message) .mp_wrapper:has(#mepr_loginform):not(:has(.gis4ag-unauth-box)) {
  padding: 22px 24px 24px !important;
  background: #f8fafb !important;
  border-top: 1px solid #e2eaee !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* Fallback if #mepr_loginform lives directly inside the same .mp_wrapper as .gis4ag-unauth-box */
.mp_wrapper:has(.gis4ag-unauth-box) > #mepr_loginform,
.mp_wrapper:has(.gis4ag-unauth-box) > .mepr-login-form-wrap {
  padding: 22px 24px 12px !important;
  background: #f8fafb !important;
  border-top: 1px solid #e2eaee !important;
}
.mp_wrapper:has(.gis4ag-unauth-box) > .mepr-login-actions {
  padding: 0 24px 22px !important;
  background: #f8fafb !important;
  margin-top: 0 !important;
}

.gis4ag-gate-card #mepr_loginform,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform,
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform {
  margin: 0 !important;
}

.gis4ag-gate-card #mepr_loginform .mp-form-row,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform .mp-form-row,
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform .mp-form-row {
  margin: 0 0 14px !important;
}

.gis4ag-gate-card #mepr_loginform label,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform label,
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform label {
  display: block;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #31454f !important;
  margin-bottom: 5px !important;
  letter-spacing: 0.02em;
}

.gis4ag-gate-card #mepr_loginform label:has(input[type="checkbox"]),
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform label:has(input[type="checkbox"]),
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform label:has(input[type="checkbox"]) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin-bottom: 0 !important;
  cursor: pointer;
}

.gis4ag-gate-card #mepr_loginform input[type="text"],
.gis4ag-gate-card #mepr_loginform input[type="email"],
.gis4ag-gate-card #mepr_loginform input[type="password"],
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform input[type="text"],
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform input[type="email"],
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform input[type="password"],
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform input[type="text"],
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform input[type="email"],
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform input[type="password"] {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 11px 13px !important;
  font-size: 14px !important;
  color: #1b2a31 !important;
  background: #ffffff !important;
  border: 1px solid #c7d5dc !important;
  border-radius: 7px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gis4ag-gate-card #mepr_loginform .mp-hide-pw input[type="password"],
.gis4ag-gate-card #mepr_loginform .mp-hide-pw input[type="text"],
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform .mp-hide-pw input[type="password"],
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform .mp-hide-pw input[type="text"] {
  padding-right: 42px !important;
}

.gis4ag-gate-card #mepr_loginform input[type="text"]:focus,
.gis4ag-gate-card #mepr_loginform input[type="password"]:focus,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform input[type="text"]:focus,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform input[type="password"]:focus {
  outline: none !important;
  border-color: #31454f !important;
  box-shadow: 0 0 0 3px rgba(49, 69, 79, 0.15) !important;
}

/* Tuck MemberPress password visibility eye button cleanly inside the password field */
.gis4ag-gate-card #mepr_loginform .mp-hide-pw,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform .mp-hide-pw,
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform .mp-hide-pw {
  position: relative !important;
  display: block !important;
}

.gis4ag-gate-card #mepr_loginform .mp-hide-pw button,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform .mp-hide-pw button,
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform .mp-hide-pw button {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 6px !important;
  min-height: 0 !important;
  line-height: 1 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #55707b !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.gis4ag-gate-card #mepr_loginform .mp-hide-pw button:hover,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform .mp-hide-pw button:hover {
  color: #182a34 !important;
  background: transparent !important;
}

.gis4ag-gate-card #mepr_loginform input[type="submit"],
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform input[type="submit"],
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform input[type="submit"] {
  width: 100% !important;
  padding: 12px 16px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #182a34 !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  letter-spacing: 0.02em;
  transition: background 0.15s ease;
}

.gis4ag-gate-card #mepr_loginform input[type="submit"]:hover,
.entry-content:has(.gis4ag-unauth-box) #mepr_loginform input[type="submit"]:hover,
.entry-content:has(.mepr-unauthorized-message) #mepr_loginform input[type="submit"]:hover {
  background: #0f1c24 !important;
}

.gis4ag-gate-card .mepr-login-actions,
.entry-content:has(.gis4ag-unauth-box) .mepr-login-actions,
.entry-content:has(.mepr-unauthorized-message) .mepr-login-actions {
  margin-top: 12px !important;
  font-size: 13px !important;
  text-align: center;
}

.gis4ag-gate-card .mepr-login-actions a,
.entry-content:has(.gis4ag-unauth-box) .mepr-login-actions a,
.entry-content:has(.mepr-unauthorized-message) .mepr-login-actions a {
  color: #31454f !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
}

.gis4ag-gate-card .mp-spacer,
.entry-content:has(.gis4ag-unauth-box) .mp-spacer {
  display: none !important;
}

.gis4ag-gate-card .mepr_error,
.entry-content:has(.gis4ag-unauth-box) .mepr_error {
  margin: 0 0 14px !important;
  padding: 10px 12px !important;
  border-radius: 7px !important;
  background: #fef2f2 !important;
  border: 1px solid #f5c6c2 !important;
  color: #b42318 !important;
  font-size: 13px !important;
}

@media (max-width: 540px) {
  .gis4ag-unauth-brand { padding: 15px 18px; }
  .gis4ag-unauth-body { padding: 20px 18px 14px; }
  .gis4ag-gate-card .mp_wrapper.mp_login_form,
  .entry-content:has(.gis4ag-unauth-box) .mp_wrapper.mp_login_form { padding: 18px !important; }
  .gis4ag-unauth-links { flex-direction: column; }
  .gis4ag-unauth-btn { width: 100%; }
}
