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

:root {
  --primary: #1A1D51;
  --accent: #FFBF00;
  --accent-hover: #E6AC00;
  --bg: #F9F8F6;
  --bg-card: #FDFDFC;
  --text: #1A1D51;
  --text-muted: #6B6E8A;
  --border: #E5E2DC;
  --white: #FFFFFF;
  --green: #0F7A4D;
  --green-bg: #E6F4ED;
  --amber: #B5651D;
  --amber-bg: #FDF0E6;
  --red: #9B1C2C;
  --red-bg: #F9E6E8;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* === Landing Page === */
.landing-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
}

.landing-container {
  width: 100%;
  max-width: 560px;
  padding: 0 24px;
}

.landing-content {
  text-align: center;
}

.landing-logo {
  height: 28px;
  width: auto;
  margin-bottom: 32px;
  opacity: 0.9;
}

.landing-title {
  font-family: 'Unna', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.landing-subtitle {
  font-size: 16px;
  color: rgba(249, 248, 246, 0.6);
  margin-bottom: 40px;
  font-weight: 300;
}

.landing-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#url-input {
  width: 100%;
  padding: 12px 0;
  font-family: 'Unna', serif;
  font-size: 28px;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: transparent;
  color: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

#url-input:focus {
  border-bottom-color: var(--accent);
}

#url-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

/* === Buttons === */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid rgba(255, 191, 0, 0.5);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-large {
  padding: 14px 32px;
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === Loading === */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 29, 81, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  animation: pulse 2s ease-in-out infinite;
}

/* === Error === */
.error-message {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(252, 232, 227, 0.3);
  color: #C43E2A;
  border-radius: 6px;
  font-size: 14px;
  text-align: left;
  border: 1px solid rgba(196, 62, 42, 0.2);
}

/* === Brief Page === */
.brief-page {
  background: var(--bg);
  min-height: 100vh;
  padding: 48px 24px;
}

.brief-container {
  max-width: 720px;
  margin: 0 auto;
}

/* === Brief Header === */
.brief-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--primary);
}

.brief-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 12px;
}

.brief-title {
  font-family: 'Unna', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.brief-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 191, 0, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
}

.brief-subtitle {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.prospect-name {
  font-family: 'Unna', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.brief-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* === Prospect Summary === */
.prospect-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 32px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.summary-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.summary-value {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}

.summary-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === Sections === */
.brief-section {
  margin-bottom: 32px;
}

.section-title {
  font-family: 'Unna', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* === Signals === */
.signals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signal-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.signal-number {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
}

.signal-text {
  font-size: 14px;
  margin-bottom: 4px;
}

.signal-implication {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Opportunities === */
.opportunities-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.opportunity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.opportunity-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.opportunity-title {
  font-family: 'Unna', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.complexity-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.opportunity-row {
  margin-bottom: 12px;
}

.opportunity-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.opportunity-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}

.opportunity-impact {
  background: rgba(255, 191, 0, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.opportunity-impact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* === Service Tags on Opportunities === */
.opportunity-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.service-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255, 191, 0, 0.1);
  color: var(--primary);
  border: 1px solid rgba(255, 191, 0, 0.25);
}

/* === Recommended Services === */
.services-rec-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.service-rec-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.service-rec-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.service-rec-rationale {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Conversation Starters === */
.starters-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.starter-item {
  padding: 16px 20px;
  background: var(--primary);
  border-radius: 8px;
  font-size: 14px;
  font-style: italic;
  color: rgba(249, 248, 246, 0.85);
  line-height: 1.55;
}

/* === Caveats === */
.caveats-box {
  background: rgba(26, 29, 81, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}

.caveats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.caveats-list li {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.55;
}

.caveats-list li::before {
  content: '—';
  position: absolute;
  left: 0;
}

/* === Footer === */
.brief-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.brief-footer p {
  font-size: 12px;
  color: var(--text-muted);
}

/* === Actions === */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

.actions .btn {
  padding: 12px 24px;
  font-size: 14px;
}

.actions .btn-secondary {
  color: var(--primary);
  border-color: var(--border);
}

.actions .btn-secondary:hover {
  border-color: var(--primary);
}

/* === PDF Mode === */
.pdf-mode .actions,
.pdf-mode .brief-footer-actions {
  display: none !important;
}

/* === Demo Buttons === */
.preloaded-demos {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-label {
  font-size: 13px;
  color: rgba(249, 248, 246, 0.35);
  font-weight: 400;
}

.demo-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(249, 248, 246, 0.6);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.demo-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Email Modal === */
.email-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 81, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.email-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.email-modal-title {
  font-family: 'Unna', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.email-modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.email-input {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}

.email-input:focus {
  border-color: var(--accent);
}

.email-send-btn {
  width: 100%;
}

.email-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 20px;
}

.email-error {
  color: var(--red);
}

.email-success {
  color: var(--green);
}

/* === PDF Mode === */
.pdf-mode .actions,
.pdf-mode .brief-footer-actions,
.pdf-mode .email-modal {
  display: none !important;
}

/* === Responsive === */
@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .brief-header-top {
    flex-direction: column;
  }
  .actions {
    flex-direction: column;
  }
}
