/* Calculateur.tools — ENKI Suite — Palette Verte */
:root {
  --primary: #065F46;
  --primary-light: #059669;
  --accent: #10B981;
  --accent-light: #ECFDF5;
  --white: #FFFFFF;
  --text: #1E293B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --bg: #F8FAFC;
  --radius: 14px;
  --shadow-lg: 0 4px 16px rgba(16,185,129,.12);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1100px;
}

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

html { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
  background: linear-gradient(135deg, #065F46 0%, #059669 100%);
  color: white;
  padding: 48px 0 40px;
  text-align: center;
  position: relative;
}
.header-top {
  position: absolute;
  top: 12px;
  right: 20px;
}
.header-top .lang-box { position: relative; }
.header-top .lang-btn {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  cursor: pointer;
  font-size: .8rem;
  color: white;
  font-family: inherit;
}
.header-top .lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  min-width: 190px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
}
.header-top .lang-menu.show { display: block; }
.header-top .lang-menu a {
  display: block;
  padding: 7px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: .85rem;
}
.header-top .lang-menu a:hover { background: var(--bg); }
.header-top .lang-menu a.current { font-weight: 600; background: #D1FAE5; }
.site-title a {
  font-size: 2.2rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.site-title a:hover { opacity: 0.85; }
.header p {
  font-size: 1rem;
  opacity: .85;
  max-width: 600px;
  margin: 0 auto;
}
.header .search {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 10px 16px;
  width: 400px;
  max-width: 90%;
  gap: 8px;
}
.header .search input {
  background: none;
  border: none;
  color: white;
  font-size: .9rem;
  width: 100%;
  outline: none;
  font-family: inherit;
}
.header .search input::placeholder { color: rgba(255,255,255,.5); }

/* Filter bar */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  flex-wrap: wrap;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.filter-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  color: #64748B;
  transition: all .15s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}
.filter-btn:hover { background: #F1F5F9; color: var(--text); }
.filter-btn.active {
  background: #D1FAE5;
  color: var(--primary);
  font-weight: 600;
}

/* Content */
.content { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  text-decoration: none;
  transition: all .15s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.card-body h3 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.card-body p {
  font-size: .78rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-light);
  font-size: .8rem;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-about { font-size: .85rem; }
.footer-links { display: flex; justify-content: center; gap: 8px; font-size: .85rem; }
.footer-links a { color: var(--primary); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links .sep { color: var(--border); }
.footer-copy { font-size: .75rem; opacity: .7; }

/* Tool page */
.tool-section { padding: 40px 0; }
.tool-section .container { max-width: 900px; }
.breadcrumb {
  font-size: .85rem;
  color: var(--text-light);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: var(--border); }
.tool-section h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.tool-desc {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 32px;
  max-width: 700px;
}

/* Tool interface */
.tool-interface {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 40px;
}
.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-end;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.control-group label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
}
.control-group input[type="number"],
.control-group input[type="text"],
.control-group select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  font-family: var(--font-body);
  min-width: 80px;
}
.control-group input[type="range"] { width: 160px; }
.checkbox-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .85rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, opacity .2s;
  font-family: var(--font-body);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { background: var(--bg); }

.tool-result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.tool-result output {
  display: block;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font-size: .95rem;
  line-height: 1.6;
  min-height: 60px;
  word-break: break-all;
  margin-bottom: 12px;
}
.tool-result .btn-group { display: flex; gap: 8px; }

/* Howto & FAQ */
.howto, .faq { margin-bottom: 40px; }
.howto h2, .faq h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}
.howto p { color: var(--text-light); line-height: 1.7; }
details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
details summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: .95rem;
  background: white;
  transition: background .2s;
}
details summary:hover { background: var(--bg); }
details[open] summary { border-bottom: 1px solid var(--border); }
details p { padding: 14px 16px; color: var(--text-light); font-size: .9rem; line-height: 1.6; }

/* Related */
.related { margin-bottom: 40px; }
.related h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .header h1 { font-size: 1.6rem; }
  .header p { font-size: .9rem; }
  .tool-section h1 { font-size: 1.5rem; }
  .tool-interface { padding: 20px; }
  .tool-controls { flex-direction: column; }
  .filter-btn { font-size: .78rem; padding: 6px 12px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .header { padding: 32px 0 28px; }
  .header h1 { font-size: 1.4rem; }
}