/* FNS Customer Portal — clean light theme, mobile-first (same family as the Subcontractor App) */
:root {
  --navy: #0e1b2c;
  --blue: #1976d2;
  --green: #1e8e5a;
  --ink: #1a2533;
  --muted: #5c6b7a;
  --line: #dfe5ec;
  --card: #ffffff;
  --bg: #f2f5f8;
  --ok: #e7f5ee;
  --warn: #fff4e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.topbar-actions { display: flex; gap: 8px; }
main { padding: 18px; max-width: 1100px; margin: 0 auto; }
.center-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6vh; }
.login-grid { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 760px; }
.login-card { max-width: 340px; width: 100%; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(14, 27, 44, .06);
}
.card.wide { max-width: 860px; width: 100%; }
.card h2 { margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.card p { margin: 4px 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.spacer { height: 12px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { background: #f6f9fc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1565c0; }
.btn.danger { background: #c62828; border-color: #c62828; color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.input.big { font-size: 18px; padding: 13px 14px; text-align: center; letter-spacing: 2px; }
.textarea { min-height: 220px; resize: vertical; font-size: 14px; line-height: 1.5; }
.form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.office-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .office-wrap { grid-template-columns: 1fr; } }

.list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.list-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.list-title { font-weight: 600; font-size: 15px; }
.list-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tag {
  display: inline-block;
  background: var(--warn);
  color: #8a5a00;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.tag.ok { background: var(--ok); color: var(--green); }
.tag.note-tag { background: #eef2ff; color: #4338ca; }
.tag.big-tag { font-size: 14px; padding: 6px 14px; margin: 8px 0; }
.tag.center { display: block; text-align: center; }
.notes-box { display: flex; flex-direction: column; gap: 6px; }
.notes-box label { font-weight: 600; font-size: 14px; }
.notes-ta { min-height: 90px; }
.notes-readout {
  margin: 12px 24px 0;
  padding: 10px 14px;
  background: #eef2ff;
  border: 1px solid #d4d9f7;
  border-radius: 10px;
}
.notes-label { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #4338ca; margin-bottom: 4px; }
.notes-text { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }

.agreement-body { margin: 14px 0; padding: 0 2px; }
.agreement-body h3 {
  font-size: 14px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--navy);
  margin: 18px 0 6px;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 4px;
}
.agreement-body p { margin: 8px 0; line-height: 1.55; }
.agreement-body ul { margin: 6px 0; padding-left: 22px; }
.agreement-body li { line-height: 1.5; margin: 4px 0; }

.sign-box {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}
.sign-box label { font-weight: 600; font-size: 14px; }
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #eef6ff;
  border: 1px solid #c9e0fb;
  border-radius: 10px;
}
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.checkbox-group label { font-size: 14px; line-height: 1.5; cursor: pointer; display: flex; flex-direction: column; }
.checkbox-group strong { color: var(--navy); }
a.link-btn { color: var(--blue); font-size: 14px; background: none; border: none; text-decoration: underline; cursor: pointer; }

.error { color: #c62828; font-weight: 600; }

/* ---- Agreement document (professional look) ---- */
.agreement-doc { max-width: 860px; width: 100%; padding: 0; overflow: hidden; }
.doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 3px solid var(--navy);
  background: #f8fafc;
}
.doc-logo { max-height: 78px; width: auto; }
.doc-title-block { text-align: right; }
.doc-title { margin: 0; font-size: 22px; color: var(--navy); letter-spacing: .3px; }
.doc-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.parties {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.party { max-width: 46%; }
.party-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--blue); margin-bottom: 3px; }
.party-name { font-weight: 700; font-size: 15px; color: var(--navy); }
.party-detail { font-size: 13px; color: #45515e; margin-top: 1px; }
.plan-strip {
  display: flex;
  gap: 0;
  margin: 0 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f2f8ff;
  margin-top: 14px;
}
.plan-cell { flex: 1; padding: 10px 14px; text-align: center; border-right: 1px solid var(--line); }
.plan-cell:last-child { border-right: none; }
.plan-value { font-size: 18px; font-weight: 700; color: var(--navy); }
.plan-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.terms-title {
  margin: 20px 24px 0;
  font-size: 15px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 5px;
}
.signed-stamp { padding: 12px 24px 0; }
.agreement-doc .agreement-body { padding: 4px 24px 0; }
.agreement-doc .sign-box { margin: 10px 24px 24px; }
.agreement-doc .sign-box .input.big { text-align: left; letter-spacing: 0; font-size: 16px; }
@media (max-width: 600px) {
  .doc-header { flex-direction: column; align-items: flex-start; text-align: left; }
  .doc-logo { max-height: 60px; }
  .doc-title-block { text-align: left; }
  .parties { flex-direction: column; }
  .party { max-width: 100%; }
}

/* ---- Service report images ---- */
.report-frame { margin: 12px 0; text-align: center; }
.report-img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.doc-actions { display: flex; gap: 10px; padding: 6px 24px 20px; }

/* ---- Print: only the agreement/report document, clean white ---- */
@media print {
  body { background: #fff; }
  .topbar, .topbar-actions, #toast, .no-print, .toast, .error { display: none !important; }
  main { padding: 0; max-width: none; }
  .center-wrap { padding: 0; }
  .card { border: none; box-shadow: none; border-radius: 0; max-width: none; padding: 0; }
  .doc-header { border-bottom: 2px solid #000; padding: 0 0 10px; background: #fff; }
  .parties { padding: 12px 0; border-bottom: 1px solid #ccc; }
  .plan-strip { margin: 12px 0; }
  .terms-title { margin: 16px 0 8px; }
  .agreement-doc .agreement-body { padding: 0; }
  .agreement-doc .sign-box { margin: 12px 0 0; max-width: none; }
  .report-frame img { max-width: 100%; }
}
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}
