/* ===================================================
   Zoning Assist — Global Stylesheet
   Colors: Navy #0F1B2D | Electric Blue #2563EB | White
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --navy: #0F1B2D;
  --navy-light: #1a2d47;
  --navy-mid: #162236;
  --blue: #2563EB;
  --blue-light: #3b82f6;
  --blue-dark: #1d4ed8;
  --white: #FFFFFF;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--navy);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-brand img,
.navbar-brand svg {
  width: 32px;
  height: 32px;
}

.navbar-brand .brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.navbar-brand .brand-text span {
  color: var(--blue-light);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-badge {
  background: rgba(37,99,235,0.2);
  color: var(--blue-light);
  border: 1px solid rgba(37,99,235,0.4);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1e3a5f 100%);
  padding: 24px 24px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(37,99,235,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 50%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(37,99,235,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  color: var(--blue-light);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.hero h1 .highlight {
  color: var(--blue-light);
}

.hero p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  max-width: 540px;
  margin: 0 auto 14px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* ===== SEARCH BOX ===== */
.search-box {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.search-input-wrapper {
  display: flex;
  gap: 0;
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(37,99,235,0.2);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.search-input-wrapper:focus-within {
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(37,99,235,0.4);
}

.search-input-wrapper input {
  flex: 1;
  padding: 18px 20px;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-800);
  background: transparent;
}

.search-input-wrapper input::placeholder {
  color: var(--gray-400);
}

.search-btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 18px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-btn:hover {
  background: var(--blue-dark);
}

.search-btn:active {
  transform: scale(0.98);
}

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

.search-hint {
  margin-top: 14px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

.search-hint code {
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* ===== LOADING STATE ===== */
.loading-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: var(--gray-600);
  font-size: 0.95rem;
}

.loading-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--gray-400);
  transition: color 0.3s;
}

.loading-step.active {
  color: var(--blue);
}

.loading-step.done {
  color: var(--green);
}

.step-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
}

/* ===== ERROR STATE ===== */
.error-box {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 16px 20px;
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 16px;
  text-align: left;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.error-box.active {
  display: block;
}

/* ===== HOW IT WORKS ===== */
.features-section {
  padding: 64px 24px;
  background: var(--white);
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-sub {
  text-align: center;
  color: var(--gray-600);
  font-size: 1rem;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(37,99,235,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 16px;
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ===== REPORT PAGE ===== */
.report-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.report-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.report-header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.report-address {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.zone-badge-large {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--blue);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  min-width: 80px;
}

.zone-badge-large .zone-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-top: 4px;
}

.demo-badge {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.4);
  color: #d97706;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===== REPORT SECTIONS ===== */
.report-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
}

.report-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.report-card-full {
  grid-column: 1 / -1;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--blue);
  border-radius: 2px;
}

/* Development Standards */
.standards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.standard-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.standard-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.standard-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.standard-unit {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gray-600);
}

/* Permitted Uses */
.uses-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uses-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.uses-list li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 1px;
  flex-shrink: 0;
}

/* Variance Analysis */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.risk-badge.low {
  background: rgba(16,185,129,0.1);
  color: #059669;
  border: 1px solid rgba(16,185,129,0.3);
}

.risk-badge.medium {
  background: rgba(245,158,11,0.1);
  color: #d97706;
  border: 1px solid rgba(245,158,11,0.3);
}

.risk-badge.high {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,0.3);
}

.variance-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variance-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.variance-list li::before {
  content: '⚠';
  color: var(--amber);
  flex-shrink: 0;
}

/* AI Summary */
.ai-summary-box {
  background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(37,99,235,0.02) 100%);
  border: 1px solid rgba(37,99,235,0.15);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 0.95rem;
  color: var(--gray-800);
  line-height: 1.75;
  position: relative;
}

.ai-summary-box::before {
  content: '✦ AI Analysis';
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

/* Notes */
.zone-notes {
  background: var(--gray-50);
  border-left: 3px solid var(--blue);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.6;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Report Actions */
.report-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

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

.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--gray-200);
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(37,99,235,0.04);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  margin-top: auto;
}

.footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}

.footer strong {
  color: var(--white);
}

/* ===== SKELETON LOADER ===== */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .navbar {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 16px 48px;
  }

  .search-btn span {
    display: none;
  }

  .report-header {
    padding: 24px 20px;
    flex-direction: column;
  }

  .report-header-right {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .standards-grid {
    grid-template-columns: 1fr 1fr;
  }
}
