/* =========================================================================
   Highlands Forward — Door Sign Generator
   -------------------------------------------------------------------------
   Design tokens below are intentionally identical to the Highlands Forward
   Signature Generator (--hf-blue, --hf-navy, --hf-gold, spacing, radius,
   focus ring) so this tool reads as part of the same internal tool suite
   rather than a one-off.
   ========================================================================= */

:root {
  --hf-blue: #1556A3;
  --hf-navy: #173F70;
  --hf-gold: #F9B411;
  --text-main: #111827;
  --text-secondary: #4B5563;
  --bg-page: #F5F7FB;
  --bg-panel: #FFFFFF;
  --border: #E2E8F0;
  --error: #B91C1C;
  --success: #15803D;
  --radius: 10px;
  --focus-ring: 0 0 0 3px rgba(21, 86, 163, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--hf-navy);
  color: #fff;
}

.header-logo {
  height: 42px;
  width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
}

.header-text { min-width: 0; }

.site-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

/* Same visual treatment as .site-header h1, for use on pages (like the
   policy pages) whose own page title is the real <h1> — keeps exactly one
   <h1> per page for correct heading hierarchy without changing how the
   header bar looks. */
.header-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.header-subtitle {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #D8E3F5;
}

/* Layout */
.app-grid {
  max-width: 1180px;
  margin: 20px auto;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1050px) {
  .app-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  min-width: 0;
}

.panel h2 {
  margin: 0 0 14px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--hf-navy);
}

/* Form */
.field { margin-bottom: 14px; min-width: 0; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.req { color: var(--error); }

input[type="text"],
select {
  width: 100%;
  padding: 9px 11px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--hf-blue);
  box-shadow: var(--focus-ring);
}

.error {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--error);
  min-height: 1em;
}

.field-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Field groups / fieldsets */
.field-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 14px 16px;
  margin: 0 0 16px;
}

.field-group legend {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hf-navy);
  padding: 0 4px;
}

/* Shared office occupant rows */
.occupant-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.occupant-row:last-child { border-bottom: none; }

.occupant-row .field { margin-bottom: 0; }

.remove-occupant-btn {
  margin-top: 24px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .occupant-row { grid-template-columns: 1fr; }
  .remove-occupant-btn { margin-top: 0; }
}

/* Buttons */
.button-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.button-row-secondary { margin-top: 20px; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-small { padding: 7px 12px; font-size: 0.85rem; }

.btn-text {
  background: none;
  color: var(--hf-blue);
  padding: 6px 8px;
  font-size: 0.85rem;
}
.btn-text:hover { text-decoration: underline; }

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-primary { background: var(--hf-blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--hf-navy); }
.btn-primary:disabled { background: #9CA3AF; cursor: not-allowed; }

.btn-secondary { background: #fff; color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: #F3F4F6; }
.btn-secondary:disabled { color: #9CA3AF; cursor: not-allowed; }

.status-msg {
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 1.2em;
}
.status-msg.ok { color: var(--success); }
.status-msg.fail { color: var(--error); }

/* Preview */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-frame {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 24px 12px;
  background: #EEF1F6;
  border-radius: 8px;
}

#sign-preview-canvas {
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 8.5 / 11;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.16), 0 1px 3px rgba(17, 24, 39, 0.12);
  border-radius: 2px;
}

.preview-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Footer */
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 20px 32px;
  text-align: center;
}

.footer-brand { margin: 0 0 4px 0; font-size: 0.9rem; }
.footer-muted { color: #5B6472; }
.footer-strong { color: var(--hf-navy); font-weight: 700; }

/* "Powered by Highlands Brain" — deliberately quieter than the brand line
   above it: smaller text, and "Highlands Brain" gets a touch more weight
   and the app's blue (not the navy used for Highlands Forward/the org
   name) so it reads as a distinct technology credit, never a second
   competing brand. */
.footer-tagline {
  margin: 0 0 8px 0;
  font-size: 0.8rem;
}

.footer-credit {
  color: var(--hf-blue);
  font-weight: 600;
}

.footer-links {
  margin: 0;
  font-size: 0.8rem;
  color: #5B6472;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 3px;
}

/* Policy pages (privacy.html / terms.html) */
.policy-main {
  max-width: 820px;
  margin: 32px auto;
  padding: 0 20px 20px;
}

.policy-return {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hf-blue);
  text-decoration: none;
}

.policy-return:hover { text-decoration: underline; }

.policy-return:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

.policy-content {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
}

.policy-content h1 {
  margin: 0 0 6px 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--hf-navy);
}

.policy-content .effective-date {
  margin: 0 0 28px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.policy-content h2 {
  margin: 28px 0 10px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hf-navy);
}

.policy-content h2:first-of-type { margin-top: 0; }

.policy-content p {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-main);
}

.policy-content ul {
  margin: 0 0 14px 0;
  padding-left: 22px;
}

.policy-content li {
  margin-bottom: 6px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

.policy-content a {
  color: var(--hf-blue);
}

.policy-content a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 3px;
}

.policy-return-bottom {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hf-blue);
  text-decoration: none;
}

.policy-return-bottom:hover { text-decoration: underline; }

.policy-return-bottom:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

@media (max-width: 600px) {
  .policy-content { padding: 24px 20px; }
}

/* Print output container: invisible on screen, the only visible content
   when printing. Kept in normal flow (not display:none) so its image can
   still be updated via JS immediately before window.print() is called. */
#sign-print-canvas {
  position: absolute;
  left: -99999px;
  top: 0;
  width: 8.5in;
  height: 11in;
}

#sign-print-image {
  width: 8.5in;
  height: 11in;
  display: block;
}

@media print {
  @page {
    size: letter portrait;
    margin: 0;
  }

  html, body {
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .site-header,
  .app-grid,
  .site-footer {
    display: none !important;
  }

  #sign-print-canvas {
    position: static;
    left: auto;
    width: 8.5in;
    height: 11in;
  }
}
