/* ============================================================
   Ayers Intelligence: Case Lens — style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f4f3ef;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: #0f1e3d;
  padding: 1.5rem 0;
  border-bottom: 3px solid #c9a84c;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo-main {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.logo-sub {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #c9a84c;
  letter-spacing: 0.01em;
}

.logo-rule {
  color: rgba(255,255,255,0.3);
  margin: 0 0.5rem;
}

.header-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Main layout ──────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

/* ── Upload section ───────────────────────────────────────── */
.upload-section {
  background: #fff;
  border: 1px solid #d6d3cb;
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.section-heading {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f1e3d;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e8e5de;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #c5c0b5;
  border-radius: 4px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #faf9f6;
  margin-bottom: 1.5rem;
  position: relative;
}

.drop-zone.drag-over {
  border-color: #0f1e3d;
  background: #f0f2f7;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  color: #9b9589;
}

.drop-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.25rem;
  color: #2c2c2c;
  margin-bottom: 0.4rem;
}

.drop-sub {
  font-size: 0.875rem;
  color: #9b9589;
}

.drop-formats {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #b0ab9f;
  letter-spacing: 0.04em;
}

/* File list */
.file-list {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.file-list.has-files { display: flex; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: #faf9f6;
  border: 1px solid #e8e5de;
  border-radius: 3px;
  font-size: 0.9rem;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.file-icon { font-size: 1.1rem; flex-shrink: 0; }

.file-name {
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.file-size { font-size: 0.8rem; color: #9b9589; }

.file-remove {
  background: none;
  border: none;
  color: #b0ab9f;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.file-remove:hover { color: #c0392b; }

/* Analyze button */
.analyze-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  background: #0f1e3d;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.analyze-btn:hover:not(:disabled) { background: #1a3160; }

.analyze-btn:disabled {
  background: #c5c0b5;
  cursor: not-allowed;
}

/* ── Loading ──────────────────────────────────────────────── */
.loading-section {
  display: none;
  background: #fff;
  border: 1px solid #d6d3cb;
  border-radius: 4px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.loading-section.visible { display: block; }

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e8e5de;
  border-top-color: #0f1e3d;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.loading-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.375rem;
  color: #1a1a1a;
  margin-bottom: 0.4rem;
}

.loading-sub {
  font-size: 0.9rem;
  color: #9b9589;
}

/* ── Error ────────────────────────────────────────────────── */
.error-section {
  display: none;
  background: #fff8f7;
  border: 1px solid #f5c6c0;
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.error-section.visible { display: block; }
.error-title { font-weight: 600; color: #c0392b; margin-bottom: 0.3rem; }
.error-msg { font-size: 0.9rem; color: #555; }

/* ── Memo output ──────────────────────────────────────────── */
.memo-section {
  display: none;
}

.memo-section.visible { display: block; }

.memo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.memo-actions-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  color: #555;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.memo-action-btns {
  display: flex;
  gap: 0.5rem;
}

.btn-secondary {
  padding: 0.5em 1.25em;
  border: 1px solid #d6d3cb;
  border-radius: 3px;
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover { border-color: #0f1e3d; color: #0f1e3d; }

.btn-print {
  padding: 0.5em 1.25em;
  border: 1px solid #0f1e3d;
  border-radius: 3px;
  background: #0f1e3d;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-print:hover { background: #1a3160; }

/* The memo document */
.memo-document {
  background: #fff;
  border: 1px solid #d6d3cb;
  padding: 3rem 3.5rem;
  font-family: 'EB Garamond', Georgia, serif;
}

.memo-letterhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #0f1e3d;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.memo-letterhead-brand {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #0f1e3d;
  letter-spacing: 0.02em;
}

.memo-letterhead-sub {
  font-size: 0.875rem;
  color: #9b9589;
  font-style: italic;
}

.memo-letterhead-meta {
  text-align: right;
  font-size: 0.875rem;
  color: #555;
}

.memo-title {
  font-size: 1.625rem;
  font-weight: 600;
  color: #0f1e3d;
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

.memo-subtitle {
  font-size: 1rem;
  color: #777;
  font-style: italic;
  margin-bottom: 2rem;
}

/* Memo sections */
.memo-block {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid #e8e5de;
}

.memo-block:last-of-type {
  border-bottom: none;
}

.memo-block-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0f1e3d;
  margin-bottom: 0.75rem;
}

.memo-block-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #1a1a1a;
}

.memo-block-content p { margin-bottom: 0.75rem; }
.memo-block-content p:last-child { margin-bottom: 0; }

/* Liability strength badge */
.liability-badge {
  display: inline-block;
  padding: 0.2em 0.75em;
  border-radius: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.liability-strong  { background: #eaf5ef; color: #1a6b3c; border: 1px solid #a3d4b5; }
.liability-moderate { background: #fdf6e3; color: #8a6200; border: 1px solid #f5d87c; }
.liability-weak    { background: #fdf0ef; color: #943028; border: 1px solid #f0b4ae; }

/* Next steps list */
.next-steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.next-steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: #1a1a1a;
}

.next-steps-list li::before {
  content: counter(step-counter);
  counter-increment: step-counter;
  min-width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #0f1e3d;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15em;
}

.next-steps-list { counter-reset: step-counter; }

/* Documents reviewed */
.docs-reviewed-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.docs-reviewed-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: #444;
}

.docs-reviewed-list li::before {
  content: '—';
  color: #c9a84c;
  font-weight: 600;
}

/* Disclaimer */
.memo-disclaimer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8e5de;
  font-family: 'Inter', sans-serif;
  font-size: 0.775rem;
  color: #9b9589;
  font-style: italic;
  line-height: 1.5;
}

/* Footer */
.site-footer {
  border-top: 1px solid #d6d3cb;
  padding: 1.25rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9b9589;
  max-width: 900px;
  margin: 0 auto;
}

/* ── Print styles ─────────────────────────────────────────── */
@media print {
  body { background: #fff; font-size: 11pt; }

  .site-header,
  .upload-section,
  .loading-section,
  .error-section,
  .memo-actions,
  .site-footer { display: none !important; }

  main { padding: 0; max-width: 100%; }

  .memo-section { display: block !important; }

  .memo-document {
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .memo-block { page-break-inside: avoid; }

  @page {
    margin: 1.25in 1in;
    size: letter;
  }
}
