/* ============================================
   SNAPVALIDATE.APP — Global Styles v1.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --ink: #0f0e0d;
  --paper: #f5f2ed;
  --cream: #ede9e2;
  --sage: #4a7c6f;
  --sage-light: #e8f0ee;
  --sage-dark: #3d6b5f;
  --amber: #d47c2f;
  --amber-light: #fdf3e7;
  --red-soft: #c0392b;
  --red-light: #fdf0ee;
  --border: #d8d3cb;
  --muted: #8a8680;
  --white: #ffffff;
  --score-strong: #2d6a4f;
  --score-moderate: #d4a017;
  --score-weak: #c0392b;
  --font-serif: 'DM Serif Display', serif;
  --font-mono: 'DM Mono', monospace;
  --font-sans: 'DM Sans', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.10);
  --transition: 0.15s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; }
h1 { font-size: clamp(32px, 5vw, 52px); }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 20px; }
p { line-height: 1.6; }
a { color: var(--sage); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAVBAR ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.navbar-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
}

.navbar-logo span { color: var(--sage); }

.navbar-links { display: flex; gap: 8px; align-items: center; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: #2a2926; text-decoration: none; }

.btn-sage { background: var(--sage); color: white; }
.btn-sage:hover:not(:disabled) { background: var(--sage-dark); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); text-decoration: none; }

.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--ink); text-decoration: none; }

.btn-danger { background: var(--red-soft); color: white; }
.btn-danger:hover:not(:disabled) { background: #a93226; text-decoration: none; }

.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 10px; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; }

.btn-loading { opacity: 0.7; pointer-events: none; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--ink);
}

.form-sublabel {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.form-input:focus { border-color: var(--sage); background: var(--white); }
.form-input::placeholder { color: var(--muted); }
.form-input.error { border-color: var(--red-soft); }

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

.form-error {
  font-size: 12px;
  color: var(--red-soft);
  margin-top: 5px;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-hover {
  transition: all var(--transition);
  cursor: pointer;
}

.card-hover:hover {
  border-color: var(--sage);
  box-shadow: 0 2px 12px rgba(74,124,111,0.1);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-problem { background: var(--sage-light); color: var(--sage); }
.badge-solution { background: var(--amber-light); color: var(--amber); }
.badge-messaging { background: #f0f0ff; color: #5555cc; }
.badge-strong { background: #e8f5ee; color: var(--score-strong); }
.badge-moderate { background: #fef9e7; color: var(--score-moderate); }
.badge-weak { background: #fdeeee; color: var(--score-weak); }
.badge-active { background: var(--sage-light); color: var(--sage); }
.badge-closed { background: var(--cream); color: var(--muted); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-error { background: var(--red-light); color: var(--red-soft); border: 1px solid #f5c6c2; }
.alert-success { background: var(--sage-light); color: var(--score-strong); border: 1px solid #c3dfd8; }
.alert-info { background: var(--amber-light); color: var(--amber); border: 1px solid #f5dfc0; }

/* ── TOGGLE ── */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
  border: none;
  outline: none;
}

.toggle.on { background: var(--sage); }

.toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left var(--transition);
}

.toggle.on::after { left: 21px; }

/* ── LOADING SPINNER ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* ── LAYOUT UTILITIES ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 820px; margin: 0 auto; padding: 0 24px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-muted { color: var(--muted); }
.text-sage { color: var(--sage); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; font-family: var(--font-mono); }
.text-center { text-align: center; }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── PAGE WRAPPER ── */
.page { min-height: calc(100vh - 61px); }
.page-content { padding: 40px 0; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,14,13,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-bottom: 8px;
}

/* ── SIDEBAR LAYOUT ── */
.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 61px);
}

.sidebar {
  background: var(--ink);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 61px;
  height: calc(100vh - 61px);
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: rgba(245,242,237,0.55);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

.sidebar-item:hover, .sidebar-item.active {
  background: rgba(255,255,255,0.08);
  color: var(--paper);
  text-decoration: none;
}

.sidebar-icon { font-size: 15px; flex-shrink: 0; }

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 0;
}

.sidebar-bottom { margin-top: auto; }

.main-area { padding: 36px 40px; }

/* ── STEP INDICATOR ── */
.steps {
  display: flex;
  margin-bottom: 40px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin: 0 auto 8px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.step.active .step-num { background: var(--ink); color: white; border-color: var(--ink); }
.step.done .step-num { background: var(--sage); color: white; border-color: var(--sage); }

.step-label { font-size: 11px; color: var(--muted); letter-spacing: 0.3px; }
.step.active .step-label { color: var(--ink); font-weight: 500; }
.step.done .step-label { color: var(--sage); }

/* ── SCORE DISPLAY ── */
.score-number-big {
  font-family: var(--font-serif);
  font-size: 64px;
  line-height: 1;
}

.score-strong { color: var(--score-strong); }
.score-moderate { color: var(--score-moderate); }
.score-weak { color: var(--score-weak); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .navbar { padding: 16px 20px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-area { padding: 24px 20px; }
}
