/* ═══════════════════════════════════════════════════════
   Nuance Paris — Tools Design System V1
   Shared CSS for all /tools/ pages
   ═══════════════════════════════════════════════════════ */

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

:root {
  --coral: #E63B5A;
  --coral-light: #F06580;
  --coral-bg: #FFF0F3;
  --coral-glow: rgba(230, 59, 90, 0.08);
  --green: #22C55E;
  --green-bg: #F0FDF4;
  --amber: #F59E0B;
  --amber-bg: #FFFBEB;
  --red: #EF4444;
  --red-bg: #FEF2F2;
  --blue: #3B82F6;
  --blue-bg: #EFF6FF;
  --stone-900: #1C1917;
  --stone-800: #292524;
  --stone-700: #44403C;
  --stone-600: #57534E;
  --stone-500: #78716C;
  --stone-400: #A8A29E;
  --stone-300: #D6D3D1;
  --stone-200: #E7E5E4;
  --stone-100: #F5F5F4;
  --stone-50: #FAFAF9;
  --bg: #FFF8F6;
  --surface: #FFFFFF;
  --card-shadow: 0 2px 20px rgba(230, 59, 90, 0.04);
  --card-border: 1px solid rgba(230, 59, 90, 0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --stone-50: #1C1917;
    --stone-100: #292524;
    --stone-200: #3D3835;
    --stone-300: #57534E;
    --stone-400: #78716C;
    --stone-500: #A8A29E;
    --stone-600: #D6D3D1;
    --stone-700: #E7E5E4;
    --stone-800: #F5F5F4;
    --stone-900: #FAFAF9;
    --bg: #1C1917;
    --surface: #292524;
    --coral-bg: rgba(230, 59, 90, 0.15);
    --coral-glow: rgba(230, 59, 90, 0.2);
    --green-bg: rgba(34, 197, 94, 0.12);
    --amber-bg: rgba(245, 158, 11, 0.12);
    --red-bg: rgba(239, 68, 68, 0.12);
    --blue-bg: rgba(59, 130, 246, 0.12);
    --card-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    --card-border: 1px solid rgba(255, 255, 255, 0.06);
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--stone-900);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Top bar ── */
.tool-topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 59, 90, 0.06);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--stone-900);
}

.topbar-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--stone-500);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.topbar-back:hover { color: var(--coral); }
.topbar-back svg { width: 16px; height: 16px; }

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--coral-light));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Page layout ── */
.tool-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.tool-page.narrow { max-width: 600px; }
.tool-page.wide { max-width: 960px; }

/* ── Tool header ── */
.tool-header {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease forwards;
}

.tool-header .tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--coral-bg);
  color: var(--coral);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.tool-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--stone-900);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tool-header p {
  font-size: 15px;
  color: var(--stone-500);
  font-weight: 300;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Cards ── */
.tool-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }

.card-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--stone-400);
  margin-bottom: 16px;
}

/* ── Search input ── */
.search-wrapper {
  position: relative;
  margin-bottom: 24px;
}

.search-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--stone-400);
}

.search-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--stone-900);
  background: var(--stone-50);
  transition: all 0.25s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--coral);
  background: #fff;
  box-shadow: 0 0 0 3px var(--coral-glow);
}

.search-input::placeholder { color: var(--stone-300); }

/* ── Select / Dropdown ── */
.tool-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--stone-900);
  background: var(--stone-50);
  cursor: pointer;
  outline: none;
  appearance: none;
  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='%23A8A29E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: all 0.25s ease;
}

.tool-select:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-glow);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  text-decoration: none;
}

.btn-coral {
  background: var(--coral);
  color: #fff;
}

.btn-coral:hover {
  background: #D42E4C;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(230, 59, 90, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--stone-200);
  color: var(--stone-800);
}

.btn-outline:hover {
  border-color: var(--stone-300);
  background: var(--stone-50);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 12px;
}

.btn-full { width: 100%; }

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

/* ── Compatibility badges ── */
.compat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.compat-ok { background: var(--green-bg); color: #16A34A; }
.compat-warn { background: var(--amber-bg); color: #D97706; }
.compat-stop { background: #FFF7ED; color: #EA580C; }
.compat-danger { background: var(--red-bg); color: #DC2626; }

/* ── Tags ── */
.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--stone-100);
  color: var(--stone-600);
}

.tag-coral { background: var(--coral-bg); color: var(--coral); }

/* ── Grid layouts ── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Tool cards (clickable) ── */
.tool-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  background: #fff;
  border: var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: var(--stone-900);
  transition: all 0.25s ease;
  text-align: center;
}

.tool-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(230, 59, 90, 0.08);
  border-color: rgba(230, 59, 90, 0.15);
}

.tool-link-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.tool-link-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 500;
}

.tool-link-card p {
  font-size: 12px;
  color: var(--stone-500);
  line-height: 1.5;
}

.tool-link-tier {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
}

.tier-free { background: var(--green-bg); color: #16A34A; }
.tier-premium { background: var(--coral-bg); color: var(--coral); }

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--stone-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--stone-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 1;
}

.timeline-item.active .timeline-dot {
  border-color: var(--coral);
  background: var(--coral-bg);
}

.timeline-item.completed .timeline-dot {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.timeline-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--stone-900);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 13px;
  color: var(--stone-500);
  line-height: 1.5;
}

/* ── Promo card ── */
.promo-card {
  background: #fff;
  border: var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.promo-card:hover {
  box-shadow: 0 4px 16px rgba(230, 59, 90, 0.06);
}

.promo-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--stone-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.promo-info { flex: 1; }

.promo-brand {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.promo-desc {
  font-size: 12px;
  color: var(--stone-500);
  margin-bottom: 6px;
}

.promo-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--coral-bg);
  color: var(--coral);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.promo-code:hover { background: #FFE4E9; }

.promo-code svg { width: 14px; height: 14px; }

.promo-discount {
  font-size: 18px;
  font-weight: 700;
  color: var(--coral);
  white-space: nowrap;
}

/* ── Quiz steps ── */
.quiz-step { display: none; }
.quiz-step.active { display: block; animation: fadeIn 0.3s ease; }

.quiz-progress {
  height: 3px;
  background: var(--stone-200);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--coral-light));
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--stone-800);
}

.quiz-option:hover {
  border-color: var(--coral);
  background: var(--coral-bg);
}

.quiz-option.selected {
  border-color: var(--coral);
  background: var(--coral-bg);
  color: var(--coral);
  font-weight: 500;
}

.quiz-option-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--stone-300);
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-option.selected .quiz-option-dot {
  border-color: var(--coral);
  background: var(--coral);
}

.quiz-option.selected .quiz-option-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

/* ── Disclaimer ── */
.tool-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--stone-400);
  line-height: 1.6;
  padding: 24px 16px;
  border-top: 1px solid var(--stone-100);
  margin-top: 32px;
}

.tool-disclaimer a { color: var(--coral); text-decoration: none; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--stone-400);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .tool-page { padding: 24px 16px 80px; }
  .tool-header h1 { font-size: 24px; }
  .tool-card { padding: 24px 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tool-topbar { padding: 0 16px; }
  .search-input { padding: 14px 14px 14px 44px; }
}

@media (max-width: 380px) {
  .tool-header h1 { font-size: 22px; }
  .btn { padding: 12px 16px; font-size: 13px; }
}
