/* =====================================================================
   WestEdge Borrower Portal — styling
   ================================================================== */
:root {
  --brand: #1e3a8a;
  --brand-dark: #172554;
  --brand-light: #eff4ff;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --orange: #f59e0b;
  --orange-soft: #fef3c7;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); }

/* ---------- Brand bar ---------------------------------------------- */
.brand-bar {
  background: #ffffff;
  border-bottom: 4px solid var(--brand);
  padding: 18px 16px;
  text-align: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -1px;
  box-shadow: var(--shadow-sm);
}
.brand-mark-w { line-height: 1; }
.brand-name {
  font-weight: 700;
  letter-spacing: 1.6px;
  font-size: 16px;
  color: var(--brand);
}
.brand-suffix {
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: 1px;
  margin-top: 1px;
}

/* ---------- Hero --------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 40px 16px 56px 16px;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: #cbd5ff;
  margin-bottom: 8px;
}
.hero-deal {
  font-size: 28px;
  margin: 0 0 8px 0;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.hero-borrower {
  color: #cbd5ff;
  font-size: 15px;
}

/* ---------- Container ---------------------------------------------- */
.container {
  max-width: 760px;
  width: 100%;
  margin: -32px auto 40px auto;
  padding: 0 16px;
  flex: 1;
}

/* ---------- Progress card ------------------------------------------ */
.progress-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--gray-500);
}
.progress-row strong { color: var(--gray-900); font-size: 16px; }
.progress-pct { color: var(--brand); font-weight: 700; }
.progress-bar {
  background: var(--gray-200);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  background: var(--brand);
  height: 100%;
  transition: width 350ms ease;
}

/* ---------- Stat cards --------------------------------------------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.stat-num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 4px; }
.stat-needed   .stat-num { color: var(--red); }
.stat-review   .stat-num { color: var(--orange); }
.stat-approved .stat-num { color: var(--green); }
.stat-needed   { border-top: 3px solid var(--red); }
.stat-review   { border-top: 3px solid var(--orange); }
.stat-approved { border-top: 3px solid var(--green); }

/* ---------- All-approved banner ------------------------------------ */
.all-approved-banner {
  background: var(--green-soft);
  border: 1px solid var(--green);
  color: #14532d;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}
.all-approved-banner .ck {
  width: 40px;
  height: 40px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.all-approved-banner .ttl { font-weight: 700; }
.all-approved-banner .sub { font-size: 13px; color: #166534; }

/* ---------- Document list ------------------------------------------ */
.doc-list { display: flex; flex-direction: column; gap: 10px; }

.doc-row {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: opacity 200ms;
}

.doc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.doc-row.is-needed   .doc-dot { background: var(--red);    box-shadow: 0 0 0 4px var(--red-soft); }
.doc-row.is-review   .doc-dot { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.doc-row.is-approved .doc-dot { background: var(--green);  box-shadow: 0 0 0 4px var(--green-soft); }

.doc-meta { flex: 1 1 auto; min-width: 0; }
.doc-label {
  font-weight: 600;
  margin: 0 0 2px 0;
  word-wrap: break-word;
}
.doc-cat {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  margin-left: 8px;
  text-transform: uppercase;
}
.badge-needed   { background: var(--red-soft);    color: var(--red); }
.badge-review   { background: var(--orange-soft); color: #92400e; }
.badge-approved { background: var(--green-soft);  color: #14532d; }

.doc-revision-note {
  margin-top: 8px;
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #78350f;
}
.doc-revision-note .lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: #92400e;
}

.doc-actions { flex: 0 0 auto; }
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: background 150ms;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-link { background: transparent; color: var(--brand); padding: 8px 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.doc-row.is-approved { opacity: 0.78; }
.doc-row.is-uploading { background: linear-gradient(90deg,#fff,#f0f7ff,#fff); background-size:200% 100%; animation: pulse 1.4s linear infinite; }
@keyframes pulse { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* ---------- Legal / Footer ---------------------------------------- */
.legal { color: var(--gray-500); font-size: 12px; text-align: center; margin: 24px 0 0 0; }
.brand-footer {
  background: #fff;
  border-top: 1px solid var(--gray-200);
  padding: 24px 16px 32px 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
  line-height: 1.7;
}
.brand-footer a { color: var(--gray-700); text-decoration: none; }
.brand-footer-secure {
  margin-top: 10px;
  font-style: italic;
  color: var(--gray-500);
  font-size: 12px;
}

/* ---------- Toast -------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  z-index: 50;
  animation: slideUp 200ms;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes slideUp { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Mobile ------------------------------------------------- */
@media (max-width: 580px) {
  .hero-deal { font-size: 22px; }
  .stat-cards { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px 8px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 10px; }
  .doc-row { flex-wrap: wrap; }
  .doc-actions { width: 100%; margin-top: 8px; text-align: right; }
}
