/* ── STAKS DESIGN TOKENS ── */
:root {
  --ghost-white:      #F7F7FF;
  --alice-blue:       #E8EEF2;
  --alice-blue-dk:    #d0d8dd;
  --metallic-gold:    #D4AF37;
  --prussian-blue:    #0A1437;
  --card-border:      #CBD5D3;
  --section-divider:  #c8d2d8;
  --gap-bg:           #dfe6ea;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--prussian-blue);
  background: var(--ghost-white);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LOGIN PAGE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ghost-white);
}

.login-card {
  width: 480px;
  background: var(--alice-blue);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 12px;
  padding: 48px;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  text-align: center;
}

.login-brand {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--prussian-blue);
}

.login-subtitle {
  font-size: 13px;
  color: var(--prussian-blue);
  opacity: 0.5;
}

.login-divider {
  height: 1px;
  background: var(--alice-blue-dk);
  margin-bottom: 28px;
}

.login-form { display: flex; flex-direction: column; gap: 12px; }

.field-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--ghost-white);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--prussian-blue);
  outline: none;
  transition: border-color 0.15s;
}

.field-input:focus { border-color: var(--metallic-gold); }
.field-input::placeholder { color: var(--prussian-blue); opacity: 0.35; }

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: var(--metallic-gold);
  color: var(--ghost-white);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg {
  font-size: 13px;
  color: #b91c1c;
  text-align: center;
  display: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TOOL PAGE — SHELL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.tool-page {
  min-height: 100vh;
  background: var(--ghost-white);
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--alice-blue);
  background: var(--ghost-white);
  flex-shrink: 0;
}

.topbar-brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--prussian-blue);
}

.topbar-label {
  font-size: 13px;
  color: var(--prussian-blue);
  opacity: 0.5;
}

.logout-btn {
  font-size: 13px;
  color: var(--prussian-blue);
  opacity: 0.5;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.logout-btn:hover { opacity: 1; }

/* Two-panel layout */
.main-panels {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.left-panel {
  width: 38%;
  padding: 32px;
  overflow-y: auto;
  flex-shrink: 0;
}

.panel-divider {
  width: 1px;
  background: var(--alice-blue);
  flex-shrink: 0;
}

.right-panel {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LEFT PANEL — INPUT FORM
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.panel-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--prussian-blue);
  opacity: 0.5;
  margin-bottom: 24px;
}

.input-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }

.input-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--prussian-blue);
  opacity: 0.5;
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--ghost-white);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--prussian-blue);
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
  line-height: 1.5;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus { border-color: var(--metallic-gold); }

input::placeholder,
textarea::placeholder { color: var(--prussian-blue); opacity: 0.35; }

textarea { min-height: 80px; }

/* ── UPLOAD ZONES ── */
.upload-zone {
  position: relative;
  background: var(--ghost-white);
  border: 2px dashed var(--metallic-gold);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  overflow: hidden;
}

.upload-zone:hover { background: rgba(212, 175, 55, 0.04); }
.upload-zone.drag-over { background: rgba(212, 175, 55, 0.08); }

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.upload-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
  pointer-events: none;
  min-height: 120px;
}

.upload-icon {
  color: var(--prussian-blue);
  opacity: 0.35;
  margin-bottom: 8px;
}

.upload-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--prussian-blue);
  opacity: 0.7;
  margin-bottom: 3px;
}

.upload-hint {
  font-size: 11px;
  color: var(--prussian-blue);
  opacity: 0.4;
}

.upload-preview {
  display: block;
  padding: 10px 12px;
}

.file-chip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--alice-blue);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 0;
}

.chip-icon { font-size: 14px; flex-shrink: 0; }

.chip-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--prussian-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--prussian-blue);
  opacity: 0.5;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  transition: opacity 0.15s;
}

.chip-remove:hover { opacity: 1; }

/* Generate button */
.generate-btn {
  width: 100%;
  padding: 12px 24px;
  background: var(--metallic-gold);
  color: var(--ghost-white);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.generate-btn:hover:not(:disabled) { opacity: 0.9; }
.generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RIGHT PANEL — OUTPUT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 128px);
}

/* Hide empty state when results are visible */
.right-panel:has(.intel-card.visible) .empty-state { display: none; }

.empty-text {
  font-size: 14px;
  color: var(--prussian-blue);
  opacity: 0.4;
}

/* Error banner */
.error-banner {
  display: none;
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px 16px;
}

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

/* Loading state */
.loading-state {
  display: none;
  background: var(--alice-blue);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
}

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

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--alice-blue-dk);
  border-top-color: var(--metallic-gold);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 14px;
}

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

.loading-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--prussian-blue);
  margin-bottom: 4px;
}

.loading-sub {
  font-size: 12px;
  color: var(--prussian-blue);
  opacity: 0.5;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CARD BASE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.output-card {
  display: none;
  background: var(--alice-blue);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.output-card.visible { display: block; }

.card-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
}

.card-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--prussian-blue);
  opacity: 0.5;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   INTELLIGENCE CARD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.intel-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
}

.intel-section:last-child { border-bottom: none; }

.intel-section.gap-section {
  border-left: 3px solid var(--metallic-gold);
  background: var(--gap-bg);
  border-bottom: 1px solid var(--section-divider);
}

.section-head { margin-bottom: 8px; }

/* Hide emoji icons */
.section-icon { display: none; }

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--prussian-blue);
  opacity: 0.5;
}

.section-body {
  font-size: 14px;
  color: var(--prussian-blue);
  line-height: 1.7;
}

/* Service tags */
.service-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.service-tag {
  padding: 3px 12px;
  background: var(--ghost-white);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 6px;
  font-size: 12px;
  color: var(--prussian-blue);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   OUTREACH PACK
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.tabs {
  display: flex;
  gap: 24px;
  margin-top: 12px;
}

.tab-btn {
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  color: var(--prussian-blue);
  opacity: 0.4;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  position: relative;
  top: 1px;
}

.tab-btn:hover:not(.active) { opacity: 0.7; }

.tab-btn.active {
  color: var(--metallic-gold);
  opacity: 1;
  border-bottom-color: var(--metallic-gold);
}

/* Tab content */
.tab-content { padding: 24px; }

.tab-pane { display: none; position: relative; }
.tab-pane.active { display: block; }

/* Copy button — top-right of each tab pane */
.copy-btn {
  position: absolute;
  top: 0;
  right: 0;
  padding: 6px 12px;
  background: var(--alice-blue);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--prussian-blue);
  cursor: pointer;
  transition: opacity 0.15s;
  z-index: 1;
}

.copy-btn:hover { opacity: 0.7; }
.copy-btn.copied { color: #15803d; border-color: #86efac; }

/* Email tab */
.email-subject-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--prussian-blue);
  opacity: 0.5;
  margin-bottom: 6px;
}

.email-subject-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--prussian-blue);
  margin-bottom: 16px;
  padding-right: 80px;
}

.email-body {
  font-size: 14px;
  color: var(--prussian-blue);
  line-height: 1.75;
  white-space: pre-wrap;
  background: var(--ghost-white);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 8px;
  padding: 16px;
  padding-right: 72px;
}

/* LinkedIn tab */
.linkedin-bubble {
  font-size: 14px;
  color: var(--prussian-blue);
  line-height: 1.7;
  background: var(--ghost-white);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 8px;
  padding: 16px;
  padding-right: 72px;
  margin-bottom: 8px;
}

.char-count {
  font-size: 12px;
  color: var(--prussian-blue);
  opacity: 0.4;
}

/* Talk track tab */
.talk-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.talk-bullets li {
  padding: 12px 16px;
  background: var(--ghost-white);
  border: 1px solid var(--alice-blue-dk);
  border-radius: 6px;
  font-size: 14px;
  color: var(--prussian-blue);
  line-height: 1.65;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {
  .main-panels { flex-direction: column; overflow: auto; }
  .left-panel { width: 100%; border-bottom: 1px solid var(--alice-blue); }
  .panel-divider { display: none; }
  .right-panel { padding: 24px 16px; }
  .empty-state { min-height: 200px; }
  .topbar { padding: 0 16px; }
  .topbar-label { display: none; }
}
