/* ============================================================
   Threshold Ventures — Shared Design System
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #ede8df;
  min-height: 100vh;
}

/* --- Nav --------------------------------------------------- */
.nav {
  background: #0f1623;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.logo-slash {
  color: #c86a3a;
  font-weight: 900;
  font-size: 20px;
  margin-right: 4px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #ffffff;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.nav-user-email {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.nav-signout {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-signout:hover {
  color: #ffffff;
}

/* --- Layout ------------------------------------------------- */
.page-body {
  padding: 0 0 60px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Page Header ------------------------------------------- */
.page-header {
  padding: 40px 0 28px;
  border-bottom: 2px solid #c86a3a;
  margin-bottom: 32px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 14px;
  color: #6b6b6b;
  margin-top: 6px;
}

/* --- Cards -------------------------------------------------- */
.card {
  background: #ffffff;
  border: 1px solid #e5dfd6;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card + .card {
  margin-top: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5dfd6;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8480;
  margin-bottom: 14px;
}

/* --- Form Elements ----------------------------------------- */
.field {
  margin-bottom: 20px;
}

.field:last-child {
  margin-bottom: 0;
}

label,
.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8480;
  margin-bottom: 8px;
}

label .optional {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #b0aba5;
}

input[type="text"],
input[type="date"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d8d2c9;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: #1a1a1a;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #c86a3a;
  box-shadow: 0 0 0 3px rgba(200, 106, 58, 0.12);
}

textarea {
  height: 140px;
  resize: vertical;
  line-height: 1.6;
}

input[type="file"] {
  padding: 8px 0;
  font-size: 13px;
  color: #6b6b6b;
}

/* --- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: #0f1623;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1a2535;
}

.btn-cta {
  background: #c86a3a;
  color: #ffffff;
}

.btn-cta:hover {
  background: #b35d30;
}

.btn-outline {
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #d8d2c9;
}

.btn-outline:hover {
  border-color: #0f1623;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

/* --- Mode Toggle (pill tabs) -------------------------------- */
.mode-toggle {
  display: flex;
  border: 1px solid #d8d2c9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
  background: #f5f0e8;
}

.mode-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #8a8480;
  transition: all 0.15s;
}

.mode-btn.active {
  background: #0f1623;
  color: #ffffff;
}

/* --- Input Source Toggle ------------------------------------ */
.input-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.input-toggle button {
  padding: 6px 14px;
  border: 1px solid #d8d2c9;
  border-radius: 20px;
  background: #ffffff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  color: #6b6b6b;
}

.input-toggle button.active {
  background: #0f1623;
  color: #ffffff;
  border-color: #0f1623;
}

.input-section {
  display: none;
}

.input-section.active {
  display: block;
}

/* --- Actions Row ------------------------------------------- */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
}

.actions-center {
  justify-content: center;
}

/* --- Loading Spinner --------------------------------------- */
.loading {
  display: none;
  font-size: 13px;
  color: #6b6b6b;
  margin-top: 14px;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d8d2c9;
  border-top-color: #c86a3a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Alert / Error ----------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* --- Badge ------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-live {
  background: #16a34a;
  color: #ffffff;
}

/* --- Section Label ----------------------------------------- */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8480;
  margin-bottom: 14px;
}

/* --- Divider ----------------------------------------------- */
.divider {
  border: none;
  border-top: 1px solid #e5dfd6;
  margin: 28px 0;
}

/* --- Company List (Board Prep) ----------------------------- */
.company-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.company-card {
  background: #ffffff;
  border: 1px solid #e5dfd6;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: #1a1a1a;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.company-card:hover {
  border-color: #c86a3a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.company-name {
  font-size: 15px;
  font-weight: 600;
}

.company-meta {
  font-size: 12px;
  color: #8a8480;
  margin-top: 3px;
}

.company-arrow {
  font-size: 18px;
  color: #c86a3a;
}

/* --- Empty State ------------------------------------------- */
.empty-state {
  text-align: center;
  color: #8a8480;
  font-size: 13px;
  padding: 40px 0;
}

/* --- Brief Output (result page) ---------------------------- */
.brief {
  background: #ffffff;
  border: 1px solid #e5dfd6;
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.brief h1 {
  font-size: 22px;
  font-weight: 700;
  border-bottom: 2px solid #c86a3a;
  padding-bottom: 10px;
  margin-bottom: 24px;
}

.brief hr {
  display: none;
}

.brief h2 {
  font-size: 15px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #1a1a1a;
}

.brief h2:first-child {
  margin-top: 0;
}

.brief h3 {
  font-size: 14px;
  font-weight: 600;
  margin-top: 14px;
  color: #3a3a3a;
}

.brief p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}

.brief ul,
.brief ol {
  margin: 8px 0;
  padding-left: 22px;
}

.brief li {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}

.brief strong {
  font-weight: 600;
  color: #1a1a1a;
}

.brief table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 13px;
}

.brief th {
  background: #f5f0e8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b6b6b;
  padding: 9px 12px;
  border: 1px solid #e5dfd6;
  text-align: left;
  white-space: nowrap;
}

.brief td {
  padding: 9px 12px;
  border: 1px solid #e5dfd6;
  color: #333;
  vertical-align: top;
  line-height: 1.5;
}

.brief tr:nth-child(even) td {
  background: #faf8f5;
}

.brief blockquote {
  border-left: 3px solid #c86a3a;
  margin: 10px 0;
  padding: 8px 14px;
  color: #555;
  background: #faf8f5;
  border-radius: 0 6px 6px 0;
}

.brief a {
  color: #c86a3a;
  text-decoration: none;
}

.brief a:hover {
  text-decoration: underline;
}

/* --- Board Prep Output ------------------------------------- */
.prep-output {
  background: #ffffff;
  border: 1px solid #e5dfd6;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 28px;
}

.prep-output h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8480;
  border-left: 3px solid #c86a3a;
  padding-left: 10px;
  margin: 24px 0 12px;
}

.prep-output h2:first-child {
  margin-top: 0;
}

.prep-output p {
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  margin: 6px 0;
}

.prep-output ul,
.prep-output ol {
  padding-left: 20px;
  margin: 8px 0;
}

.prep-output li {
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  margin: 4px 0;
}

.prep-output strong {
  font-weight: 600;
  color: #1a1a1a;
}

.prep-output table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 13px;
}

.prep-output th {
  background: #f5f0e8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b6b6b;
  padding: 9px 12px;
  border: 1px solid #e5dfd6;
  text-align: left;
  white-space: nowrap;
}

.prep-output td {
  padding: 9px 12px;
  border: 1px solid #e5dfd6;
  color: #333;
  vertical-align: top;
  line-height: 1.5;
}

.prep-output td:first-child {
  font-weight: 600;
  white-space: nowrap;
  color: #1a1a1a;
}

.prep-output td:last-child {
  color: #555;
}

.prep-output tr:nth-child(even) td {
  background: #faf8f5;
}

/* --- Pack Row (Board Company) ------------------------------ */
.pack-row {
  padding: 16px 0;
  border-bottom: 1px solid #e5dfd6;
}

.pack-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pack-date {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1a1a1a;
}

.pack-summary {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.pack-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.pack-field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b0aba5;
  display: block;
  margin-bottom: 4px;
}

.pack-field p {
  font-size: 12px;
  color: #444;
  line-height: 1.5;
}

.pack-toggle {
  font-size: 12px;
  color: #c86a3a;
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
  text-decoration: underline;
}

.pack-details {
  display: none;
  margin-top: 12px;
}

.pack-details.open {
  display: block;
}

/* --- Outreach Cards ---------------------------------------- */
.outreach-card {
  background: #ffffff;
  border: 1px solid #e5dfd6;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.outreach-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.outreach-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8480;
}

.subject-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.subject-label {
  font-size: 12px;
  font-weight: 600;
  color: #8a8480;
  white-space: nowrap;
}

.subject-input {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  border: 1px solid #d8d2c9;
  border-radius: 6px;
  padding: 7px 10px;
  background: #faf8f5;
  font-family: inherit;
}

.subject-input:focus {
  outline: none;
  border-color: #c86a3a;
}

.char-count {
  font-size: 11px;
  color: #b0aba5;
  text-align: right;
  margin-top: 6px;
}

.char-count.over {
  color: #dc2626;
  font-weight: 600;
}

/* --- Topbar (result / outreach pages) ---------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-top: 28px;
}

.back-link {
  font-size: 13px;
  color: #6b6b6b;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.back-link:hover {
  color: #1a1a1a;
}

.topbar-meta {
  font-size: 12px;
  color: #b0aba5;
}

/* --- Print ------------------------------------------------- */
.print-header {
  display: none;
}

.print-footer {
  display: none;
}

@media print {
  @page {
    margin: 1.2cm 1.5cm 1.8cm 1.5cm;
  }

  body {
    background: #ffffff;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10.5pt;
    color: #1a1a1a;
  }

  .nav,
  .topbar {
    display: none !important;
  }

  /* Strip the card */
  .brief {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .brief h1 {
    display: none;
  }

  /* Header */
  .print-header {
    display: block;
  }

  .ph-banner {
    background: #0f1623;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 18px 28px 20px;
    width: 100%;
    margin-bottom: 28px;
  }

  .ph-banner-label {
    font-size: 7.5pt;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 6px;
  }

  .ph-banner-title {
    font-size: 20pt;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
  }

  .ph-banner-sub {
    font-size: 9.5pt;
    font-weight: 500;
    color: #c86a3a;
  }

  .brief hr {
    display: none;
  }

  /* Section headers */
  .brief h2 {
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0f1623;
    margin-top: 28px;
    margin-bottom: 6px;
    padding-top: 0;
    padding-bottom: 6px;
    border-top: none;
    border-bottom: 1.5px solid #c86a3a;
  }

  .brief h3 {
    font-size: 10.5pt;
    font-weight: 700;
    color: #0f1623;
    margin-top: 16px;
    margin-bottom: 4px;
  }

  /* Callout boxes — blockquotes styled as flagged findings */
  .brief blockquote {
    border-left: 3px solid #c86a3a;
    background: #fdf6f2;
    margin: 12px 0;
    padding: 10px 14px;
    font-size: 10pt;
    color: #3a2a20;
  }

  .brief blockquote p {
    margin: 0;
  }

  /* Tables */
  .brief table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    margin: 12px 0;
  }

  .brief th {
    background: #f4f2ef;
    font-weight: 700;
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1.5px solid #ddd;
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .brief td {
    padding: 6px 10px;
    border-bottom: 1px solid #e8e5e1;
    vertical-align: top;
  }

  /* Footer */
  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 24px;
    display: flex;
    justify-content: space-between;
    font-size: 8pt;
    color: #c86a3a;
  }

  /* Watermark */
  body::before {
    content: "THRESHOLD VENTURES — CONFIDENTIAL";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 34px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.03);
    letter-spacing: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
  }
}

/* --- Login Page -------------------------------------------- */
.login-body {
  background: #ede8df;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: #ffffff;
  border: 1px solid #e5dfd6;
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.login-tagline {
  font-size: 13px;
  color: #8a8480;
  margin-bottom: 32px;
}

/* --- Utilities --------------------------------------------- */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-28 { margin-top: 28px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-28 { margin-bottom: 28px; }
.text-muted { color: #6b6b6b; }
.text-small { font-size: 12px; }
.mode-description {
  font-size: 13px;
  color: #6b6b6b;
  margin: 4px 0 20px 0;
}
.file-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  color: #c86a3a;
  font-weight: 500;
}
.file-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-family: inherit;
  background: #fff;
  border: 1px solid #c86a3a;
  border-radius: 4px;
  color: #c86a3a;
}
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* --- Beta badge (nav) -------------------------------------- */
.nav-beta-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(200, 106, 58, 0.25);
  color: #c86a3a;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 16px;
}

/* --- Beta notice banner ------------------------------------ */
.beta-notice {
  background: #fff8f0;
  border: 1px solid #f0d4b8;
  border-left: 3px solid #c86a3a;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: #7a4020;
  margin-bottom: 20px;
}
.beta-notice strong { color: #c86a3a; }

/* --- Disabled card state ----------------------------------- */
.card-disabled {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
