/* ═══════════════════════════════════════════════════════════════
 * Harbor Home Healthcare — Policy Library CSS
 * Version: 9.0 | 2026-04-13
 * ═══════════════════════════════════════════════════════════════ */

/* ── Wrap ── */
.hpl-wrap{max-width:1440px;margin:0 auto;padding:28px 24px 56px;font-family:inherit}

/* ── Auth bar (top right: signed in / sign out) ── */
.hpl-auth-bar{display:flex;align-items:center;gap:10px;justify-content:flex-end;margin-bottom:16px;flex-wrap:wrap}
.hpl-auth-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 13px;border-radius:999px;font-weight:700;font-size:12px}
.hpl-auth-pill.loggedin{background:#dcfce7;color:#166534}
.hpl-auth-pill.loggedout{background:#fef3c7;color:#92400e}
.hpl-auth-pill-dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}
.hpl-login-trigger{padding:8px 18px;border-radius:8px;border:1.5px solid #0d2f52;background:#0d2f52;color:#fff;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;gap:6px;transition:background .15s}
.hpl-login-trigger:hover{background:#7a1f2b;border-color:#7a1f2b}
.hpl-logout-link{padding:7px 16px;border-radius:8px;border:1.5px solid #7a1f2b;background:transparent;color:#7a1f2b;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:6px;transition:background .15s}
.hpl-logout-link:hover{background:#fdf4f7}

/* ── Access notice ── */
.hpl-access-notice{display:flex;align-items:flex-start;gap:14px;background:#f0f9ff;border:1px solid #bae6fd;border-left:4px solid #0d2f52;border-radius:8px;padding:14px 16px;margin-bottom:16px;font-size:14px;color:#0c4a6e}
.hpl-access-notice strong{display:block;font-size:15px;margin-bottom:4px;color:#0d2f52}
.hpl-access-notice p{margin:0 0 5px;line-height:1.6}
.hpl-access-notice p:last-child{margin:0}

/* ── Auth banner (shown when auth_required=1) ── */
.hpl-auth-banner{display:none;background:#fffbeb;border:1px solid #fde047;border-left:4px solid #ca8a04;border-radius:8px;padding:11px 14px;margin-bottom:12px;font-size:14px;color:#713f12;flex-wrap:wrap;gap:10px;align-items:center}
.hpl-auth-banner.show{display:flex}
.hpl-auth-banner button{margin-left:auto;padding:6px 13px;background:#7a1f2b;color:#fff;border:none;border-radius:6px;font-weight:700;cursor:pointer;font-family:inherit;font-size:13px}

/* ── How to ── */
.hpl-howto-title{margin:0 0 4px;font-weight:700;color:#111827;font-size:14px}
.hpl-howto{margin:0 0 14px;padding-left:1.2rem;color:#374151;font-size:14px}
.hpl-howto>li{margin-bottom:4px}
.hpl-howto-label{color:#7a1f2b;font-weight:400}

/* ── Controls ── */
.hpl-controls{display:grid;grid-template-columns:1fr 300px;gap:12px;margin:0 0 10px}
@media(max-width:640px){.hpl-controls{grid-template-columns:1fr}}
.hpl-search,.hpl-volume{padding:10px 13px;border:1.5px solid #d1d5db;border-radius:8px;font-size:14px;font-family:inherit;width:100%;outline:none;color:#111827;transition:border .15s}
.hpl-search:focus,.hpl-volume:focus{border-color:#0d2f52;box-shadow:0 0 0 3px rgba(13,47,82,.08)}
.hpl-count{color:#6b7280;font-weight:700;font-size:13px;margin:0 0 10px}

/* ── Table ── */
.hpl-table-wrap{overflow-x:auto;border-radius:10px}
#hplTable{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;font-size:14px;box-shadow:0 1px 3px rgba(15,23,42,.06)}
#hplTable thead th{position:sticky;top:0;z-index:2;background:#7a1f2b;color:#fff;text-align:left;padding:12px 16px;font-weight:700;cursor:pointer;user-select:none;font-size:12px;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;transition:background .15s}
#hplTable thead th:hover{background:#601823}
#hplTable tbody td{padding:11px 16px;border-bottom:1px solid #f3f4f6;vertical-align:top;font-size:14px;color:#111827}
#hplTable tbody tr:last-child td{border-bottom:none}
#hplTable tbody tr:nth-child(odd){background:#fff}
#hplTable tbody tr:nth-child(even){background:#f7f7fb}
#hplTable tbody tr:hover{background:#fdf4f7;cursor:pointer}
#hplTable a{color:#0d2f52;text-decoration:none;font-weight:700}
#hplTable a:hover{color:#7a1f2b;text-decoration:underline}
.hpl-sort-ind{font-weight:400;opacity:.8;margin-left:.25rem;font-size:10px}
.hpl-lock{font-size:11px;margin-left:4px;color:#9ca3af;vertical-align:middle}

/* ── Drawer (full-screen policy reader) ── */
.hpl-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:9998}
.hpl-backdrop.open{display:block}
.hpl-drawer{display:none;position:fixed;inset:0;background:#f5f5f0;z-index:9999;flex-direction:column}
.hpl-drawer.open{display:flex}
.hpl-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;background:#fff;border-bottom:1px solid #e5e7eb;box-shadow:0 2px 6px rgba(0,0,0,.07);gap:14px;min-height:56px}
.hpl-drawer-title{font-weight:800;font-size:15px;color:#0d2f52;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hpl-drawer-direct{font-size:12px;font-weight:700;color:#7a1f2b;text-decoration:none;border:1px solid #7a1f2b;padding:5px 12px;border-radius:6px;display:none}
.hpl-drawer-direct.show{display:inline-flex;align-items:center;gap:5px}
.hpl-close-btn{width:40px;height:40px;border:2px solid #7a1f2b;background:#7a1f2b;color:#fff;border-radius:50%;font-size:22px;font-weight:900;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;line-height:1;transition:background .15s}
.hpl-close-btn:hover{background:#601823;border-color:#601823}
.hpl-frame-wrap{flex:1;position:relative;min-height:0}
.hpl-frame{width:100%;height:100%;border:0;display:block;background:#fff}
.hpl-loading{display:none;position:absolute;inset:0;background:rgba(245,245,240,.93);align-items:center;justify-content:center;flex-direction:column;gap:14px;z-index:2}
.hpl-loading.show{display:flex}
.hpl-loading-spinner{width:36px;height:36px;border:3px solid #e5e7eb;border-top-color:#0d2f52;border-radius:50%;animation:hpl-spin .8s linear infinite}
@keyframes hpl-spin{to{transform:rotate(360deg)}}
.hpl-loading-text{font-size:14px;font-weight:700;color:#0d2f52}

/* ═══════════════════════════════════════════════════════════════
 * LOGIN MODAL — matches design: navy left panel, clean right form
 * ═══════════════════════════════════════════════════════════════ */
.hpl-modal-bg{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  z-index:10000;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.hpl-modal-bg.open{display:flex}

.hpl-modal{
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  width:100%;
  max-width:780px;
  box-shadow:0 32px 80px rgba(0,0,0,.28);
  display:flex;
  animation:hpl-modal-in .24s cubic-bezier(.34,1.56,.64,1);
}
@keyframes hpl-modal-in{
  from{opacity:0;transform:scale(.94) translateY(16px)}
  to{opacity:1;transform:none}
}

/* LEFT PANEL — navy */
.hpl-modal-left{
  width:38%;
  min-width:220px;
  background:#0d2f52;
  padding:38px 32px;
  display:flex;
  flex-direction:column;
  gap:0;
  justify-content:space-between;
  position:relative;
  overflow:hidden;
}
/* decorative circle */
.hpl-modal-left::after{
  content:'';
  position:absolute;
  bottom:-80px;
  right:-80px;
  width:220px;
  height:220px;
  border-radius:50%;
  background:rgba(122,31,43,.18);
  pointer-events:none;
}
.hpl-modal-left-top{}

.hpl-modal-left-brand{
  font-size:16px;
  font-weight:800;
  color:#fff;
  line-height:1.25;
  margin-bottom:3px;
}
.hpl-modal-left-sub{
  font-size:10px;
  color:rgba(255,255,255,.5);
  font-weight:700;
  letter-spacing:.18em;
  text-transform:uppercase;
  margin-bottom:32px;
  display:block;
}

.hpl-modal-left-headline{
  font-size:24px;
  font-weight:900;
  color:#fff;
  line-height:1.25;
  margin:0 0 14px;
}
.hpl-modal-left-desc{
  font-size:13px;
  color:rgba(255,255,255,.72);
  line-height:1.7;
  margin:0;
}

/* green TLS badge */
.hpl-modal-tls{
  display:inline-flex;
  align-items:center;
  gap:7px;
  background:rgba(34,197,94,.14);
  border:1px solid rgba(34,197,94,.35);
  border-radius:999px;
  padding:6px 14px;
  font-size:12px;
  color:#4ade80;
  font-weight:700;
  margin-top:28px;
  width:fit-content;
}
.hpl-modal-tls::before{
  content:'';
  width:7px;
  height:7px;
  border-radius:50%;
  background:#22c55e;
  flex-shrink:0;
  box-shadow:0 0 0 3px rgba(34,197,94,.2);
}
.hpl-modal-left-domain{
  font-size:11px;
  color:rgba(255,255,255,.25);
  margin-top:auto;
  padding-top:28px;
}
.hpl-modal-dismiss{
  position:absolute;
  top:14px;
  right:14px;
  background:rgba(255,255,255,.12);
  border:none;
  color:rgba(255,255,255,.7);
  font-size:18px;
  cursor:pointer;
  line-height:1;
  padding:5px 9px;
  border-radius:6px;
  transition:background .15s;
}
.hpl-modal-dismiss:hover{background:rgba(255,255,255,.22);color:#fff}

/* RIGHT PANEL — form */
.hpl-modal-right{
  flex:1;
  padding:40px 38px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.hpl-modal-right h2{
  font-size:24px;
  font-weight:800;
  color:#0d2f52;
  margin:0 0 6px;
  letter-spacing:-.3px;
}
.hpl-modal-sub{
  font-size:13px;
  color:#6b7280;
  margin:0 0 26px;
  line-height:1.5;
}
.hpl-modal-error{
  display:none;
  background:#fef2f2;
  border:1px solid #fecaca;
  border-left:3px solid #dc2626;
  border-radius:8px;
  padding:10px 14px;
  font-size:13px;
  color:#b91c1c;
  font-weight:700;
  margin-bottom:16px;
}
.hpl-modal-error.show{display:block}

/* fields */
.hpl-field{margin-bottom:16px}
.hpl-field label{
  display:block;
  font-size:11px;
  font-weight:800;
  color:#374151;
  margin-bottom:6px;
  text-transform:uppercase;
  letter-spacing:.1em;
}
.hpl-field input[type="email"],
.hpl-field input[type="password"]{
  width:100%;
  padding:12px 14px;
  border:1.5px solid #e5e7eb;
  border-radius:8px;
  font-size:14px;
  font-family:inherit;
  outline:none;
  color:#111827;
  background:#fff;
  transition:border .15s,box-shadow .15s;
}
.hpl-field input:focus{
  border-color:#0d2f52;
  box-shadow:0 0 0 3px rgba(13,47,82,.1);
}
.hpl-field input::placeholder{color:#9ca3af}

/* remember me */
.hpl-remember{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#6b7280;
  margin:4px 0 18px;
  cursor:pointer;
}
.hpl-remember input{
  width:15px;
  height:15px;
  accent-color:#0d2f52;
  cursor:pointer;
}

/* sign in button */
.hpl-modal-submit{
  width:100%;
  padding:13px 16px;
  background:#0d2f52;
  color:#fff;
  border:none;
  border-radius:8px;
  font-size:15px;
  font-weight:700;
  font-family:inherit;
  cursor:pointer;
  transition:background .18s,transform .12s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  letter-spacing:.01em;
}
.hpl-modal-submit:hover{background:#7a1f2b;transform:translateY(-1px)}
.hpl-modal-submit:active{transform:none}
.hpl-modal-submit:disabled{opacity:.6;cursor:not-allowed;transform:none}

/* links row below button */
.hpl-modal-links-row{
  margin-top:14px;
  text-align:center;
  font-size:13px;
  color:#6b7280;
  line-height:1.6;
}
.hpl-modal-links-row a{
  color:#7a1f2b;
  font-weight:700;
  text-decoration:none;
}
.hpl-modal-links-row a:hover{text-decoration:underline}

/* OR divider */
.hpl-modal-or{
  display:flex;
  align-items:center;
  gap:12px;
  margin:16px 0;
  color:#d1d5db;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.hpl-modal-or::before,
.hpl-modal-or::after{
  content:'';
  flex:1;
  height:1px;
  background:#e5e7eb;
}
.hpl-modal-or span{color:#9ca3af}

/* access request row */
.hpl-modal-access{
  text-align:center;
  font-size:13px;
  color:#6b7280;
}
.hpl-modal-access a{
  color:#0d2f52;
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:2px;
}
.hpl-modal-access a:hover{color:#7a1f2b}

/* honeypot */
.hpl-hp{position:absolute;left:-9999px;top:-9999px;overflow:hidden;pointer-events:none;opacity:0}

/* ── Responsive ── */
@media(max-width:680px){
  .hpl-modal{flex-direction:column;max-height:92vh;overflow-y:auto}
  .hpl-modal-left{width:100%;padding:28px 24px 24px;min-width:0}
  .hpl-modal-left-headline{font-size:20px}
  .hpl-modal-right{padding:28px 24px}
  .hpl-modal-left-domain{display:none}
  #hplTable thead th:nth-child(n+5),#hplTable tbody td:nth-child(n+5){display:none}
}
@media(max-width:480px){
  #hplTable thead th:nth-child(n+4),#hplTable tbody td:nth-child(n+4){display:none}
  .hpl-modal-right{padding:24px 20px}
}