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

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

:root {
  --ink: #0F1E33;
  --slate: #1a2d47;
  --steel: #374151;
  --muted: #6B7280;
  --light: #d1d5db;
  --ghost: #F7F9FC;
  --white: #ffffff;
  --pulse: #1F6FEB;
  --pulse-dim: #1557c7;
  --pulse-glow: rgba(31, 111, 235, 0.15);
  --green: #21C55D;
  --green-glow: rgba(33, 197, 93, 0.15);
  --amber: #f59e0b;
  --red: #ef4444;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--ink);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.5rem 2.5rem;
  background: rgba(15, 30, 51, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
nav .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--white);
}
.logo img {
  height: 64px;
  width: auto;
  display: block;
}
.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pulse);
  box-shadow: 0 0 12px var(--pulse);
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--pulse); opacity: 1; }
  50% { box-shadow: 0 0 20px var(--pulse); opacity: 0.8; }
}
.nav-link {
  color: var(--light);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  transition: all 0.3s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover {
  border-color: var(--pulse);
  color: var(--pulse);
}

/* MAIN CONTAINER */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

/* PAGE HEADER */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
}
.page-header .eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--pulse);
  margin-bottom: 1rem;
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -1px;
  margin-bottom: 1rem;
}
.page-header p {
  font-size: 1.1rem;
  color: var(--light);
  max-width: 600px;
  margin: 0 auto;
}

/* FORM STYLES */
.form-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2rem;
}
.form-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--pulse);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--light);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.form-group label .required {
  color: var(--red);
  margin-left: 2px;
}
.form-group .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--white);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.3s;
  min-height: 44px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--pulse);
  box-shadow: 0 0 0 3px var(--pulse-glow);
}
input::placeholder, textarea::placeholder {
  color: var(--muted);
}
textarea {
  resize: vertical;
  min-height: 80px;
}
select {
  cursor: pointer;
}
select option {
  background: var(--slate);
  color: var(--white);
}

/* CHECKBOX GROUP (verticals) */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.checkbox-item:hover {
  border-color: rgba(31, 111, 235, 0.3);
  background: rgba(31, 111, 235, 0.04);
}
.checkbox-item.selected {
  border-color: var(--pulse);
  background: rgba(31, 111, 235, 0.08);
}
.checkbox-item input[type="checkbox"] {
  display: none;
}
.checkbox-item .check-box {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.checkbox-item.selected .check-box {
  background: var(--pulse);
  border-color: var(--pulse);
}
.checkbox-item.selected .check-box::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}
.checkbox-item .vert-icon {
  font-size: 1.2rem;
}
.checkbox-item .vert-label {
  font-size: 0.9rem;
  font-weight: 500;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  min-height: 44px;
}
.btn-primary {
  background: var(--pulse);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--pulse-dim);
  box-shadow: 0 0 20px var(--pulse-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}
.btn-block {
  width: 100%;
}

/* REPORT PAGE */
.snapshot-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.snapshot-header .territory-name {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}
.snapshot-header .territory-meta {
  color: var(--muted);
  font-size: 0.95rem;
}
.snapshot-header .territory-meta span {
  color: var(--light);
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
}
.stat-item .stat-num {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--pulse);
}
.stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* VERTICAL SECTIONS */
.vertical-section {
  margin-bottom: 2.5rem;
}
.vertical-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.vertical-header .vert-icon {
  font-size: 1.5rem;
}
.vertical-header h2 {
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}
.vertical-header .count-badge {
  background: rgba(31, 111, 235, 0.1);
  color: var(--pulse);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  margin-left: auto;
}

/* PROSPECT CARDS */
.prospect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.prospect-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.3s;
}
.prospect-card:hover {
  border-color: rgba(31, 111, 235, 0.2);
}
.prospect-card .biz-name {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.prospect-card .biz-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prospect-card .biz-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.prospect-card .detail-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--light);
}
.prospect-card .detail-row .icon {
  width: 16px;
  text-align: center;
  color: var(--muted);
  flex-shrink: 0;
}
.prospect-card .detail-row a {
  color: var(--pulse);
  text-decoration: none;
}
.prospect-card .detail-row a:hover {
  text-decoration: underline;
}
.prospect-card .biz-rating {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--amber);
}

/* GENERATING STATE */
.generating-state {
  text-align: center;
  padding: 4rem 2rem;
}
.generating-state .spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(31, 111, 235, 0.15);
  border-top-color: var(--pulse);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.generating-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.generating-state p {
  color: var(--muted);
  font-size: 1rem;
}
.progress-bar {
  width: 300px;
  max-width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  margin: 1.5rem auto 0;
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  background: var(--pulse);
  border-radius: 3px;
  transition: width 0.5s;
  animation: progress-shimmer 2s ease-in-out infinite;
}
@keyframes progress-shimmer {
  0% { width: 10%; }
  50% { width: 70%; }
  100% { width: 10%; }
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ERROR STATE */
.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* SUCCESS MSG */
.success-msg {
  background: rgba(33, 197, 93, 0.1);
  border: 1px solid rgba(33, 197, 93, 0.2);
  color: #86efac;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* FOOTER */
footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4rem;
}

/* RESPONSIVE - MOBILE FIRST */
@media (max-width: 768px) {
  .container, .container-wide { padding: 6rem 1.25rem 3rem; }
  .form-card { padding: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .prospect-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 1.5rem; }
  nav { padding: 1rem 1.5rem; }
  .logo img { height: 48px; }
}

@media (max-width: 480px) {
  .stats-row { flex-direction: column; gap: 1rem; }
}
