/* ==========================================================================
   Resources — modal (Forms/Policies list → PDF viewer), desktop dropdown,
   mobile FAB. Brand fonts throughout.
   ========================================================================== */

/* ---------- modal ---------- */
.resources-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}
.resources-modal-overlay[hidden] { display: none; }
body.resources-modal-open { overflow: hidden; }
/* Hide the fixed mobile bottom nav while the modal is open so it can't cover
   the viewer's action bar (Download / Print / Complete & Sign). */
body.resources-modal-open .mobile-menu-wrapper { display: none !important; }

.resources-modal {
  width: 100%;
  max-width: 720px;
  height: min(80vh, 760px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  font-family: var(--font-body, 'Nunito Sans', sans-serif);
}

.resources-modal__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: var(--navbar-bg, #5271ff);
  color: #fff;
}
.resources-modal__title {
  flex: 1;
  margin: 0;
  font-family: var(--font-heading, 'Baloo 2', cursive);
  font-size: 20px;
  color: #fff;
  text-align: center;
}
.resources-modal__back,
.resources-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.resources-modal__back[hidden] { visibility: hidden; display: inline-block; }
.resources-modal__back:hover,
.resources-modal__close:hover { background: rgba(255, 255, 255, 0.28); }

.resources-modal__body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
}

/* ---------- menu + list ---------- */
.resources-menu,
.resources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resources-menu__item,
.resources-list__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body, 'Nunito Sans', sans-serif);
  color: var(--text-color-body, #333);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.resources-menu__item:hover,
.resources-list__item:hover { background: #f7f9ff; border-color: #d7def8; }
.resources-menu__item:active,
.resources-list__item:active { transform: scale(0.99); }

.resources-menu__item span:nth-child(2) {
  flex: 1;
  font-family: var(--font-heading, 'Baloo 2', cursive);
  font-size: 18px;
}
.resources-menu__icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #fff3e6;
  color: #f88e24;
  flex: 0 0 auto;
}
.resources-menu__item > svg,
.resources-list__item > svg { color: #9aa4bf; flex: 0 0 auto; }

.resources-list__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.resources-list__title {
  font-family: var(--font-heading, 'Baloo 2', cursive);
  font-size: 17px;
  color: var(--text-color-heading, #1a1a1a);
}
.resources-list__desc { font-size: 14px; color: var(--text-color-muted, #6b7280); }

.resources-loading,
.resources-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-color-muted, #6b7280);
}

/* ---------- viewer ---------- */
.resources-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 12px;
}
.resources-viewer__frame {
  flex: 1;
  width: 100%;
  min-height: 300px;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  background: #f3f4f6;
}
/* mobile canvas viewer (PDF.js) — the modal body scrolls the pages while the
   control bar stays pinned to the top so the actions are always reachable. */
.resources-viewer--canvas {
  display: block;
  height: auto;
  gap: 0;
}
.resources-viewer__controls {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 -18px 10px;   /* span to the body's side padding edges; keep natural top */
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid #eef1f6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.resources-viewer--canvas .resources-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0;
  flex: 0 0 auto;
}
/* compact action buttons (≈50% of the default vertical padding) */
.resources-viewer--canvas .resources-viewer__actions {
  justify-content: stretch;
  gap: 8px;
}
.resources-viewer--canvas .resources-viewer__btn {
  flex: 1 1 auto;
  min-width: 120px;   /* keeps full labels; wraps to a 2nd row instead of clipping */
  justify-content: center;
  padding: 5px 9px;
  font-size: 14px;
}
.resources-viewer__zoom {
  width: 40px;
  height: 34px;
  border: 1px solid #e2e7f0;
  border-radius: 8px;
  background: #f7f9ff;
  color: #333;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.resources-viewer__zoom:active { background: #e2e7f0; }
.resources-viewer__pageinfo {
  min-width: 120px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color-muted, #6b7280);
}
.resources-viewer__pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  background: #f3f4f6;
  border: 1px solid #eef1f6;
  border-radius: 10px;
}
.resources-pdf-page {
  max-width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  background: #fff;
  display: block;
}
.resources-viewer__fallback { text-align: center; padding: 12px; font-size: 14px; }
.resources-viewer__fallback a { color: #f88e24; font-weight: 700; }

.resources-viewer__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.resources-viewer__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-ui, 'Nunito Sans', sans-serif);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.resources-viewer__btn--primary { background: #f88e24; color: #fff; }
.resources-viewer__btn--primary:hover { background: #e07d16; }
.resources-viewer__btn--secondary { background: #eef1f6; color: #333; }
.resources-viewer__btn--secondary:hover { background: #e2e7f0; }

/* ---------- desktop Resources dropdown ---------- */
.resources-dropdown { position: relative; }
.resources-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 180px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 60;
}
.resources-dropdown:hover .resources-dropdown__menu,
.resources-dropdown:focus-within .resources-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(2px);
}
.resources-dropdown__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-ui, 'Nunito Sans', sans-serif);
  font-size: 15px;
  color: #333;
  text-align: left;
  text-decoration: none;
}
.resources-dropdown__link:hover { background: #f7f9ff; color: #f88e24; }

/* ---------- launch flag: hide Resources nav until ready ---------- */
.resources-dropdown.is-hidden,
.mobile-link-wrapper.is-hidden { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .resources-modal { height: 92vh; max-width: 100%; border-radius: 14px; }
  .resources-viewer__actions { justify-content: stretch; }
  .resources-viewer__btn { flex: 1; justify-content: center; }
}

/* Complete & Sign (DocuVise) button */
.resources-viewer__btn--sign { background: #2e7d32; color: #fff; }
.resources-viewer__btn--sign:hover { background: #256628; }
