/* ============================================
   GOLD OFFER COACH
   Editorial, grounded aesthetic
   Light theme: cream, dark, teal
   ============================================ */

:root {
  --cream: #FEFCF9;
  --cream-warm: #F7F3ED;
  --dark: #202020;
  --dark-soft: #3A3A3A;
  --muted: #6B6B6B;
  --teal: #53C5B3;
  --teal-deep: #3FA896;
  --border: #E8E3DC;
  --border-strong: #C9C2B7;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Switzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 4px;
  --radius-lg: 8px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   GATE (Password Screen)
   ============================================ */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background:
    radial-gradient(circle at 20% 20%, rgba(83, 197, 179, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(83, 197, 179, 0.04) 0%, transparent 50%),
    var(--cream);
}

.gate-inner {
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.gate-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--teal-deep);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.gate-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1.05;
  margin-bottom: var(--space-md);
  font-weight: 400;
}

.gate-lede {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.gate-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--cream);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--dark);
  text-align: center;
  letter-spacing: 0.05em;
  transition: border-color 0.2s ease;
}

.gate-input:focus {
  outline: none;
  border-color: var(--teal);
}

.gate-button {
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--dark);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, transform 0.1s ease;
}

.gate-button:hover {
  background: var(--dark-soft);
}

.gate-button:active {
  transform: translateY(1px);
}

.gate-error {
  color: #B94444;
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
}

.gate-footer {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: var(--space-md);
}

/* ============================================
   WELCOME SCREEN
   ============================================ */

.welcome {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  max-width: 880px;
  margin: 0 auto;
}

.welcome-header {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
}

.welcome-main {
  flex: 1;
  padding: var(--space-xl) 0 var(--space-lg);
  max-width: 720px;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--teal-deep);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  line-height: 1.1;
  font-weight: 400;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.welcome-title em {
  font-style: italic;
  color: var(--teal-deep);
}

.welcome-lede {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--dark-soft);
  margin-bottom: var(--space-lg);
  max-width: 640px;
}

/* Framework Grid */
.framework {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.framework-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--space-sm) 0;
}

.framework-letter {
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
  color: var(--teal-deep);
}

.framework-text {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--dark-soft);
  font-weight: 500;
}

/* Welcome Prompt & Entry Paths */
.welcome-prompt {
  font-family: var(--font-display);
  font-size: 1.625rem;
  line-height: 1.2;
  font-weight: 400;
  margin-bottom: var(--space-md);
}

.entry-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.entry-path {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: var(--space-md);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.entry-path:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(32, 32, 32, 0.04);
}

.entry-path-label {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--dark);
}

.entry-path-sub {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.5;
}

.welcome-note {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

.welcome-footer {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ============================================
   CHAT INTERFACE
   ============================================ */

.chat {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  margin: 0 auto;
}

.chat-header {
  position: sticky;
  top: 0;
  background: rgba(254, 252, 249, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.chat-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.brand-mark-small {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-style: italic;
}

.chat-actions {
  display: flex;
  gap: 0.5rem;
}

.chat-action {
  padding: 0.5rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  background: transparent;
  color: var(--dark);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}

.chat-action:hover {
  background: var(--dark);
  color: var(--cream);
  border-color: var(--dark);
}

.chat-action-subtle {
  color: var(--muted);
  border-color: transparent;
}

.chat-action-subtle:hover {
  background: transparent;
  color: var(--dark);
  border-color: var(--border-strong);
}

.chat-main {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.message {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: messageIn 0.35s ease-out;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 500;
}

.message-role-coach {
  color: var(--teal-deep);
}

.message-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--dark);
}

.message-content p {
  margin-bottom: 0.875rem;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul,
.message-content ol {
  margin: 0.5rem 0 0.875rem var(--space-md);
}

.message-content li {
  margin-bottom: 0.375rem;
}

.message-content strong {
  font-weight: 600;
}

.message-content em {
  font-style: italic;
}

.message-user .message-content {
  padding: var(--space-sm) var(--space-md);
  background: var(--cream-warm);
  border-radius: var(--radius-lg);
  border-left: 2px solid var(--border-strong);
}

.message-coach .message-content {
  padding: var(--space-sm) 0;
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 0.5rem 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  animation: typing 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ============================================
   CHAT INPUT
   ============================================ */

.chat-footer {
  position: sticky;
  bottom: 0;
  background: var(--cream);
  border-top: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  max-width: 100%;
}

.chat-input {
  flex: 1;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--cream);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--dark);
  resize: none;
  max-height: 200px;
  min-height: 48px;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--teal);
}

.chat-submit {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  color: var(--cream);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.chat-submit:hover {
  background: var(--teal-deep);
}

.chat-submit:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
}

.chat-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .framework {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md) var(--space-sm);
  }

  .entry-paths {
    grid-template-columns: 1fr;
  }

  .welcome-main {
    padding: var(--space-lg) 0;
  }

  .chat-header-inner {
    padding: 0.75rem var(--space-sm);
  }

  .chat-actions {
    flex-wrap: wrap;
  }

  .chat-action {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
  }

  .chat-main {
    padding: var(--space-md) var(--space-sm);
  }

  .chat-footer {
    padding: 0.75rem var(--space-sm) var(--space-sm);
  }
}
