/* ============================================================
   Think Orion / Vala - Shared Design System
   ============================================================
   Import this in any tool:
     <link rel="stylesheet" href="/shared/brand.css">
     <link rel="icon" type="image/svg+xml" href="/shared/favicon.svg">
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Brand Purple */
  --primary: #7C3AED;
  --primary-light: #8B5CF6;
  --primary-dark: #6D28D9;
  --primary-50: rgba(124, 58, 237, 0.05);
  --primary-100: rgba(124, 58, 237, 0.1);
  --primary-200: rgba(124, 58, 237, 0.2);

  /* Status Colors */
  --green: #10B981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --green-text: #047857;
  --yellow: #F59E0B;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --yellow-text: #B45309;
  --red: #EF4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --red-text: #DC2626;

  /* Neutrals */
  --bg: #F8F9FB;
  --bg-white: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --text: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Spacing & Radius */
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(30, 41, 59, 0.05);
  --shadow: 0 2px 8px -2px rgba(30, 41, 59, 0.08), 0 4px 16px -4px rgba(30, 41, 59, 0.06);
  --shadow-lg: 0 8px 30px -4px rgba(30, 41, 59, 0.1), 0 4px 10px -2px rgba(30, 41, 59, 0.05);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Motion */
  --transition: 200ms ease;
  --transition-slow: 400ms ease;
}


/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

#app { min-height: 100vh; }


/* ── Screen System ─────────────────────────────────────────── */
.screen { min-height: 100vh; }
.screen.hidden { display: none; }
.hidden { display: none !important; }


/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm), 0 0 0 0 rgba(124, 58, 237, 0);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow), var(--shadow-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--primary-50); color: var(--primary); }

.btn-lg { padding: 0.875rem 2rem; font-size: 1.0625rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn-block { width: 100%; justify-content: center; }


/* ── Form Inputs ───────────────────────────────────────────── */
.form-input {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}
.form-input::placeholder { color: var(--text-muted); }

/* ── Select Dropdowns ─────────────────────────────────────── */
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 12px 8px;
  cursor: pointer;
  min-height: 2.75rem;
  line-height: 1.4;
}

select.form-input:focus {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237C3AED' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Unselected / placeholder state */
select.form-input:invalid,
select.form-input.placeholder {
  color: var(--text-muted);
}

select.form-input option {
  color: var(--text);
  background: var(--bg-white);
  padding: 0.5rem;
}

select.form-input option[value=""] {
  color: var(--text-muted);
}


/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.card-header { margin-bottom: 1.5rem; }
.card-title { font-size: 1.125rem; font-weight: 700; }
.card-title-row { display: flex; align-items: center; gap: 0.5rem; }
.card-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }


/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-50);
  color: var(--primary);
  border: 1px solid var(--primary-100);
}

.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow-text); }
.badge-red { background: var(--red-bg); color: var(--red-text); }


/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}


/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s ease;
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  position: relative;
  animation: modalSlideUp 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--border-light); color: var(--text); }

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}


/* ── Gated Content Overlay ─────────────────────────────────── */
.gated-card { position: relative; min-height: 280px; }

.gated-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 2rem;
}

.gated-cta {
  text-align: center;
  max-width: 380px;
}

.gated-cta-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.gated-cta-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.gated-card.unlocked .gated-overlay { display: none; }


/* ── Loading Shimmer ───────────────────────────────────────── */
.shimmer-line {
  height: 14px;
  background: linear-gradient(90deg, var(--border-light) 25%, #e2e5ea 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.5s ease-in-out infinite;
}


/* ── CTA Card ──────────────────────────────────────────────── */
.cta-card {
  text-align: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.04) 0%, rgba(168, 85, 247, 0.04) 100%);
  border-color: var(--primary-100);
}

.cta-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}


/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes analyzeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


/* ── Responsive Base ───────────────────────────────────────── */
@media (max-width: 768px) {
  .btn-lg { padding: 0.75rem 1.5rem; font-size: 0.9375rem; }

  .card { padding: 1.25rem; }
  .card-title { font-size: 1rem; }

  .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
  }

  select.form-input {
    min-height: 3rem;
    padding-right: 2.25rem;
    background-position: right 0.75rem center;
    font-size: 1rem;
  }

  .modal-card { padding: 1.5rem; }
  .modal-title { font-size: 1.0625rem; }
  .modal-desc { font-size: 0.8125rem; }

  .gated-overlay { padding: 1.25rem; }
  .gated-cta { max-width: 100%; }
  .gated-cta-title { font-size: 0.9375rem; }
  .gated-cta-desc { font-size: 0.8125rem; line-height: 1.4; }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .cta-buttons .btn { justify-content: center; }
}
