/* style.css */

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-soft: #f4f7fe;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --white: #ffffff;
}

body {
  background-color: #f4f5f7;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
  margin: 0;
}

.app-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.layout-card {
  width: 100%;
  max-width: 1200px;
  background: var(--white);
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
}

.form-pane {
  padding: 36px 44px 44px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #111827;
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.brand-name {
  font-size: 14px;
  letter-spacing: 0.4px;
}

.hero-copy h1 {
  margin: 12px 0 6px 0;
  font-size: 26px;
  color: #0f172a;
}

.hero-copy p {
  margin: 0;
  color: var(--text-muted);
}

.form-content {
  margin-top: 4px;
}

.form-card {
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Unified width for all inputs, selects, and textareas */
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%; 
  padding: 14px;
  margin-bottom: 20px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px;
  background-color: #fdfdfd;
  box-sizing: border-box; 
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  outline: none;
}

h2 {
  font-size: 24px;
  margin: 0 0 24px 0;
  font-weight: 700;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
}

/* Step Indicator */
.step-header {
  display: flex;
  justify-content: space-between;
  margin: 12px 0 20px 0;
  background: #f8f9fb;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
}

.step-item {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-item.active { color: var(--primary); }
.step-item.completed { color: #10b981; }

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.active .step-num { background: var(--primary); color: white; }
.completed .step-num { background: #10b981; color: white; }

/* Navigation Buttons */
.nav-btns {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.btn-main {
  width: 100%;
  padding: 16px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

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

.btn-secondary {
  flex: 1;
  background: white;
  color: var(--text-muted);
  border: 1.5px solid var(--border-color);
  padding: 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* Checkbox Cards */
.check-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.check-card {
  border: 2px solid var(--border-color);
  padding: 16px 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  background-color: var(--white);
  transition: all 0.2s ease;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

.check-card:hover {
  border-color: var(--primary);
  background-color: #f8f9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.check-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  cursor: pointer;
  accent-color: var(--primary);
  margin: 0;
  flex-shrink: 0;
}

.check-card span {
  flex: 1;
  user-select: none;
}

.check-card input[type="checkbox"]:checked {
  accent-color: var(--primary);
}

.check-card:has(input[type="checkbox"]:checked) {
  border-color: var(--primary);
  background-color: #f0f1ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Fallback for browsers that don't support :has() */
.check-card input[type="checkbox"]:checked + span {
  color: var(--primary);
  font-weight: 600;
}

/* Hero image side */
.image-pane {
  position: relative;
  background: url('https://images.unsplash.com/photo-1521737604893-d14cc237f11d?auto=format&fit=crop&w=1200&q=80') center/cover no-repeat;
  min-height: 640px;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.25), rgba(17, 24, 39, 0.55));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 28px;
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  width: fit-content;
}

.image-caption {
  font-size: 18px;
  line-height: 1.4;
  max-width: 520px;
}

.image-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(2px);
}

.stat-card strong {
  font-size: 18px;
}

.stat-card span {
  font-size: 13px;
  color: #e2e8f0;
}

.result-screen {
  background: transparent;
  padding: 0;
  text-align: center;
}

.success-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* AI Response Card */
.ai-response-card {
  background: #f8f9ff;
  border: 1.5px solid #e0e3ff;
  border-radius: 16px;
  overflow: hidden;
  margin-top: 16px;
  text-align: left;
}

.ai-response-header {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  padding: 12px 18px;
  display: flex;
  align-items: center;
}

.ai-badge {
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.result-text {
  padding: 20px 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-main);
}

.result-text p {
  margin: 0 0 14px 0;
}

.result-text p:last-child {
  margin-bottom: 0;
}

/* Loading State */
.ai-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 15px;
}

.ai-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #e0e3ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin 0.8s linear infinite;
}

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

/* Error State */
.ai-error {
  background: #fff5f5;
  border: 1.5px solid #fed7d7;
  border-radius: 10px;
  padding: 16px;
  color: #c53030;
  font-size: 14px;
  line-height: 1.6;
}

/* Utility to hide steps */
.hidden {
  display: none !important;
}

/* MOBILE RESPONSIVE MEDIA QUERY */
@media (max-width: 480px) {
  .app-page {
    padding: 16px;
  }

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

  .image-pane {
    min-height: 320px;
  }

  .form-pane {
    padding: 24px 20px 28px;
  }

  h2 {
    font-size: 20px;
  }

  .step-header {
    flex-direction: column;
    gap: 8px;
  }

  .btn-main, .btn-secondary {
    padding: 14px;
    font-size: 14px;
  }
}
