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

:root {
  --navy-deep: #1a2e3a;
  --brass: #b8860b;
  --brass-light: #d4af37;
  --cream-warm: #f5f1e8;
  --background: #ffffff;
  --foreground: #1a2e3a;
  --muted-foreground: #6b7280;
  --border: #e5e7eb;
  --primary: #1a2e3a;
  --primary-foreground: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-foreground);
  font-family: serif;
  font-weight: bold;
  font-size: 0.875rem;
}

.logo-text {
  font-family: serif;
  font-weight: bold;
  color: var(--navy-deep);
  font-size: 1.125rem;
}

/* Main */
main {
  flex: 1;
}

.hero-section {
  position: relative;
  padding: 5rem 1.5rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 8rem 1.5rem;
  }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(245, 241, 232, 0.5), transparent);
  pointer-events: none;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.hero-content {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 2rem;
  color: var(--foreground);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 4rem;
  }
}

.hero-title .highlight {
  display: block;
  color: var(--brass);
  margin-top: 0.5rem;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .hero-description {
    font-size: 1.5rem;
  }
}

.btn-primary {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--navy-deep);
  color: var(--primary-foreground);
  border: none;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: #0f1d25;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding-top: 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-icon {
  width: 1rem;
  height: 1rem;
  color: var(--brass);
}

/* Form Modal */
.form-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  overflow: hidden;
  padding: 0.5rem;
}

@media (min-width: 640px) {
  .form-modal {
    padding: 1rem;
  }
}

.form-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-container {
  background: var(--background);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 640px) {
  .form-container {
    border-radius: 1rem;
    height: auto;
    max-height: calc(100vh - 2rem);
  }
}

.form-header {
  background: linear-gradient(135deg, var(--navy-deep) 0%, #2a4a5a 100%);
  color: white;
  padding: 1rem;
  text-align: center;
  border-radius: 0.75rem 0.75rem 0 0;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .form-header {
    padding: 1.5rem;
    border-radius: 1rem 1rem 0 0;
  }
}

.form-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
  .form-header h2 {
    font-size: 1.5rem;
  }
}

.form-header p {
  opacity: 0.9;
  font-size: 0.875rem;
}

@media (min-width: 640px) {
  .form-header p {
    font-size: 1rem;
  }
}

.form-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

@media (min-width: 640px) {
  .form-content {
    padding: 1.5rem;
  }
}

#leadForm {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Progress indicator */
.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: var(--brass);
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .progress-text {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }
}

/* Question step */
.question-step {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.question-step.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

.question-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 0.75rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .question-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: clamp(0.375rem, 1.5vh, 0.5rem);
  margin-bottom: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 640px) {
  .answer-options {
    gap: clamp(0.5rem, 2vh, 0.75rem);
    margin-bottom: 0.75rem;
  }
}

.answer-option {
  padding: clamp(0.5rem, 2vh, 0.875rem);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  background: var(--background);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  font-weight: 500;
  color: var(--foreground);
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 640px) {
  .answer-option {
    padding: clamp(0.625rem, 2.5vh, 0.875rem);
    border-radius: 0.75rem;
    font-size: clamp(0.875rem, 1.5vw, 0.95rem);
  }
}

.answer-option:hover {
  border-color: var(--brass);
  background: rgba(184, 134, 11, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.answer-option.selected {
  border-color: var(--brass);
  background: rgba(184, 134, 11, 0.1);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.2);
}

/* Navigation buttons */
.form-navigation {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-shrink: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
  .form-navigation {
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }
}

.nav-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--background);
  color: var(--foreground);
  flex: 1;
}

@media (min-width: 640px) {
  .nav-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    flex: 0;
  }
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--navy-deep);
  background: var(--navy-deep);
  color: white;
}

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

.nav-btn.primary {
  background: var(--navy-deep);
  color: white;
  border-color: var(--navy-deep);
}

.nav-btn.primary:hover:not(:disabled) {
  background: #0f1d25;
}

/* Text input fields */
.form-group {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .form-group {
    margin-bottom: 1rem;
  }
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

@media (min-width: 640px) {
  .form-group label {
    font-size: 0.95rem;
  }
}

.form-group label.required::after {
  content: " *";
  color: #c85a4f;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--background);
  color: var(--foreground);
}

@media (min-width: 640px) {
  .form-group input,
  .form-group textarea {
    font-size: 1rem;
  }
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy-deep);
  box-shadow: 0 0 0 3px rgba(26, 46, 58, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.submit-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--navy-deep);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.75rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .submit-btn {
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
  }
}

.submit-btn:hover {
  background: #0f1d25;
  transform: translateY(-1px);
}

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

.close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background 0.2s;
}

@media (min-width: 640px) {
  .close-btn {
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    font-size: 1.5rem;
  }
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
  font-weight: 500;
}

.message.success {
  background: rgba(74, 124, 89, 0.1);
  color: #4a7c59;
  border: 2px solid #4a7c59;
}

.message.error {
  background: rgba(200, 90, 79, 0.1);
  color: #c85a4f;
  border: 2px solid #c85a4f;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.help-text {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.situation-description {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  background: rgba(184, 134, 11, 0.05);
  border-radius: 0.5rem;
  border: 2px solid rgba(184, 134, 11, 0.2);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .situation-description {
    padding: 1.5rem;
    border-radius: 0.75rem;
  }
}

#situation-description-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--foreground);
  margin: 0;
}

@media (min-width: 640px) {
  #situation-description-text {
    font-size: 1rem;
  }
}

/* Footer */
footer {
  background: var(--navy-deep);
  color: var(--primary-foreground);
  margin-top: 5rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(184, 134, 11, 0.2);
}

.footer-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--brass-light);
}

.footer-item h4 {
  font-family: serif;
  font-weight: bold;
  font-size: 1.125rem;
}

.footer-item p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
}

.footer-item blockquote {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  font-style: italic;
}

.footer-item .quote-author {
  font-size: 0.875rem;
  color: var(--brass-light);
  margin-top: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-foreground);
}

/* Navigation */
.nav-link {
  color: var(--navy-deep);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(26, 46, 58, 0.05);
}

/* Content Section */
.content-section {
  padding: 4rem 1.5rem;
  background: var(--background);
}

.content-container {
  max-width: 900px;
  margin: 0 auto;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.content-block {
  background: var(--background);
  padding: 2rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.content-block h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 1rem;
  font-family: serif;
}

.content-block p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--foreground);
  margin-bottom: 1rem;
}

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

.content-list {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
}

.content-list li {
  padding: 0.75rem 0;
  padding-left: 1.75rem;
  position: relative;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--foreground);
}

.content-list li::before {
  content: "•";
  position: absolute;
  left: 0.5rem;
  color: var(--brass);
  font-weight: bold;
  font-size: 1.25rem;
}

.content-list li strong {
  color: var(--navy-deep);
  font-weight: 600;
}

.highlight-block {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.05) 0%, rgba(184, 134, 11, 0.02) 100%);
  border: 2px solid rgba(184, 134, 11, 0.2);
  text-align: center;
}

.highlight-block h2 {
  color: var(--brass);
}

.highlight-block .btn-primary {
  margin-top: 1.5rem;
}

.intro-block {
  text-align: center;
}

.lead-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .content-section {
    padding: 6rem 1.5rem;
  }

  .content-block {
    padding: 2.5rem;
  }

  .content-block h2 {
    font-size: 2rem;
  }

  .lead-text {
    font-size: 1.5rem;
  }

  .divider {
    margin: 3rem 0;
  }
}

/* Logo link (e.g. on chat page) */
.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.nav-link-active {
  background: rgba(26, 46, 58, 0.08);
  font-weight: 600;
}

/* Chat page */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem - 120px);
}

.chat-section {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.chat-container {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--background);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 0.35rem;
  font-family: serif;
}

.chat-description {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}

.chat-welcome {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  padding: 0.75rem 0;
}

.chat-msg-wrap {
  display: flex;
  width: 100%;
}

.chat-msg-wrap.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-wrap.chat-msg-assistant {
  justify-content: flex-start;
}

.chat-msg-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.chat-msg-user .chat-msg-bubble {
  background: var(--navy-deep);
  color: var(--primary-foreground);
  border-bottom-right-radius: 0.25rem;
}

.chat-msg-assistant .chat-msg-bubble {
  background: var(--cream-warm);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-bottom-left-radius: 0.25rem;
}

.chat-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-form {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  resize: none;
  min-height: 48px;
  max-height: 160px;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.15);
}

.chat-send-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 0.75rem;
  background: var(--navy-deep);
  color: var(--primary-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.chat-send-btn:hover:not(:disabled) {
  background: #0f1d25;
}

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

.chat-send-btn.loading {
  pointer-events: none;
}

.chat-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #b91c1c;
}
