/* Post Office Forms — ported from the PostPay Android app (More ▸ Post Office Forms).
   Scoped under .forms-hero / .forms-page so it never leaks into other pages. */

.page-hero.forms-hero {
  background: linear-gradient(135deg, #087AF0 0%, #079FD3 52%, #21C9C8 100%) !important;
  border-bottom: 3px solid #F6B600;
}
.page-hero.forms-hero::before { background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, transparent 70%); }
.forms-hero-badge { display: inline-block; font-size: 34px; line-height: 1; margin-bottom: 8px; }
.page-hero.forms-hero p { color: rgba(255,255,255,0.94); font-weight: 600; }

.forms-page {
  max-width: 1000px;
  margin: 0 auto 30px;
  padding: 24px 24px 28px;
  background: #F8F9FA;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
  font-size: 14px;
  line-height: 1.5;
  color: #34495E;
}
.forms-page a { text-decoration: none; }

/* ---- Title row + download help ---- */
.forms-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #2F80FF;
}
.forms-page-title { margin: 0; min-width: 0; color: #102A62; font-size: 22px; font-weight: 900; line-height: 1.25; }
.forms-help-tab {
  flex-shrink: 0;
  border: 1.5px solid #4B8CFF;
  background: #FFFFFF;
  color: #0753B8;
  border-radius: 999px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11,61,145,0.10);
}
.forms-help-tab:hover { background: #EAF4FF; }
.forms-help-tab:active { transform: scale(0.96); background: #D6EAF8; }

.forms-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  padding: 14px;
}
.forms-help-sheet {
  position: relative;
  width: min(100%, 440px);
  max-height: 92vh;
  overflow: auto;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.35);
}
.forms-help-close {
  position: sticky;
  top: 8px;
  float: right;
  width: 36px;
  height: 36px;
  margin: 8px 8px -44px 0;
  border: none;
  border-radius: 50%;
  background: rgba(11, 61, 145, 0.92);
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1;
  z-index: 1;
  cursor: pointer;
}
.forms-help-image { display: block; width: 100%; height: auto; }

/* ---- Info box ---- */
.forms-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #EAF4FF;
  border: 1px solid #B9D8FF;
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #0D4AA4;
}
.forms-info-icon { flex-shrink: 0; font-size: 17px; margin-top: 1px; }

/* ---- Search ---- */
.forms-search-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #FFFFFF;
  border: 1px solid #CFD7E3;
  border-radius: 11px;
  padding: 0 14px;
  margin-bottom: 14px;
  height: 48px;
  box-shadow: inset 0 1px 2px rgba(20,45,80,0.03);
}
.forms-search-icon { font-size: 16px; color: #95A5A6; flex-shrink: 0; }
.forms-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #2C3E50;
  background: transparent;
  min-width: 0;
  caret-color: #000;
  text-align: left;
  direction: ltr;
}
.forms-search-input::placeholder { color: #ABB2B9; }
.forms-search-bar:focus-within { border-color: #4B8CFF; box-shadow: 0 0 0 3px rgba(75,140,255,0.16); }

/* ---- Category chips ---- */
.forms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}
.forms-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #CBD4E0;
  background: #FFFFFF;
  color: #173369;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.forms-chip:hover { background: #EAF4FF; }
.forms-chip.active {
  background: linear-gradient(135deg, #087AF0, #0758D4);
  color: #FFFFFF;
  border-color: #0870E5;
  box-shadow: 0 5px 12px rgba(8,100,225,0.23);
}
.forms-chip:active { transform: scale(0.95); }

/* ---- Loading / empty ---- */
.forms-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 0; color: #7F8C8D; font-size: 13px; }
.forms-spinner { width: 28px; height: 28px; border: 3px solid #E8ECEF; border-top-color: #0B3D91; border-radius: 50%; animation: formsSpin 0.8s linear infinite; }
@keyframes formsSpin { to { transform: rotate(360deg); } }
.forms-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 0; text-align: center; }
.forms-empty-icon { font-size: 32px; }
.forms-empty-text { font-size: 14px; color: #7F8C8D; }
.forms-retry-btn { margin-top: 8px; padding: 9px 22px; background: #0B3D91; color: #FFFFFF; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.forms-retry-btn:active { transform: scale(0.96); }
.forms-count { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #68758D; }

/* ---- Form cards ---- */
.forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.forms-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #DEE5ED;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(30,55,85,0.08);
}
.forms-card-header { display: flex; gap: 12px; align-items: flex-start; }
.forms-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}
.forms-card-info { flex: 1; min-width: 0; }
.forms-card-title { color: #102A62; font-size: 15.5px; font-weight: 900; line-height: 1.3; margin-bottom: 3px; }
.forms-card-purpose { color: #68758D; font-size: 13px; line-height: 1.45; }
.forms-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.forms-card-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.forms-download-btn {
  min-width: 128px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #0873DF, #064BC1);
  color: #FFFFFF;
  border: none;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 5px 11px rgba(6,77,193,0.22);
}
.forms-download-btn:hover { filter: brightness(1.07); }
.forms-download-btn:active { transform: scale(0.97); }

/* ---- Bottom link back to IPPB ---- */
.forms-bottom-nav { margin-top: 22px; padding-top: 18px; border-top: 1px solid #E5E5E5; text-align: center; }
.forms-back-link { display: inline-flex; align-items: center; gap: 5px; padding: 11px 24px; background: #EAF4FF; color: #0753B8; border-radius: 10px; font-size: 14px; font-weight: 800; }
.forms-back-link:hover { background: #D6EAF8; text-decoration: none; }

@media (max-width: 760px) {
  .forms-page { padding: 18px 14px 22px; border-radius: 16px; }
  .forms-title-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .forms-page-title { font-size: 19px; }
  .forms-grid { grid-template-columns: 1fr; }
  .forms-card-footer { flex-wrap: wrap; }
  .forms-download-btn { width: 100%; }
}
