/* Bancroft design system: light, professional, understated. Placeholder brand palette
   (navy + brass) until Bancroft supplies their own logo/branding, per the project brief. */

:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-alt: #F1EFE9;
  --border: #E4E1DA;
  --border-strong: #D3CFC5;
  --text: #1F2A37;
  --text-muted: #5B6472;
  --text-faint: #8A909B;
  --navy: #1E3A5F;
  --navy-dark: #14283F;
  --brass: #B08D57;
  --brass-dark: #8F7343;
  --ok: #2E7D52;
  --ok-bg: #E7F3EC;
  --warn: #B8860B;
  --warn-bg: #FBF1DC;
  --info: #3B6FA0;
  --info-bg: #E9F0F8;
  --danger: #B54545;
  --danger-bg: #FBEAEA;
  --neutral: #5B6472;
  --neutral-bg: #ECEBE7;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(30, 42, 55, 0.06);
  --shadow-md: 0 6px 20px rgba(30, 42, 55, 0.08);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; color: var(--navy-dark); margin: 0 0 0.5em; line-height: 1.25; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 17px; flex-shrink: 0; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 19px; color: var(--navy-dark); letter-spacing: 0.2px; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; white-space: nowrap; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: var(--brass-dark); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 14.5px; font-family: var(--font-body); color: var(--text); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1); }
.field textarea { resize: vertical; min-height: 90px; }
.field-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; }
.form-error { background: var(--danger-bg); color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 18px; }
.form-notice { background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 18px; }

/* ---------- Status badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 100px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-submitted { background: var(--neutral-bg); color: var(--neutral); }
.badge-in_review { background: var(--info-bg); color: var(--info); }
.badge-clarification_requested { background: var(--warn-bg); color: var(--warn); }
.badge-in_progress { background: #EAE7F5; color: #5B4EA0; }
.badge-completed { background: var(--ok-bg); color: var(--ok); }
.badge-delivered { background: #DCEEF0; color: #1F6F6B; }

/* ================= PUBLIC / MARKETING SITE ================= */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.site-header-inner { max-width: 1180px; margin: 0 auto; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-nav { display: flex; gap: 26px; }
.site-nav a { font-size: 14.5px; font-weight: 500; color: var(--text-muted); }
.site-nav a:hover { color: var(--navy); }
.site-header-actions { display: flex; gap: 10px; align-items: center; }
.site-nav-toggle { display: none; background: none; border: none; color: var(--navy); }

.site-main { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.hero { padding: 76px 0 64px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: 1.2px; font-size: 12.5px; font-weight: 700; color: var(--brass-dark); margin-bottom: 14px; }
.hero h1 { font-size: 42px; margin-bottom: 20px; }
.hero p.lead { font-size: 17px; color: var(--text-muted); max-width: 520px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; }
.hero-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-md); }
.hero-panel-title { font-family: var(--font-head); font-size: 17px; font-weight: 600; margin-bottom: 14px; color: var(--navy-dark); }
.hero-step { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.hero-step:last-child { border-bottom: none; }
.hero-step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 620px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--text-muted); font-size: 15.5px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; }
.card-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-alt); color: var(--navy); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 14.5px; margin: 0; }

.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step-card { text-align: left; }
.step-card .step-num { font-family: var(--font-head); font-size: 30px; color: var(--brass); font-weight: 600; margin-bottom: 10px; }

.cta-band { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px; margin: 20px 0 56px; }
.cta-band h2 { color: #fff; font-size: 26px; margin-bottom: 8px; }
.cta-band p { color: #C9D3DE; margin: 0; }
.cta-band .btn-primary { background: #fff; color: var(--navy); }
.cta-band .btn-primary:hover { background: #EFEFEF; }

.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item h3 { font-size: 16px; margin-bottom: 8px; }
.faq-item p { color: var(--text-muted); font-size: 14.5px; margin: 0; }

.site-footer { background: var(--surface-alt); border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 48px 28px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-tagline { color: var(--text-muted); font-size: 13.5px; margin-top: 10px; max-width: 260px; }
.footer-heading { font-weight: 700; font-size: 13px; color: var(--navy-dark); margin-bottom: 4px; }
.footer-col a { color: var(--text-muted); font-size: 13.5px; }
.footer-col a:hover { color: var(--navy); }
.site-footer-bottom { text-align: center; padding: 18px 0; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-faint); }

.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-md); }
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--text-muted); margin-top: 18px; }
.auth-switch a { color: var(--navy); font-weight: 600; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 11.5px; color: var(--text-faint); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-google { width: 100%; background: #fff; border: 1px solid var(--border); padding: 10px 14px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: var(--radius); font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
.btn-google:hover { background: var(--surface-alt); }

.contact-page { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 56px 0; }

.page-hero-simple { padding: 48px 0 8px; }
.page-hero-simple h1 { font-size: 34px; }
.page-hero-simple p { color: var(--text-muted); font-size: 16px; max-width: 640px; }

/* ================= LOGGED-IN APP SHELL ================= */
body.app { background: var(--bg); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex-shrink: 0; background: var(--navy-dark); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; }
.sidebar-brand .brand-mark { background: var(--brass); }
.sidebar-brand .brand-name { color: #fff; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: #C9D3DE; font-size: 14px; font-weight: 500; }
.nav-row:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-row.active { background: var(--brass); color: #fff; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 14px; margin-top: 10px; }
.sidebar-back { color: #9BAAB9; font-size: 12.5px; }
.sidebar-back:hover { color: #fff; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 10; }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-family: var(--font-head); font-weight: 600; font-size: 18px; color: var(--navy-dark); }
.menu-toggle { display: none; cursor: pointer; color: var(--navy); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.dropdown-wrap { position: relative; }
.dropdown-panel { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); min-width: 220px; padding: 8px; z-index: 30; }
.account-menu-header { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.account-menu-name { font-weight: 700; font-size: 13.5px; }
.account-menu-email, .account-menu-org { font-size: 12px; color: var(--text-faint); }
.dropdown-row { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: none; background: none; font-size: 13.5px; color: var(--text); cursor: pointer; font-family: var(--font-body); }
.dropdown-row:hover { background: var(--surface-alt); }

.page-main { padding: 28px 32px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; margin: 0; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.toast { background: var(--ok-bg); color: var(--ok); padding: 10px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 18px; font-weight: 600; }

.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state svg { width: 44px; height: 44px; color: var(--text-faint); margin-bottom: 14px; }

/* Project list / table */
.project-card-list { display: flex; flex-direction: column; gap: 12px; }
.project-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.project-row:hover { border-color: var(--border-strong); }
.project-row-main { min-width: 0; }
.project-ref { font-size: 12px; color: var(--text-faint); font-weight: 600; letter-spacing: 0.3px; }
.project-title { font-size: 15.5px; font-weight: 600; color: var(--navy-dark); margin-top: 2px; }
.project-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }
.project-row-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

table.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); padding: 12px 16px; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }

.filters-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-pill { padding: 7px 14px; border-radius: 100px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; color: var(--text-muted); background: #fff; }
.filter-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Project detail */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 20px; }
.panel h2 { font-size: 16px; margin-bottom: 14px; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-faint); }
.info-row .value { font-weight: 600; color: var(--text); text-align: right; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 16px; bottom: 0; width: 1px; background: var(--border-strong); }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--navy); margin-top: 4px; flex-shrink: 0; }
.timeline-text { font-size: 13.5px; }
.timeline-time { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.doc-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-alt); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11.5px; color: var(--text-faint); }
.doc-row .btn { margin-left: auto; flex-shrink: 0; }
.doc-tag { font-size: 10.5px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.4px; padding: 2px 7px; border-radius: 4px; }
.doc-tag-customer { background: var(--info-bg); color: var(--info); }
.doc-tag-bancroft { background: var(--ok-bg); color: var(--ok); }

.message-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.message-item { padding: 12px 14px; border-radius: 10px; background: var(--surface-alt); }
.message-item.internal { background: var(--warn-bg); border: 1px dashed #D8B65C; }
.message-meta { font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.message-body { font-size: 13.5px; }

/* Upload dropzone */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 36px 24px; text-align: center; cursor: pointer; background: var(--surface-alt); transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.dragover { border-color: var(--navy); background: #EEF1F5; }
.dropzone svg { width: 32px; height: 32px; color: var(--text-faint); margin-bottom: 10px; }
.dropzone-title { font-weight: 600; font-size: 14.5px; }
.dropzone-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }
.dropzone input[type=file] { display: none; }
.file-pending-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.file-pending-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 8px 12px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.file-pending-remove { color: var(--danger); cursor: pointer; font-weight: 700; background: none; border: none; font-size: 14px; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .grid-3, .steps-row, .grid-2 { grid-template-columns: 1fr; }
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .contact-page { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px 28px; border-bottom: 1px solid var(--border); gap: 14px; }
  .site-nav.open { display: flex; }
  .site-nav-toggle { display: block; }
  .site-header-actions .btn-ghost { display: none; }
  .sidebar { position: fixed; left: -260px; top: 0; z-index: 40; transition: left 0.2s; }
  .sidebar.open { left: 0; }
  .sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 35; }
  .sidebar-scrim.open { display: block; }
  .menu-toggle { display: block; }
  .page-main { padding: 20px 16px 40px; }
  .project-row { flex-direction: column; align-items: flex-start; }
  .cta-band { flex-direction: column; text-align: center; }
}
