/* ================================================================
   AI Travel Studio — AEO Audit Landing Page
   ================================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-900: #1a365d;
  --blue-800: #2a4a7f;
  --blue-700: #2c5282;
  --blue-600: #2b6cb0;
  --blue-100: #ebf8ff;
  --teal-500: #38b2ac;
  --teal-600: #319795;
  --teal-400: #4fd1c5;
  --teal-100: #e6fffa;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --yellow-500: #eab308;
  --yellow-100: #fef9c3;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-700: #15803d;
  --orange-500: #f97316;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

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

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow { max-width: 40rem; }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero__title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero__subtitle {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.85);
  max-width: 36rem;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero__props {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 48rem;
  margin: 0 auto 2.5rem;
}
.prop {
  text-align: center;
}
.prop__icon {
  color: var(--teal-400);
  margin-bottom: 0.5rem;
}
.prop__label {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.prop__desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.hero__cta {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--teal-500);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.hero__cta:hover { background: var(--teal-600); }

/* --- Form --- */
.form-section {
  padding: 4rem 0;
}
.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--gray-900);
}
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.375rem;
  color: var(--gray-700);
}
.optional {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 0.85rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(56,178,172,0.15);
}
.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-error {
  background: var(--red-100);
  color: var(--red-500);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* --- Chip Input --- */
.chip-input {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: #fff;
  cursor: text;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 2.75rem;
}
.chip-input:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(56,178,172,0.15);
}
.chip-input input {
  flex: 1;
  min-width: 8rem;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--gray-800);
  background: transparent;
  padding: 0.25rem 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: var(--blue-100);
  color: var(--blue-700);
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}
.chip__remove {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--blue-600);
  font-size: 0.85rem;
  line-height: 1;
  transition: background var(--transition);
  padding: 0;
}
.chip__remove:hover {
  background: rgba(42,74,127,0.15);
}
.chip-input__suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 12rem;
  overflow-y: auto;
  display: none;
}
.chip-input__suggestions.active { display: block; }
.suggestion-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
  transition: background var(--transition);
}
.suggestion-item:hover,
.suggestion-item.selected {
  background: var(--gray-100);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--teal-500);
  color: #fff;
}
.btn--primary:hover { background: var(--teal-600); }
.btn--primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}
.btn--full { width: 100%; }
.btn--large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* --- Loading --- */
.loading-section {
  padding: 6rem 0;
  text-align: center;
}
.loading-card {
  background: #fff;
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.loading-icon {
  color: var(--teal-500);
  margin-bottom: 1.5rem;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--gray-200);
  border-radius: 1rem;
  overflow: hidden;
  margin: 1.5rem 0 1rem;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal-500), var(--blue-600));
  border-radius: 1rem;
  transition: width 0.5s ease;
}
.loading-status {
  color: var(--gray-500);
  font-size: 0.95rem;
}

/* --- Results --- */
.results-section {
  padding: 3rem 0 4rem;
}
.results-header {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background: #fff;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}
.score-gauge {
  position: relative;
  width: 9rem;
  height: 9rem;
  flex-shrink: 0;
}
.score-gauge__svg { width: 100%; height: 100%; }
.score-gauge__arc {
  transition: stroke-dashoffset 1.5s ease, stroke 0.5s ease;
}
.score-gauge__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-gauge__value span {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
}
.results-header__info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.badge {
  display: inline-block;
  padding: 0.3rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.badge--red { background: var(--red-100); color: var(--red-500); }
.badge--yellow { background: var(--yellow-100); color: var(--yellow-500); }
.badge--green { background: var(--green-100); color: var(--green-600); }
.badge--dark-green { background: #065f46; color: #a7f3d0; }

/* Cards */
.card {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--gray-900);
}

/* Dimension bars */
.dimension-bar {
  margin-bottom: 1rem;
}
.dimension-bar:last-child { margin-bottom: 0; }
.dimension-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.dimension-bar__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
}
.dimension-bar__name span {
  font-weight: 400;
  color: var(--gray-500);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}
.dimension-bar__meta {
  font-size: 0.8rem;
  color: var(--gray-400);
}
.dimension-bar__track {
  width: 100%;
  height: 0.5rem;
  background: var(--gray-200);
  border-radius: 1rem;
  overflow: hidden;
}
.dimension-bar__fill {
  height: 100%;
  border-radius: 1rem;
  transition: width 1s ease;
}

/* Coverage */
.coverage-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.coverage-rate {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--blue-900);
}
.coverage-label {
  font-size: 0.9rem;
  color: var(--gray-500);
}
.coverage-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.coverage-item:last-child { border-bottom: none; }
.coverage-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
  margin-top: 0.15rem;
}
.coverage-prompt {
  font-size: 0.9rem;
  color: var(--gray-700);
  flex: 1;
}
.coverage-provider {
  font-size: 0.75rem;
  color: var(--gray-400);
  flex-shrink: 0;
}
.coverage-provider-summary {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}
.coverage-citation-type {
  font-size: 0.75rem;
  color: var(--gray-400);
  flex-shrink: 0;
  min-width: 4rem;
  text-align: right;
}
.coverage-item--grouped {
  padding-left: 1rem;
}
.prompt-group {
  margin-bottom: 0.5rem;
}
.prompt-group__header {
  font-size: 0.9rem;
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.75rem 0 0.25rem 0;
  border-bottom: 1px solid var(--gray-100);
}

/* Recommendations */
.rec-card {
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: border-color var(--transition);
}
.rec-card:hover { border-color: var(--gray-300); }
.rec-card--tat {
  border-left: 3px solid var(--orange-500);
}
.rec-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.rec-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rec-badge--critical { background: var(--red-100); color: var(--red-500); }
.rec-badge--high { background: #fff7ed; color: var(--orange-500); }
.rec-badge--medium { background: var(--yellow-100); color: var(--yellow-500); }
.rec-badge--low { background: var(--gray-100); color: var(--gray-500); }
.rec-dimension {
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--blue-100);
  color: var(--blue-700);
}
.rec-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  margin-bottom: 0.35rem;
}
.rec-card__desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* CTA section */
.cta-section {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  margin-top: 2rem;
}
.cta-section h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}
.cta-section p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.5rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

/* CTA Success State */
.cta-success__icon {
  color: var(--green-500);
  margin-bottom: 1rem;
}
.cta-success__buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.btn--secondary-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.btn--secondary-light:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.8);
}
.cta-success__note {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.5rem;
}

/* Error */
.error-section {
  padding: 6rem 0;
  text-align: center;
}
.error-card {
  background: #fff;
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.error-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--red-100);
  color: var(--red-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.error-card h2 { margin-bottom: 0.5rem; }
.error-card p { color: var(--gray-500); margin-bottom: 1.5rem; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--gray-400);
  font-size: 0.85rem;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 768px) {
  .hero { padding: 3rem 0 2.5rem; }
  .hero__title { font-size: 2rem; }
  .hero__subtitle { font-size: 1.05rem; }
  .hero__props {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 20rem;
  }
  .form-row { grid-template-columns: 1fr; }
  .results-header {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .score-gauge { width: 7rem; height: 7rem; }
  .score-gauge__value span { font-size: 2rem; }
  .card { padding: 1.5rem; }
  .cta-section { padding: 2rem 1.5rem; }
  .cta-section h2 { font-size: 1.35rem; }
}

@media (max-width: 480px) {
  .hero__title { font-size: 1.65rem; }
  .container { padding: 0 1rem; }
  .loading-card, .error-card { padding: 2rem 1.25rem; }
  .rec-card { padding: 1rem; }
}

/* --- No-score state (no URL provided) --- */
.score-gauge--empty .score-gauge__value span {
  font-size: 1.1rem;
  color: var(--gray-400);
}
