/* ============================================================
   Ayers Intelligence: NIL Navigator — style.css
   Mobile-first, warm and trustworthy
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #faf9f5;
  color: #1a1a1a;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 80px; /* space for disclaimer bar */
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: #1b4332;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid #d4a843;
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-top {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.logo-bottom {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.01em;
}

.logo-bottom span { color: #d4a843; }

/* ── Mode nav ─────────────────────────────────────────────── */
.mode-nav {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border-bottom: 1px solid #e8e2d9;
}

.mode-nav-btn {
  padding: 0.875rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #9b9589;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.mode-nav-btn .nav-icon { font-size: 1.125rem; }

.mode-nav-btn:hover { color: #1b4332; }

.mode-nav-btn.active {
  color: #1b4332;
  border-bottom-color: #1b4332;
}

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

/* ── Mode panels ──────────────────────────────────────────── */
.mode-panel { display: none; }
.mode-panel.active { display: block; }

/* ── Home / mode selector ─────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.home-hero-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  color: #1b4332;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.home-hero-sub {
  font-size: 1.0625rem;
  color: #555;
  max-width: 420px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.home-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-card {
  background: #fff;
  border: 1.5px solid #e8e2d9;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.home-card:hover {
  border-color: #1b4332;
  transform: translateY(-1px);
}

.home-card-icon {
  font-size: 2.25rem;
  flex-shrink: 0;
}

.home-card-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1875rem;
  color: #1b4332;
  margin-bottom: 0.25rem;
}

.home-card-desc {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
}

.home-card-arrow {
  margin-left: auto;
  color: #d4a843;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ── Onboarding wizard ────────────────────────────────────── */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8e2d9;
  transition: background 0.2s;
}

.progress-dot.done  { background: #1b4332; }
.progress-dot.active { background: #d4a843; width: 20px; border-radius: 4px; }

.wizard-step-label {
  margin-left: auto;
  font-size: 0.8rem;
  color: #9b9589;
}

.wizard-question {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.wizard-sub {
  font-size: 0.9375rem;
  color: #6b7280;
  margin-bottom: 1.75rem;
}

.option-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-btn {
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1.5px solid #e8e2d9;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.4;
}

.option-btn:hover {
  border-color: #1b4332;
  background: #f0f7f4;
}

.option-btn.selected {
  border-color: #1b4332;
  background: #f0f7f4;
  color: #1b4332;
  font-weight: 600;
}

.wizard-text-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  border: 1.5px solid #e8e2d9;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1.25rem;
}

.wizard-text-input:focus { border-color: #1b4332; }
.wizard-text-input::placeholder { color: #b0ab9f; }

.wizard-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn-back {
  padding: 0.8em 1.25em;
  background: none;
  border: 1.5px solid #e8e2d9;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-back:hover { border-color: #9b9589; color: #1a1a1a; }

.btn-next {
  flex: 1;
  padding: 0.875em 1.5em;
  background: #1b4332;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-next:hover:not(:disabled) { background: #245c44; }
.btn-next:disabled { background: #c5c0b5; cursor: not-allowed; }

/* ── Profile output ───────────────────────────────────────── */
.profile-card {
  background: #fff;
  border: 1px solid #e8e2d9;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.profile-header {
  background: #1b4332;
  padding: 1.5rem;
}

.profile-header-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.3rem;
}

.profile-header-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.375rem;
  color: #fff;
}

.profile-body {
  padding: 1.5rem;
}

.profile-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0ede6;
}

.profile-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1b4332;
  margin-bottom: 0.625rem;
}

.profile-section-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #2c2c2c;
}

.profile-section-content p { margin-bottom: 0.5rem; }
.profile-section-content p:last-child { margin-bottom: 0; }

.priority-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.priority-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.priority-list li::before {
  content: counter(priority-counter);
  counter-increment: priority-counter;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #1b4332;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.priority-list { counter-reset: priority-counter; }

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.checklist li::before {
  content: '☐';
  color: #1b4332;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05em;
}

.watchout-item {
  padding: 0.875rem 1rem;
  background: #fdf6e3;
  border-left: 3px solid #d4a843;
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #2c2c2c;
}

/* ── Deal review ──────────────────────────────────────────── */
.deal-input-area {
  background: #fff;
  border: 1.5px solid #e8e2d9;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.deal-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  display: block;
}

.deal-textarea {
  width: 100%;
  min-height: 200px;
  padding: 0.875rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  border: 1.5px solid #e8e2d9;
  border-radius: 8px;
  background: #faf9f5;
  color: #1a1a1a;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.6;
}

.deal-textarea:focus { border-color: #1b4332; background: #fff; }
.deal-textarea::placeholder { color: #b0ab9f; }

.deal-analyze-btn {
  width: 100%;
  padding: 1rem;
  background: #1b4332;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.deal-analyze-btn:hover:not(:disabled) { background: #245c44; }
.deal-analyze-btn:disabled { background: #c5c0b5; cursor: not-allowed; }

/* Deal output sections */
.deal-result {
  display: none;
}

.deal-result.visible { display: block; }

.deal-section {
  background: #fff;
  border: 1px solid #e8e2d9;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.deal-section-header {
  padding: 0.875rem 1.25rem;
  background: #f7f5f0;
  border-bottom: 1px solid #e8e2d9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.deal-section-icon { font-size: 1.1rem; }

.deal-section-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deal-section-body {
  padding: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #2c2c2c;
}

.deal-section-body p { margin-bottom: 0.625rem; }
.deal-section-body p:last-child { margin-bottom: 0; }

.deal-section-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.deal-section-body ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

.deal-section-body ul li::before {
  content: '→';
  color: #1b4332;
  font-weight: 700;
  flex-shrink: 0;
}

/* Bottom line verdict */
.verdict-card {
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.verdict-straightforward { background: #f0faf4; border: 1.5px solid #a3d4b5; }
.verdict-caution         { background: #fdf6e3; border: 1.5px solid #f5d87c; }
.verdict-professional    { background: #fdf0ef; border: 1.5px solid #f0b4ae; }

.verdict-icon { font-size: 1.75rem; flex-shrink: 0; }

.verdict-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.verdict-straightforward .verdict-label { color: #1a6b3c; }
.verdict-caution .verdict-label         { color: #8a6200; }
.verdict-professional .verdict-label    { color: #943028; }

.verdict-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #2c2c2c;
}

/* Red flags */
.red-flag-item {
  padding: 0.875rem 1rem;
  background: #fdf0ef;
  border-left: 3px solid #e05252;
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #2c2c2c;
}

/* ── Chat mode ────────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.875rem 1.125rem;
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.chat-bubble.user {
  background: #1b4332;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  background: #fff;
  color: #1a1a1a;
  align-self: flex-start;
  border: 1px solid #e8e2d9;
  border-bottom-left-radius: 4px;
}

.chat-bubble.assistant p { margin-bottom: 0.5rem; }
.chat-bubble.assistant p:last-child { margin-bottom: 0; }

.chat-bubble.typing {
  background: #fff;
  border: 1px solid #e8e2d9;
  align-self: flex-start;
  padding: 0.875rem 1.25rem;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: #9b9589;
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.chat-welcome {
  background: #f0f7f4;
  border: 1px solid #a3d4b5;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 0.5rem;
}

.chat-welcome-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1rem;
  color: #1b4332;
  margin-bottom: 0.4rem;
}

.chat-welcome-text {
  font-size: 0.9rem;
  color: #2c5e44;
  line-height: 1.5;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chat-suggestion {
  padding: 0.4em 0.875em;
  background: #fff;
  border: 1px solid #a3d4b5;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1b4332;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-suggestion:hover { background: #f0f7f4; }

.chat-input-row {
  display: flex;
  gap: 0.625rem;
  padding-top: 0.875rem;
  border-top: 1px solid #e8e2d9;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  border: 1.5px solid #e8e2d9;
  border-radius: 24px;
  background: #fff;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus { border-color: #1b4332; }
.chat-input::placeholder { color: #b0ab9f; }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1b4332;
  border: none;
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.chat-send-btn:hover:not(:disabled) { background: #245c44; }
.chat-send-btn:disabled { background: #c5c0b5; cursor: not-allowed; }

/* ── Loading states ───────────────────────────────────────── */
.loading-overlay {
  display: none;
  background: #fff;
  border: 1px solid #e8e2d9;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

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

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8e2d9;
  border-top-color: #1b4332;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-text {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.125rem;
  color: #1a1a1a;
  margin-bottom: 0.3rem;
}

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

/* ── Error ────────────────────────────────────────────────── */
.error-box {
  display: none;
  background: #fdf0ef;
  border: 1px solid #f0b4ae;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: #943028;
  margin-bottom: 1rem;
}

.error-box.visible { display: block; }

/* ── Persistent disclaimer ────────────────────────────────── */
.disclaimer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e8e2d9;
  padding: 0.6rem 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: #9b9589;
  line-height: 1.4;
  z-index: 40;
}

/* ── Section headers ──────────────────────────────────────── */
.section-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.375rem;
  color: #1b4332;
  margin-bottom: 0.4rem;
}

.section-sub {
  font-size: 0.9375rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ── Utility ──────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1b4332;
  cursor: pointer;
  margin-bottom: 1.5rem;
  padding: 0;
  background: none;
  border: none;
}

.back-link:hover { text-decoration: underline; }

.reset-btn {
  width: 100%;
  padding: 0.875rem;
  background: none;
  border: 1.5px solid #1b4332;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1b4332;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 1rem;
}

.reset-btn:hover { background: #f0f7f4; }

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width: 640px) {
  .main-content { padding: 2rem 1.5rem 2.5rem; }
  .home-cards { flex-direction: column; }
  .chat-container { height: calc(100vh - 260px); }
}
