/* ===================================================
   Sparkfund Site Evaluator — Stylesheet
   =================================================== */

:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --red-500: #ef4444;
  --red-100: #fee2e2;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --header-h: 60px;
  --nav-h: 48px;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===================================================
   Screens
   =================================================== */
.screen { display: none; }
.screen.active { display: block; }
.screen.inactive { display: none; }
.flex-screen.active { display: flex; }
.flex-screen.inactive { display: none; }

/* ===================================================
   Auth Screen
   =================================================== */
#auth-screen {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 50%, #34d399 100%);
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.auth-subtitle {
  color: var(--gray-500);
  font-size: 0.93rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.auth-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 16px;
}

/* ===================================================
   Brand
   =================================================== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--green-600);
  border-radius: var(--radius-md);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--gray-300);
}

.brand-app {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-500);
}

/* ===================================================
   Buttons
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--green-600);
  color: #fff;
  box-shadow: 0 1px 4px rgba(22,163,74,.3);
}
.btn-primary:hover:not(:disabled) { background: var(--green-700); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); }

.btn-google {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  width: 100%;
  padding: 13px 20px;
  font-size: 1rem;
}
.btn-google:hover { background: var(--gray-50); box-shadow: var(--shadow-md); }

.link-btn {
  background: none;
  border: none;
  color: var(--green-600);
  cursor: pointer;
  font-family: var(--font);
  font-size: inherit;
  text-decoration: underline;
  padding: 0;
}

/* ===================================================
   App Header
   =================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  height: var(--header-h);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-inner .brand {
  margin-bottom: 0;
  justify-content: flex-start;
}

.header-inner .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-200);
}

.user-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-600);
}

/* ===================================================
   Nav Tabs
   =================================================== */
.app-nav {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  height: var(--nav-h);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: 4px;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.nav-tab:hover { color: var(--gray-800); }
.nav-tab.active {
  color: var(--green-600);
  border-bottom-color: var(--green-600);
}

/* ===================================================
   Tab Panels
   =================================================== */
.tab-panel { display: none; padding: 32px 0 64px; }
.tab-panel.active { display: block; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.panel-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* ===================================================
   Evaluations List
   =================================================== */
.evaluations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  color: var(--gray-400);
  text-align: center;
}

.eval-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  align-items: start;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.eval-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.eval-card-main h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.eval-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.83rem;
  color: var(--gray-500);
}

.eval-card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* ===================================================
   Badges
   =================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: capitalize;
}

.badge-hot    { background: #fee2e2; color: #b91c1c; }
.badge-warm   { background: #fef3c7; color: #92400e; }
.badge-cold   { background: var(--blue-100); color: #1d4ed8; }
.badge-not_interested { background: var(--gray-100); color: var(--gray-600); }
.badge-draft  { background: var(--gray-100); color: var(--gray-600); }
.badge-submitted { background: var(--green-100); color: var(--green-700); }
.badge-reviewed  { background: var(--blue-100); color: #1d4ed8; }

/* ===================================================
   Form
   =================================================== */
.form-section {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group.form-group--sm { max-width: 140px; }
.form-group.form-group--checkbox { justify-content: flex-end; }

label {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--gray-700);
}

.required { color: var(--red-500); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

input.invalid, select.invalid, textarea.invalid {
  border-color: var(--red-500);
}

textarea { resize: vertical; min-height: 80px; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--gray-700);
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--green-600);
}

/* ===================================================
   Photo Upload
   =================================================== */
.photo-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--gray-500);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
  border-color: var(--green-500);
  background: var(--green-50);
}

.upload-hint { font-size: 0.8rem; color: var(--gray-400); }

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.photo-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-item.uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.6);
}

.photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

/* ===================================================
   Form Actions
   =================================================== */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* ===================================================
   Toast
   =================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-success { background: var(--green-700); }
.toast.toast-error   { background: #b91c1c; }

/* ===================================================
   Modal
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  background: #fff;
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
}

.modal-close:hover { background: var(--gray-100); }

/* Modal content styles */
.modal-header { margin-bottom: 24px; }
.modal-header h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.modal-header .modal-meta { font-size: 0.85rem; color: var(--gray-500); }

.modal-section { margin-bottom: 20px; }
.modal-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--gray-400);
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-label { font-size: 0.8rem; color: var(--gray-500); }
.detail-value { font-size: 0.9rem; font-weight: 500; color: var(--gray-800); }

.modal-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.modal-photo {
  width: 120px;
  height: 90px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--gray-200);
  cursor: pointer;
}

/* ===================================================
   Loading Spinner
   =================================================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

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

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group.form-group--sm { max-width: 100%; }
  .auth-card { padding: 36px 24px; }
  .eval-card { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0 16px; }
  .user-name { display: none; }
}
