/* Treadwell Customer Proposal Portal — "Treadwell Industrial Modern"
   Matches Treadwell/design/design.md: Treadwell Red on warm cream, Inter,
   tabular numerals, uppercase label-caps, soft corners, sturdy "working tool". */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

:root {
  /* brand */
  --primary: #9E001F;          /* deep red — primary actions (base) */
  --primary-bright: #C8102E;   /* Treadwell Red — hover / brand hero */
  --primary-tint: #FFDAD8;     /* light red wash — selected/active */
  --on-primary: #FFFFFF;
  /* surfaces (warm neutrals) */
  --bg: #FBF9F8;               /* cream/off-white page */
  --surface: #FFFFFF;          /* cards */
  --surface-low: #F5F3F3;
  --surface-container: #EFEDED;
  --surface-high: #E9E8E7;
  --surface-highest: #E4E2E2;
  --surface-dim: #DBDAD9;
  /* text + lines */
  --fg: #1B1C1C;               /* charcoal */
  --secondary: #5F5E5E;        /* muted text/labels */
  --outline: #906F6E;
  --outline-variant: #E5BDBB;
  /* semantic */
  --error: #BA1A1A;
  --error-bg: #FFDAD6;
  --success: #1F7A34;
  --success-bg: #E3F3E6;
  --tertiary: #005468;         /* brand teal (info) */
  --info-bg: #E6F4F9;
  /* shape + depth */
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(27, 28, 28, .05);
  --shadow: 0 4px 12px rgba(0, 0, 0, .05);
  --maxw: 760px;
  font-feature-settings: "tnum" 1;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: inherit; color: var(--fg); margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: var(--primary); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* Header — cream bar, red wordmark (matches the tool's TopAppBar) */
.site-header {
  background: var(--bg); border-bottom: 1px solid var(--surface-highest);
  box-shadow: var(--shadow-sm);
  padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 50;
}
.site-header .brand {
  color: var(--primary); font-weight: 900; font-size: 1.2rem;
  letter-spacing: -0.01em; text-transform: uppercase;
}
.site-header .tag {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--secondary);
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 16px 72px; }

/* Labels — uppercase label-caps */
.label-caps, label {
  font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--secondary); display: block; margin-bottom: 6px;
}
label .req { color: var(--error); }

/* Cards — white on cream, thin border, soft shadow, generous padding */
.card {
  background: var(--surface); border: 1px solid var(--surface-highest);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 16px;
}
.card h2 { margin-top: 0; }
.muted { color: var(--secondary); }
.small { font-size: .85rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Buttons — primary solid red (label-caps), secondary white/outline */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius); border: 1px solid transparent;
  font-family: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; cursor: pointer; text-decoration: none;
  transition: background .18s ease, border-color .18s ease, opacity .18s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-bright); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--outline); }
.btn-secondary:hover { background: var(--surface-low); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Forms */
input[type=text], input[type=email], input[type=tel], input[type=date], textarea, select {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--fg);
  background: var(--bg); border: 1px solid var(--outline-variant); border-radius: var(--radius);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
textarea { min-height: 96px; resize: vertical; }
.field + .field { margin-top: 14px; }
.help { font-size: .8rem; color: var(--secondary); margin-top: 4px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.code-input { letter-spacing: 10px; text-align: center; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Badges / status chips — minimal tint + high-contrast text */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge.pending { background: var(--surface-high); color: var(--secondary); }
.badge.warn { background: var(--primary-tint); color: var(--primary); }
.badge.done { background: var(--success-bg); color: var(--success); }

/* Status tracker */
.tracker { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.tracker .step { border: 1px solid var(--surface-highest); border-radius: var(--radius); padding: 14px; background: var(--surface-low); }
.tracker .step .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--secondary); font-weight: 700; }
.tracker .step .val { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 700; font-size: .95rem; }
.tracker .step.is-done { border-color: var(--success); background: var(--success-bg); }
.tracker .step .ico { width: 16px; height: 16px; flex: none; }

/* Document-style headings inside the summary card (red underline like the tool) */
.doc-band { border-bottom: 2px solid var(--primary); padding-bottom: 12px; margin-bottom: 16px; }
.doc-band .doc-brand { font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; font-size: 1.25rem; color: var(--fg); }
.doc-band .doc-sub { color: var(--secondary); font-size: .82rem; }

/* Pricing options */
.option { display: block; border: 2px solid var(--surface-highest); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; background: var(--surface); transition: border-color .15s ease, background .15s ease; }
.option + .option { margin-top: 12px; }
.option:hover { border-color: var(--outline); }
.option.selected { border-color: var(--primary); background: #FFF5F5; }
.option .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.option .name { font-weight: 700; color: var(--fg); }
.option .price { font-size: 1.3rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.option .meta { font-size: .85rem; color: var(--secondary); margin-top: 4px; }

/* Q&A thread */
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: var(--radius-lg); }
.msg .who { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.msg.customer { align-self: flex-end; background: var(--primary); color: #fff; }
.msg.customer .who { color: var(--primary-tint); }
.msg.staff { align-self: flex-start; background: var(--surface-high); color: var(--fg); }
.msg .when { font-size: .68rem; opacity: .75; margin-top: 4px; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: var(--radius); font-size: .9rem; margin-bottom: 12px; }
.alert.error { background: var(--error-bg); color: #93000A; border: 1px solid #F4B8B4; }
.alert.success { background: var(--success-bg); color: #14532D; border: 1px solid #B7E0BE; }
.alert.info { background: var(--info-bg); color: #003E4E; border: 1px solid #B6E2EF; }

/* skeleton + spinner */
.skeleton { background: linear-gradient(90deg, var(--surface-low) 25%, var(--surface-high) 37%, var(--surface-low) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 6px; }
.skeleton.line { height: 14px; margin: 8px 0; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login extras */
.login-card { max-width: 440px; margin: 24px auto 0; }
.divider { display: flex; align-items: center; text-align: center; color: var(--secondary); margin: 4px 0 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-bottom: 1px solid var(--surface-highest); }
.divider span { padding: 0 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; font-size: .68rem; }
.linkbtn { background: none; border: none; color: var(--primary); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; padding: 0; }
#lg-google { display: flex; justify-content: center; }
.proj-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; border-top: 1px solid var(--surface-highest); text-decoration: none; color: var(--fg); }
.proj-row:hover { background: var(--surface-low); }
.proj-row .pname { font-weight: 700; }

.hidden { display: none !important; }

@media (max-width: 420px) {
  .tracker { grid-template-columns: 1fr; }
  h1 { font-size: 1.55rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
