/* ─── FormCrit Shared Styles ─────────────────────────────── */
/* Design tokens match landing page */

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

:root {
  --ink: #1a1a1a;
  --paper: #f7f5f0;
  --accent: #c44b2b;
  --accent-light: #e8634a;
  --accent-hover: #b03d20;
  --muted: #8a8578;
  --line: #d4d0c8;
  --warm-white: #fdfcf9;
  --success: #2d8a4e;
  --success-bg: #e8f5ec;
  --warning: #c48a2b;
  --warning-bg: #faf3e0;
  --error: #c44b2b;
  --error-bg: #fde8e4;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Nav ─────────────────────────────────────────────── */
.app-nav {
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.app-nav .logo span { color: var(--accent); }

.app-nav .nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.app-nav .nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.app-nav .nav-links a:hover { color: var(--ink); }

/* ─── Page Container ─────────────────────────────────── */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.page-container.wide {
  max-width: 1100px;
}

.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 48ch;
}

/* ─── Forms ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.form-group .hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  background: var(--warm-white);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 75, 43, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 75, 43, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--warm-white);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--paper);
  border-color: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  background: rgba(196, 75, 43, 0.05);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

/* ─── Image Upload ───────────────────────────────────── */
.image-upload-area {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--warm-white);
}

.image-upload-area:hover {
  border-color: var(--accent);
  background: rgba(196, 75, 43, 0.02);
}

.image-upload-area.dragover {
  border-color: var(--accent);
  background: rgba(196, 75, 43, 0.05);
}

.image-upload-area p {
  color: var(--muted);
  font-size: 0.95rem;
}

.image-upload-area .upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.image-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.image-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

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

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

/* ─── Status Badges ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-in_review, .badge-in-review {
  background: #e0eeff;
  color: #2b6bc4;
}

.badge-completed {
  background: var(--success-bg);
  color: var(--success);
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.card-clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

/* ─── Score Display ──────────────────────────────────── */
.score-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
  flex-shrink: 0;
}

.score-low { background: var(--error); }
.score-mid { background: var(--warning); }
.score-high { background: var(--success); }

.score-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ─── Review Sections ────────────────────────────────── */
.review-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.review-section:last-child {
  border-bottom: none;
}

.review-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.review-section-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.review-section p {
  color: #4a4a4a;
  line-height: 1.7;
}

/* ─── Priority List ──────────────────────────────────── */
.priority-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.priority-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.priority-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.priority-content h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.priority-content p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ─── Tables ─────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--line);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.data-table tr:hover td {
  background: rgba(196, 75, 43, 0.02);
}

.data-table tr {
  cursor: pointer;
}

/* ─── Filter Tabs ────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--warm-white);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-tab .count {
  margin-left: 0.3rem;
  opacity: 0.7;
}

/* ─── Alerts ─────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(45, 138, 78, 0.2);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(196, 75, 43, 0.2);
}

.alert-info {
  background: #e0eeff;
  color: #2b6bc4;
  border: 1px solid rgba(43, 107, 196, 0.2);
}

/* ─── Loading ────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ─── Admin Login ────────────────────────────────────── */
.login-box {
  max-width: 400px;
  margin: 4rem auto;
  text-align: center;
}

.login-box h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ─── Score Input ────────────────────────────────────── */
.score-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.score-input {
  width: 70px !important;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem !important;
}

.score-label {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ─── Footer ─────────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--line);
  padding: 2rem;
  text-align: center;
}

.app-footer p {
  font-size: 0.8rem;
  color: var(--muted);
}

.app-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .page-container {
    padding: 2rem 1.5rem 4rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .data-table {
    font-size: 0.85rem;
  }

  .data-table th, .data-table td {
    padding: 0.75rem 0.5rem;
  }

  .review-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-nav {
    padding: 1rem 1.5rem;
  }

  .app-nav .nav-links {
    gap: 1rem;
  }
}

/* ─── Utility ────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }
