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

:root {
  --navy-900: #0a0f1e;
  --navy-800: #111827;
  --navy-700: #1a2540;
  --navy-600: #243058;
  --navy-500: #2e3f70;
  --blue-400: #3b5bdb;
  --blue-300: #4c6ef5;
  --blue-200: #748ffc;
  --blue-100: #bac8ff;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #868e96;
  --gray-700: #495057;
  --gray-800: #343a40;
  --accent: #4c6ef5;
  --accent-hover: #3b5bdb;
  --success: #2f9e44;
  --error: #c92a2a;
  --error-bg: #fff5f5;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'Courier New', 'Lucida Console', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--navy-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAV ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  position: relative;
  z-index: 10;
}

.nav-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--white);
}

.nav-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  padding: 8px 20px;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s;
}

.nav-cta:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
}

/* ===== LANDING ===== */
#landing {
  background: linear-gradient(150deg, var(--navy-900) 0%, var(--navy-700) 50%, var(--navy-600) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 100px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-200);
  background: rgba(76, 110, 245, 0.15);
  border: 1px solid rgba(76, 110, 245, 0.3);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--white);
  line-height: 1.05;
  max-width: 700px;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--blue-100);
  max-width: 560px;
  margin-bottom: 64px;
  line-height: 1.7;
  opacity: 0.9;
}

/* ===== FEATURE GRID ===== */
.feature-grid {
  display: flex;
  gap: 24px;
  margin-bottom: 56px;
  flex-wrap: wrap;
  justify-content: center;
}

.feature-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 220px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.25);
}

.feature-icon {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--blue-200);
  background: rgba(76, 110, 245, 0.15);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: var(--mono);
  margin-bottom: 16px;
}

.feature-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 13px;
  color: var(--blue-100);
  opacity: 0.8;
  line-height: 1.5;
}

/* ===== FORM HINT ===== */
.form-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
  font-style: italic;
}

/* ===== TRUST BAR ===== */
.trust-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.trust-item {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

.trust-divider {
  color: rgba(255,255,255,0.2);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 110, 245, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
}

.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* App section button styling */
#app .btn-outline {
  color: var(--accent);
  border-color: var(--accent);
}

#app .btn-outline:hover {
  background: rgba(76, 110, 245, 0.08);
  border-color: var(--accent-hover);
}

/* ===== APP SECTION ===== */
#app {
  background: var(--gray-100);
  min-height: 100vh;
  padding: 80px 24px;
}

.app-container {
  max-width: 1100px;
  margin: 0 auto;
}

.app-header {
  text-align: center;
  margin-bottom: 48px;
}

.app-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--navy-800);
  margin-bottom: 12px;
}

.app-subtitle {
  font-size: 16px;
  color: var(--gray-600);
  max-width: 520px;
  margin: 0 auto;
}

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

/* ===== PANELS ===== */
.panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.panel-icon {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(76, 110, 245, 0.08);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--mono);
}

.panel-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: -0.2px;
  flex: 1;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.required {
  color: var(--error);
}

.form-input,
.form-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--navy-800);
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-400);
}

/* ===== RESPONSE AREA ===== */
.response-area {
  min-height: 420px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.response-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 420px;
  color: var(--gray-400);
  text-align: center;
  padding: 24px;
  gap: 12px;
}

.response-empty-icon {
  opacity: 0.4;
  color: var(--gray-400);
}

.response-empty p {
  font-size: 14px;
  font-weight: 500;
}

.response-empty-sub {
  font-size: 13px !important;
  font-weight: 400 !important;
  opacity: 0.7;
}

/* Response content */
.response-content {
  padding: 24px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--navy-800);
}

.response-content .response-section {
  margin-bottom: 20px;
}

.response-content .response-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(76, 110, 245, 0.15);
}

.response-content .response-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}

.response-content .response-meta-item {
  color: var(--gray-600);
}

.response-content .response-meta-item strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  font-weight: 600;
  margin-bottom: 2px;
}

.response-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font);
  margin: 0;
}

/* ===== ERROR AREA ===== */
.error-area {
  background: var(--error-bg);
  border: 1px solid rgba(201, 42, 42, 0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
}

.error-area p {
  font-size: 13px;
  color: var(--error);
}

/* ===== LOADING ===== */
.loading-pulse {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 420px;
  gap: 16px;
  color: var(--gray-500);
}

.loading-dots {
  display: flex;
  gap: 6px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.loading-text {
  font-size: 14px;
  font-weight: 500;
}

/* ===== GENERATE BUTTON STATES ===== */
#generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.hidden {
  display: none !important;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-900);
  padding: 24px 48px;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.footer-divider {
  color: rgba(255,255,255,0.2);
}

.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.footer-note {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav {
    padding: 16px 24px;
  }

  .feature-grid {
    flex-direction: column;
    align-items: center;
  }

  .feature-card {
    width: 100%;
    max-width: 300px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .response-content .response-meta {
    grid-template-columns: 1fr;
  }
}
