/* ═══════════════════════════════════════════════════════════════
   Calculateur Salaire Net Québec — Thème Clair Premium
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:         #f0f4f9;
  --surface:    #ffffff;
  --surface2:   #f5f7fb;
  --surface3:   #eef1f7;
  --border:     rgba(0, 0, 0, 0.08);
  --border-md:  rgba(0, 0, 0, 0.12);
  --text:       #111827;
  --text-2:     #374151;
  --muted:      #6b7280;
  --accent:     #0ea5e9;
  --accent-dk:  #0284c7;
  --accent-bg:  rgba(14, 165, 233, 0.08);
  --green:      #10b981;
  --green-bg:   rgba(16, 185, 129, 0.08);
  --purple:     #8b5cf6;
  --red:        #ef4444;
  --yellow:     #f59e0b;
  --orange:     #f97316;
  --radius:     14px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --transition: 0.18s ease;
}

/* ─── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

/* ─── EN-TÊTE ───────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.logo-text {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

/* ─── NAVIGATION ────────────────────────────────────────────── */
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}

/* ─── HERO ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #e0f2fe 0%, #f0f9ff 40%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 20px 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 640px;
  margin: 0 auto 12px;
  color: var(--text);
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.badge-annee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.03em;
}

/* ─── LAYOUT PRINCIPAL ──────────────────────────────────────── */
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

/* ─── CARTE ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 18px;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}

.input-group {
  display: flex;
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--surface);
}

.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}

.input-prefix {
  padding: 0 14px;
  display: flex;
  align-items: center;
  background: var(--surface2);
  border-right: 1.5px solid var(--border-md);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  user-select: none;
  flex-shrink: 0;
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  padding: 13px 15px;
  min-width: 0;
}

.input-group input::placeholder { color: #d1d5db; }

select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 12px 40px 12px 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}

/* Toggle type d'emploi */
.toggle-emploi { display: flex; gap: 8px; }

.toggle-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-md);
  background: var(--surface2);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
}

.toggle-btn.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent-dk);
}

/* ─── RÉSULTAT PRINCIPAL ────────────────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
}

.result-hero .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

.result-hero .montant {
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 800;
  color: var(--accent-dk);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.result-hero .sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Grid 4 périodes */
.periodes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.periode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.periode-card .plabel {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 5px;
}

.periode-card .pval {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.periode-card.accent .pval { color: var(--red); }

/* ─── DONUT ─────────────────────────────────────────────────── */
.donut-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#donut { flex-shrink: 0; }

.donut-legende {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legende-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.legende-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legende-label { color: var(--muted); flex: 1; }
.legende-val   { font-weight: 700; color: var(--text); font-size: 0.78rem; }

/* ─── DÉDUCTIONS ────────────────────────────────────────────── */
.deductions-list { display: flex; flex-direction: column; gap: 10px; }

.ded-item { display: flex; flex-direction: column; gap: 4px; }

.ded-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ded-label { font-size: 0.82rem; color: var(--text-2); font-weight: 500; }
.ded-val   { font-size: 0.88rem; font-weight: 700; color: var(--text); white-space: nowrap; }

.progress-bar {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.ded-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  margin-top: 4px;
  border-top: 1.5px solid var(--border-md);
}

.ded-total-label { color: var(--text-2); font-size: 0.85rem; font-weight: 600; }
.ded-total-val   { color: var(--red); font-size: 0.95rem; font-weight: 700; }

/* Taux effectif badge */
.taux-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 16px;
}

/* ─── INFO BOX ──────────────────────────────────────────────── */
.info-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 20px;
  font-size: 0.81rem;
  color: #475569;
  line-height: 1.65;
}

.info-box strong { color: var(--accent-dk); }

/* ─── OUTILS ANNEXES ────────────────────────────────────────── */
.tools-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 20px 64px;
}

.tools-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tool-info h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.tool-info p  { font-size: 0.76rem; color: var(--muted); }

/* ─── PIED DE PAGE ──────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.7;
}

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

/* ─── RESPONSIVE ────────────────────────────────────────────── */

/* Tablette (≤ 860px) */
@media (max-width: 860px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
  .hero { padding: 32px 16px 28px; }
  .hero h1 { font-size: 1.5rem; }
  
  .main-container { padding: 16px 14px 48px; gap: 14px; }
  
  .card { padding: 18px; }
  
  .header-inner { height: auto; padding: 10px 0; gap: 6px; }
  .nav-links a  { font-size: 0.8rem; padding: 5px 9px; }
  
  .periodes-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .periode-card  { padding: 11px; }
  .periode-card .pval { font-size: 0.95rem; }
  
  .donut-section { flex-direction: column; align-items: flex-start; }
  #donut { align-self: center; }
  
  .result-hero .montant { font-size: 1.9rem; }

  .toggle-btn { font-size: 0.78rem; padding: 9px 6px; }
  
  .tools-grid { grid-template-columns: 1fr; }
}

/* Très petit mobile (≤ 370px) */
@media (max-width: 370px) {
  .periodes-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.35rem; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 4px 7px; }
}

/* ─── EMPLACEMENTS PUBLICITAIRES (ADS) ────────────────────────── */
.ad-slot {
  background: var(--surface2);
  border: 1px dashed var(--border-md);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  margin: 20px auto;
  position: relative;
  overflow: hidden;
}
.ad-slot::before {
  content: "Emplacement Publicitaire";
  position: absolute;
  opacity: 0.6;
}

/* Bannière principale (souvent en haut) - typiquement 728x90 sur desktop */
.ad-banner {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

/* Bannière inline dans le contenu - typiquement rectangle ou responsive */
.ad-inline {
  width: 100%;
  min-height: 250px;
}

/* Emplacement Vidéo */
.ad-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
  color: #9ca3af;
  border: none;
}
.ad-video::before {
  content: "▶ Publicité Vidéo";
}

@media (max-width: 768px) {
  .ad-banner {
    max-width: 320px;
    height: 100px;
  }
}

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

.card, .result-hero, .periodes-grid {
  animation: fadeInUp 0.35s ease both;
}
