/* =============================================
   AMFE - Global Styles
   Shared across all pages
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@400;500&display=swap');

:root {
  --page-gutter: 2.25rem;
  --green-dark: #2d5a3d;
  --green-mid:  #3d7a52;
  --green-light: #e8f5ed;
  --text-dark:  #1a2e22;
  --text-muted: #6b7c72;
  --border:     #d6e8dc;
  --bg:         #f5f7f5;

  /* ── Public navbar palette ──────────────────────────────────────────
     #1e4d3a is the brand green the signed-in shell already uses (admin's
     --primary, the farmer/entrepreneur mobile top bar and sidebar). Note
     --green-dark is NOT a safe alias here: global.css and homepage.css set
     it to #2d5a3d, but farmer.css and entrepreneur.css redefine it to
     #1e4d3a later in the cascade, so its value depends on load order.
     Spelling it out keeps the navbar independent of that.
     To switch the whole bar, change these four values only. */
  --navbar-bg:          #1e4d3a;
  --navbar-text:        rgba(255, 255, 255, 0.82);
  --navbar-text-strong: #ffffff;
  --navbar-hover-bg:    rgba(255, 255, 255, 0.12);
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  :root { --page-gutter: 1.5rem; }
}

@media (max-width: 767.98px) {
  :root { --page-gutter: 1rem; }
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  margin: 0;
}

/* Role-specific stylesheets are bundled globally and set the root type size
   to 14px. Public pages use the browser-standard root so 2.25rem is 36px. */
html:has(.public-navbar) {
  font-size: 16px;
}

/* =========================
   NAVBAR
========================= */
.navbar {
  background: var(--navbar-bg);
  /* Darker, tighter shadow — the light one vanished against green. */
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
  padding: 9px 0;
}

.public-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.site-header-inner {
  width: 100%;
  max-width: none;
  padding-inline: var(--page-gutter);
  display: flex;
  align-items: center;
  flex-wrap: inherit;
  justify-content: space-between;
}

.public-desktop-nav { display: none; }
.public-navbar .public-menu-toggle { display: block; }

@media (min-width: 1200px) {
  .public-desktop-nav { display: flex; }
  .public-navbar .public-menu-toggle { display: none; }
}

.min-w-0 {
  min-width: 0 !important;
}

.page-shell {
  width: 100%;
  min-width: 0;
}

main.page-shell--wide {
  max-width: none;
  padding: 0 var(--page-gutter) !important;
}

main.page-shell--narrow {
  max-width: 760px;
  margin-inline: auto;
  padding: 0 !important;
}

/* Wide public pages own their outer gutter; Bootstrap containers inside
   them provide structure only and must not introduce a second width cap. */
.page-shell--wide .container {
  width: 100%;
  max-width: none;
  padding-inline: 0;
}

/* The public pages scroll with the window. Hidden horizontal overflow on
   html/body makes them scroll containers and prevents sticky from sticking. */
html:has(.public-navbar),
body:has(.public-navbar) {
  overflow-x: clip;
}

/* Bootstrap's .navbar-light draws a dark hamburger; on green it needs the
   light one. Recolouring the icon via mask keeps it working without
   swapping the class in every layout. */
/* No border box — Bootstrap draws one by default and it read as a stray
   outline around the icon. Kept off outline-style so the focus ring below
   is still the only thing that ever frames it. */
.navbar .navbar-toggler {
  border: none;
  box-shadow: none;
  padding: 4px 8px;
}
/* Keyboard focus still needs a visible ring — this is the only affordance
   left once the border is gone, so it stays. A mouse click does not
   trigger :focus-visible, so no ring lingers after tapping. */
.navbar .navbar-toggler:focus { box-shadow: none; }
.navbar .navbar-toggler:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.45);
}
.navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--green-dark);
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text strong {
  display: block;
  font-weight: 700;
  font-size: 18px;
  color: var(--navbar-text-strong);
  line-height: 1.2;
}

.brand-text span {
  font-size: 11px;
  /* Lighter than the name but still ~5.6:1 on the green — the old
     --text-muted was near-invisible against it. */
  color: rgba(255, 255, 255, 0.72);
}

/* NAV LINKS — scoped to .navbar. Unscoped these leaked onto the role
   sidebars, which reuse .nav-link on a white panel: the !important white
   made every non-active sidebar label invisible. */
.navbar .nav-link {
  color: var(--navbar-text) !important;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px !important;
  border-radius: 20px;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.navbar .nav-link .bi {
  font-size: 15px;
  line-height: 1;
}

/* Hover now lifts to full white and picks up a translucent wash — on a
   green bar a colour-only hover (the old --green-dark) would have been
   invisible against the background. */
.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  color: var(--navbar-text-strong) !important;
  background: var(--navbar-hover-bg);
}

/* Inverted: the current page is the one white pill on the green bar. */
.navbar .nav-link.active-pill {
  background: var(--navbar-text-strong) !important;
  color: var(--navbar-bg) !important;
  font-weight: 600;
}

.navbar .nav-link--outline {
  border: 1px solid rgba(255, 255, 255, 0.72);
  padding-inline: 16px !important;
}

.navbar .nav-link--filled {
  background: #dcefe5;
  color: var(--navbar-bg) !important;
  padding-inline: 17px !important;
  font-weight: 600;
}

.navbar .nav-link--filled:hover,
.navbar .nav-link--filled:focus-visible,
.navbar .nav-link--filled.active-pill {
  background: #fff !important;
  color: var(--navbar-bg) !important;
}

/* Public account menu: shared by every public page through PublicLayout. */
.public-account-menu {
  position: relative;
  margin-left: .35rem;
}

.public-account-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 3.65rem;
  height: 2.35rem;
  min-width: 3.65rem;
  min-height: 2.35rem;
  padding: .35rem .6rem;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 1.15rem;
  color: var(--navbar-bg);
  background: #fff;
  font: inherit;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.public-account-trigger:hover,
.public-account-trigger:focus-visible,
.public-account-trigger.active {
  background: #f2f8f4;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .16);
}

.public-account-trigger:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .45);
  outline-offset: 2px;
}

.public-account-trigger > .bi-person { font-size: 1.05rem; }
.public-account-chevron { font-size: .7rem; }

.public-account-dropdown {
  position: absolute;
  z-index: 1040;
  top: calc(100% + .55rem);
  right: 0;
  width: max-content;
  min-width: 9.75rem;
  padding: .4rem;
  border: 1px solid rgba(24, 49, 38, .1);
  border-radius: .6rem;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 42, 31, .2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-.35rem);
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.public-account-dropdown::before {
  content: '';
  position: absolute;
  top: -.4rem;
  right: 1.05rem;
  width: .75rem;
  height: .75rem;
  border-top: 1px solid rgba(24, 49, 38, .1);
  border-left: 1px solid rgba(24, 49, 38, .1);
  background: #fff;
  transform: rotate(45deg);
}

.public-account-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.public-account-dropdown a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.5rem;
  padding: .5rem .65rem;
  border-radius: .5rem;
  color: var(--text-dark);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.public-account-dropdown a:hover,
.public-account-dropdown a:focus-visible {
  color: var(--navbar-bg);
  background: #eef7f1;
}

.public-navbar .public-account-dropdown a.active,
.public-navbar .public-account-dropdown a.active:hover,
.public-navbar .public-account-dropdown a.active:focus-visible {
  color: #fff !important;
  background: #1e4d3a !important;
}

.public-account-dropdown a:focus-visible {
  outline: 2px solid var(--navbar-bg);
  outline-offset: -2px;
}

.public-account-dropdown a .bi {
  width: 1.15rem;
  color: var(--navbar-bg);
  font-size: 1.05rem;
  text-align: center;
}

.public-navbar .public-account-dropdown a.active .bi {
  color: #fff !important;
}

/* ===== LANGUAGE SWITCH (segmented EN | FIL) ===== */
.lang-switch {
  display: inline-flex;
  background: #eef1ef;
  border-radius: 30px;
  padding: 3px;
  gap: 2px;
}
.lang-switch-sidebar { display: flex; width: 100%; }
.lang-switch-opt {
  border: none;
  background: transparent;
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
}
.lang-switch-sidebar .lang-switch-opt { flex: 1; }
.lang-switch-opt:hover { color: var(--green-dark); }
.lang-switch-opt.active {
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Inside the green navbar the default light-grey track and green active
   chip both fight the background, so invert: translucent track, white chip
   with green text — the same treatment as .nav-link.active-pill. Scoped to
   .navbar so the sidebar toggle keeps its original look. */
.navbar .lang-switch { background: rgba(255, 255, 255, 0.14); }
.navbar .lang-switch-opt { color: rgba(255, 255, 255, 0.82); }
.navbar .lang-switch-opt:hover { color: var(--navbar-text-strong); }
.navbar .lang-switch-opt.active {
  background: var(--navbar-text-strong);
  color: var(--navbar-bg);
  box-shadow: none;
}

/* Mobile navbar spacing */
@media (max-width: 991px) {
  .navbar-nav {
    padding: 8px 0;
    gap: 4px !important;
  }

  .navbar .nav-link {
    padding: 8px 14px !important;
  }
}

@media (max-width: 767.98px) {
  /* role-shell.css is loaded globally and contains a legacy mobile
     `main { padding: 0 !important; }`; keep public shells authoritative. */
  main.page-shell--wide,
  main.page-shell--narrow {
    padding-inline: var(--page-gutter) !important;
  }
}

/* =========================
   FOOTER
========================= */
footer {
  background: var(--green-dark);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 48px;
}

#about-amfe,
#contact-us,
#contact {
  scroll-margin-top: 5.5rem;
}

@media (max-width: 767.98px) {
  body:has(.public-navbar) footer {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }
}

footer h5 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

footer p {
  font-size: 13px;
  opacity: 0.8;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
}

.footer-contact-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-contact-link:hover,
.footer-contact-link:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.footer-divider {
  border-color: rgba(255,255,255,0.15);
  margin: 20px 0 12px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  margin: 0 8px;
  transition: color 0.2s;
  display: inline-block;
  margin-bottom: 4px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy {
  font-size: 12px;
  opacity: 0.55;
  margin-top: 6px;
}

/* Footer privacy-policy link-button */
.footer-privacy-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  margin: 0 8px 4px;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
  display: inline-block;
}
.footer-privacy-btn:hover,
.footer-privacy-btn:focus-visible {
  color: #fff;
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Inline consent text link-button (Join page) */
.consent-policy-link {
  background: none;
  border: none;
  color: var(--green-mid);
  font-size: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}
.consent-policy-link:hover,
.consent-policy-link:focus-visible {
  color: var(--green-dark);
  outline: 2px solid var(--green-mid);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =========================
   PRIVACY POLICY MODAL
========================= */
.privacy-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: pmFadeIn 0.18s ease-out;
}

@keyframes pmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.privacy-modal-dialog {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #e5e7eb;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pmScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pmScaleUp {
  from { transform: scale(0.97) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Header */
.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  background: #ffffff;
  flex-shrink: 0;
}

.privacy-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.privacy-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e8f5ed;
  color: #1e4d3a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.privacy-modal-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.25;
}

.privacy-modal-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 3px 0 0 0;
}

.privacy-modal-close {
  background: #f3f4f6;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.privacy-modal-close:hover {
  background: #e5e7eb;
  color: #111827;
}
.privacy-modal-close:focus-visible {
  outline: 2px solid #1e4d3a;
  outline-offset: 2px;
}

/* Tabs Bar */
.privacy-tabs-bar {
  display: flex;
  gap: 6px;
  padding: 0 24px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  flex-shrink: 0;
  overflow-x: auto;
}

.privacy-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.privacy-tab-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}
.privacy-tab-btn.active {
  background: #1e4d3a;
  color: #ffffff;
}

/* Body */
.privacy-modal-body {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
  background: #fafbfb;
}

.privacy-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Notice strip */
.privacy-notice-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
}

.privacy-law-pill {
  background: #166534;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.privacy-notice-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: #14532d;
  margin: 0;
  font-weight: 500;
}

/* Card */
.privacy-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.privacy-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.privacy-card-bullet {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #e8f5ed;
  color: #1e4d3a;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.privacy-card-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.privacy-clean-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 30px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.privacy-clean-list li {
  position: relative;
  font-size: 12.5px;
  line-height: 1.5;
  color: #475569;
}

.privacy-clean-list li::before {
  content: '–';
  position: absolute;
  left: -12px;
  color: #94a3b8;
  font-weight: 600;
}

/* Callout */
.privacy-callout-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fffbeb;
  border: 1px solid #fef08a;
  border-radius: 12px;
  padding: 13px 16px;
}

.privacy-callout-icon {
  color: #ca8a04;
  flex-shrink: 0;
  margin-top: 1px;
}

.privacy-callout-title {
  font-size: 13px;
  font-weight: 700;
  color: #854d0e;
  margin: 0 0 2px 0;
}

.privacy-callout-text {
  font-size: 13px;
  line-height: 1.45;
  color: #713f12;
  margin: 0;
}

/* Cookies card */
.privacy-cookie-card {
  text-align: center;
  padding: 28px 20px;
}

.privacy-security-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8f5ed;
  color: #1e4d3a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.privacy-cookie-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
  max-width: 420px;
  margin: 0 auto;
}

/* Footer */
.privacy-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  gap: 12px;
}

.privacy-footer-text {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.btn-privacy-close {
  background: #1e4d3a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-privacy-close:hover {
  background: #256149;
}
.btn-privacy-close:focus-visible {
  outline: 2px solid #1e4d3a;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .privacy-modal-dialog { max-height: 92vh; border-radius: 14px; margin: 8px; }
  .privacy-modal-header { padding: 16px 18px 12px; }
  .privacy-tabs-bar     { padding: 0 16px 10px; }
  .privacy-tab-btn      { padding: 6px 10px; font-size: 11.5px; }
  .privacy-modal-body   { padding: 14px 16px; }
  .privacy-modal-footer { padding: 12px 16px; flex-direction: column; align-items: stretch; text-align: center; }
  .btn-privacy-close    { width: 100%; padding: 10px; }
}

/* =========================
   FORMS
========================= */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.form-control,
.form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  transition: border-color 0.2s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--green-dark);
  box-shadow: none;
}

.input-eye-wrap {
  position: relative;
}

.input-eye-wrap .form-control,
.input-eye-wrap .amfe-input {
  padding-right: 40px;
}

.eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
  line-height: 0;
}

.eye-btn:hover,
.eye-btn:focus-visible {
  color: #000;
}

/* =========================
   BUTTONS
========================= */
.btn-primary-green {
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary-green:hover {
  background: var(--green-mid);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline-green {
  background: #fff;
  color: var(--text-dark);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-outline-green:hover {
  border-color: var(--green-dark);
  color: var(--green-dark);
  transform: translateY(-2px);
}

/* Mobile buttons */
@media (max-width: 480px) {
  .btn-primary-green,
  .btn-outline-green {
    width: 100%;
    text-align: center;
  }

  .d-flex.gap-2.flex-wrap {
    flex-direction: column;
  }
}

img {
  max-width: 100%;
  height: auto;
}

.container,
.container-fluid {
  width: 100%;
}

body {
  overflow-x: hidden;
}

/* =========================
   MOBILE SIDEBAR
========================= */

.offcanvas {
  width: 220px !important;   
  background: #fff;
  position: fixed;
  top: 60px;
  right: 10px;
  max-height: 40vh;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid #eee;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.offcanvas-header {
    border-bottom: 1px solid #eee;
}

.offcanvas-title {
    font-weight: 700;
    color: var(--green-dark);
}

.mobile-link {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-dark);
    border-radius: 8px;
    margin-bottom: 5px;
}

.mobile-link {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.mobile-link .bi {
  width: 1.25rem;
  text-align: center;
}

.mobile-link:hover {
    background: var(--green-light);
}

.mobile-link.active {
  background: var(--green-dark);
  color: #fff;
  font-weight: 700;
}

.public-mobile-menu-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 1rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}

.public-mobile-links {
  display: grid;
  gap: .25rem;
}

.public-mobile-language {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid #e6ece8;
}

.public-mobile-language-label {
  display: block;
  margin-bottom: .65rem;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.public-mobile-language .lang-switch {
  width: 100%;
  min-height: 3rem;
}

.public-mobile-language .lang-switch-opt {
  flex: 1;
}

@media (max-width: 1199.98px) {
  .public-navbar .site-header-inner { min-height: 3.25rem; }
  .public-navbar .navbar-brand { min-width: 0; }
  .public-navbar .brand-text { min-width: 0; }
  .public-navbar .navbar-toggler,
  .offcanvas .mobile-link,
  .offcanvas .lang-switch-opt { min-height: 2.75rem; }
  #mobileMenu.offcanvas {
    top: 0;
    right: 0;
    width: min(19rem, 82vw) !important;
    max-height: 100dvh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  #mobileMenu .offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 5rem;
    padding: max(1.25rem, env(safe-area-inset-top)) 1.5rem 1.25rem;
    border-bottom: 0;
    background: var(--navbar-bg);
  }
  #mobileMenu .offcanvas-title {
    margin: 0;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
  }
  #mobileMenu .btn-close {
    width: 1.4rem;
    height: 1.4rem;
    margin: 0 0 0 auto;
    padding: .35rem;
    filter: brightness(0) invert(1);
    opacity: 1;
  }
  #mobileMenu .public-mobile-menu-body {
    padding: 1rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  }
  #mobileMenu .public-mobile-links { gap: .35rem; }
  #mobileMenu .mobile-link {
    min-height: 3.65rem;
    margin: 0;
    padding: .7rem 1rem;
    gap: .85rem;
    border-radius: .65rem;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
  }
  #mobileMenu .mobile-link .bi {
    display: inline-block;
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--navbar-bg);
    font-size: 1.15rem;
    line-height: 1;
  }
  #mobileMenu .mobile-link:hover,
  #mobileMenu .mobile-link:focus-visible { background: #f1f7f3; }
  #mobileMenu .mobile-link.active {
    background: var(--navbar-bg);
    color: #fff;
    font-weight: 700;
  }
  #mobileMenu .mobile-link.active .bi {
    background: transparent;
    color: #fff;
  }
  #mobileMenu .public-mobile-language {
    padding-top: 1.4rem;
    border-top-color: #dfe8e2;
  }
  #mobileMenu .public-mobile-language-label {
    margin-bottom: .85rem;
    font-size: .78rem;
    letter-spacing: .09em;
  }
  #mobileMenu .public-mobile-language .lang-switch {
    min-height: 3.25rem;
    border-radius: 999px;
  }
}

@media (max-width: 576px) {
  #mobileMenu.offcanvas { width: min(18rem, 82vw) !important; }
}

@media (max-height: 520px) and (max-width: 1199.98px) {
  .public-mobile-language {
    margin-top: 1rem;
  }
}

@media (max-width: 359.98px) {
  .public-navbar .brand-icon { width: 2.65rem; height: 2.65rem; }
  .public-navbar .brand-text strong { font-size: .82rem; }
  .public-navbar .brand-text span { font-size: .65rem; }
}

/* =========================
   FIELD NOTICE (validation popup)
   Standard style for all inline field errors/warnings app-wide.
========================= */
.field-notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  padding: 8px 12px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dark, #1a2e22);
}

.field-notice::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #e3e3e3;
  border-top: 1px solid #e3e3e3;
  transform: rotate(45deg);
}

.field-notice-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #e8590c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.field-notice-content {
  flex: 1;
  min-width: 0;
}

.field-notice-text {
  display: block;
}

.field-notice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.field-notice-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dark, #1e4d3a);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 13px;
  border-radius: 6px;
  border: 1px solid var(--green-dark, #1e4d3a);
  text-decoration: none !important;
  transition: all 0.15s ease;
  cursor: pointer;
}

.field-notice-btn-primary:hover {
  background: var(--green-mid, #2d6a4f);
  border-color: var(--green-mid, #2d6a4f);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(30, 77, 58, 0.25);
}

.field-notice-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f8f5;
  color: var(--green-dark, #1e4d3a) !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 13px;
  border-radius: 6px;
  border: 1px solid #cce3d5;
  text-decoration: none !important;
  transition: all 0.15s ease;
  cursor: pointer;
}

.field-notice-btn-secondary:hover {
  background: #e3f0e8;
  border-color: #a7cfb7;
  color: var(--green-dark, #1e4d3a) !important;
  transform: translateY(-1px);
}

.field-notice-btn-primary i,
.field-notice-btn-secondary i {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 480px) {
  .field-notice-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .field-notice-btn-primary,
  .field-notice-btn-secondary {
    justify-content: center;
    width: 100%;
    text-align: center;
  }
}

/* DESKTOP SIDEBAR (Facebook style) */
.desktop-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #eee;
  padding: 20px;
  display: none;
}

/* push page content */
body.sidebar-open .page-content {
  margin-right: 280px;
  transition: 0.3s ease;
}

/* =========================
   SCROLL TO TOP (UP BUTTON)
========================= */
.scroll-to-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navbar-bg, #1e4d3a);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-to-top-btn:hover {
  background: #27674e;
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.4);
  color: #ffffff;
}

.scroll-to-top-btn:active {
  transform: translateY(0) scale(0.96);
}

.scroll-to-top-btn.with-chat {
  bottom: 82px;
  right: 24px;
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    right: 1rem;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .scroll-to-top-btn.with-chat {
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── Shared pagination controls ──────── */
.pagination-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.pagination-bar button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #d8dfd9);
  background: #fff;
  color: var(--text-dark, #1e2a22);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pagination-bar button:hover:not(:disabled) {
  background: #f4f7f5;
  border-color: var(--primary, #1e4d3a);
}
.pagination-bar button.active {
  background: var(--primary, #1e4d3a);
  border-color: var(--primary, #1e4d3a);
  color: #fff;
}
.pagination-bar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-info {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted, #8a9a90);
}
.pagination-ellipsis {
  padding: 0 4px;
  color: var(--text-muted, #8a9a90);
  font-size: 13px;
}
/* Responsive replacement for native month panels, which some mobile
   browsers render wider than the viewport. */
.responsive-month-native-proxy {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%);
}
.responsive-month-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  text-align: left;
  cursor: pointer;
}
.responsive-month-trigger .responsive-month-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}
.responsive-month-trigger > i { flex: 0 0 auto; }
.responsive-month-trigger .responsive-month-caret {
  font-size: 0.72rem;
  opacity: 0.7;
}
.responsive-month-popover {
  position: fixed;
  z-index: 2200;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  padding: .75rem;
  overflow-y: auto;
  border: 1px solid #d8dfd9;
  border-radius: .85rem;
  color: #1e2a22;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
}
.responsive-month-year {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  align-items: center;
  margin-bottom: .55rem;
}
.responsive-month-year strong { text-align: center; font-size: 1rem; }
.responsive-month-year button,
.responsive-month-grid button {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 0;
  border-radius: .55rem;
  color: #1e2a22;
  background: transparent;
  cursor: pointer;
}
.responsive-month-year button { width: 2.5rem; height: 2.5rem; }
.responsive-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
}
.responsive-month-grid button { min-height: 2.65rem; padding: .45rem; font-size: .9rem; }
.responsive-month-year button:hover:not(:disabled),
.responsive-month-grid button:hover:not(:disabled) { background: #edf7f1; color: #1e4d3a; }
.responsive-month-grid button.active { color: #fff; background: #1e4d3a; font-weight: 700; }
.responsive-month-year button:disabled,
.responsive-month-grid button:disabled { opacity: .35; cursor: not-allowed; }
