/* ============================================================
   PA Housing Fund — Visual System
   Palette matches the KIVA/PHFA screenshots.
   ============================================================ */

:root {
  --navy-dark:  #0a2540;
  --navy:       #0b4f7a;
  --navy-hover: #083d5e;
  --green:      #7cb342;
  --green-hover:#689f38;
  --green-dark: #558b2f;
  --gold:       #c9a227;
  --orange:     #d94f04;
  --red:        #b60606;
  --gray-bg:    #f4f6f8;
  --card-bg:    #ffffff;
  --border:     #d9dee3;
  --text:       #1a2733;
  --muted:      #6b7a89;
  --shadow-sm:  0 1px 2px rgba(10, 37, 64, .06);
  --shadow-md:  0 2px 8px rgba(10, 37, 64, .08);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  background: var(--gray-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  padding-top: 64px; /* offset for fixed navbar */
}

/* ---------- Navbar ---------- */

.navbar-pahf {
  background: var(--navy-dark);
  border: 0;
  border-radius: 0;
  min-height: 56px;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
}
.navbar-pahf .navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff !important;
  font-weight: 600;
  font-size: 16px;
  height: 56px;
  padding: 0 16px;
}
.navbar-pahf .navbar-brand:hover { color: #fff !important; }
.navbar-pahf .pahf-logo {
  height: 30px;
  width: auto;
  display: block;
}
.navbar-pahf .pahf-title {
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.navbar-pahf .nav > li > a {
  color: #dbe7f0 !important;
  font-weight: 500;
  padding: 18px 16px;
}
.navbar-pahf .nav > li > a:hover,
.navbar-pahf .nav > li > a:focus {
  background: var(--navy) !important;
  color: #fff !important;
}
.navbar-pahf .navbar-user {
  color: #fff !important;
  font-weight: 500;
}

/* ---------- Layout ---------- */

.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.page-title {
  color: var(--navy);
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0 16px;
  letter-spacing: -0.5px;
}

/* ---------- Cards ---------- */

.pahf-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}
.pahf-card__header {
  background: var(--navy);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 20px;
  margin: 0;
}
.pahf-card__header--green {
  background: var(--green-dark);
}
.pahf-card__header--teal {
  background: var(--navy);
}
.pahf-card__body {
  padding: 20px;
}
.pahf-card__body p:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */

.btn-pahf-primary,
.btn-pahf-green {
  background: var(--green);
  border: 1px solid var(--green);
  color: #fff;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 13px;
  transition: background .15s ease, border-color .15s ease;
}
.btn-pahf-primary:hover,
.btn-pahf-primary:focus,
.btn-pahf-green:hover,
.btn-pahf-green:focus {
  background: var(--green-hover);
  border-color: var(--green-hover);
  color: #fff;
}
.btn-pahf-green-block {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 15px;
  padding: 14px;
  letter-spacing: 1px;
}
.btn-pahf-navy {
  background: var(--navy);
  border: 1px solid var(--navy);
  color: #fff;
  font-weight: 600;
}
.btn-pahf-navy:hover { background: var(--navy-hover); color: #fff; }
.btn-pahf-outline {
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
  font-weight: 600;
}
.btn-pahf-outline:hover { background: var(--navy); color: #fff; }

/* Documentation buttons (screenshot 1) */
.doc-btn {
  display: block;
  width: 100%;
  padding: 12px 18px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #1e5b8f 0%, #0b3a5e 100%);
  color: #fff !important;
  text-align: center;
  text-decoration: underline;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid #082c46;
}
.doc-btn:hover {
  background: linear-gradient(180deg, #2368a1 0%, #0d446c 100%);
  color: #fff !important;
}

/* ---------- Forms ---------- */

.form-control {
  border-radius: 4px;
  border: 1px solid #cbd3db;
  height: 42px;
  box-shadow: none;
  font-size: 15px;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(11, 79, 122, .15);
}
textarea.form-control { height: auto; min-height: 90px; }
label { color: var(--text); font-weight: 500; }

/* ---------- Empty-state text (gold, matches screenshot) ---------- */

.empty-state {
  color: var(--gold);
  font-weight: 600;
  padding: 20px;
  margin: 0;
}

/* ---------- Progress bar ---------- */

.grant-progress {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 22px 26px;
  margin-bottom: 24px;
}
.grant-progress__title {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
}
.grant-progress__sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.grant-progress__bar {
  height: 26px;
  background: #eef2f6;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid #dde4ea;
}
.grant-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width .4s ease;
}
.grant-progress__stages {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.grant-progress__stages span.active { color: var(--green-dark); font-weight: 700; }

/* ---------- Award panel ---------- */

.award-panel {
  background: #f8fafc;
  border: 1px solid #dbe4ec;
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.award-panel__label {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.award-panel__value { font-size: 15px; color: var(--text); margin-bottom: 12px; }

/* ---------- Report ---------- */

.report-box {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfdff;
  overflow: hidden;
}
.report-box__header {
  background: var(--navy-dark);
  color: #fff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
}
.report-box__body { padding: 16px; }
.report-row {
  display: flex;
  border-bottom: 1px solid #eef2f6;
  padding: 10px 0;
  font-size: 14px;
}
.report-row:last-child { border-bottom: 0; }
.report-row__k { color: var(--muted); min-width: 160px; font-weight: 500; }
.report-row__v { color: var(--text); font-weight: 600; }

/* ---------- Alerts / notes ---------- */

.alert-note-red {
  background: #fdecea;
  border: 1px solid #e74c3c;
  color: var(--red);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 14px;
}
.alert-note-gold {
  background: #fff8e1;
  border: 1px solid #f0c14b;
  color: #8a6d00;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 14px;
}

/* ---------- Tables ---------- */

table.data-table { background: #fff; }
table.data-table th { background: #eef2f6; color: var(--navy); font-weight: 600; }
table.data-table td, table.data-table th { vertical-align: middle !important; }

/* ---------- Utility ---------- */

.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-muted-2 { color: var(--muted); }
.generated-at { color: var(--muted); font-size: 13px; margin-top: 24px; text-align: right; }

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .navbar-pahf .pahf-title { max-width: 40vw; font-size: 14px; }
}
@media (max-width: 767px) {
  body { padding-top: 56px; font-size: 14px; }
  .page-title { font-size: 26px; }
  .navbar-pahf .pahf-title { display: none; }
  .pahf-card__body { padding: 16px; }
  .grant-progress { padding: 18px 16px; }
  .grant-progress__stages { font-size: 10px; }
  .report-row { flex-direction: column; }
  .report-row__k { min-width: 0; margin-bottom: 2px; }
}

/* ---------- Collapsible sections (legislation page) ---------- */

details.pahf-collapse {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 8px;
  background: #fff;
}
details.pahf-collapse > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--navy);
  background: #f4f7fa;
  border-radius: 4px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.pahf-collapse > summary::-webkit-details-marker { display: none; }
details.pahf-collapse > summary::after {
  content: '▾';
  color: var(--muted);
  transition: transform .15s ease;
}
details.pahf-collapse[open] > summary::after { transform: rotate(180deg); }
details.pahf-collapse > summary:hover { background: #e8eff5; }
details.pahf-collapse > ul {
  padding: 12px 18px 12px 32px;
  margin: 0;
  border-top: 1px solid var(--border);
}
details.pahf-collapse > ul li { margin-bottom: 6px; }
details.pahf-collapse > ul li a { color: var(--navy); }
details.pahf-collapse > ul li a:hover { color: var(--navy-hover); text-decoration: underline; }

/* ---------- Callout box (like .alert-phare on phfa.org) ---------- */

.alert-phare {
  background: #e8f1f8;
  border-left: 4px solid var(--navy);
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 14px;
}
.alert-phare p:last-child { margin-bottom: 0; }
.alert-phare ul { margin: 8px 0 0 0; padding-left: 20px; }
.alert-phare li { margin-bottom: 4px; }
.alert-phare a { color: var(--navy); font-weight: 500; }
