/* =============================================
   CALCUL-HEURE.FR — Main Stylesheet
   ============================================= */

:root {
  --blue:       #2563EB;
  --blue-dark:  #1D4ED8;
  --blue-light: #EFF6FF;
  --blue-mid:   #BFDBFE;
  --red:        #EF4444;
  --green:      #10B981;
  --orange:     #F59E0B;
  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-400:   #9CA3AF;
  --gray-600:   #4B5563;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --white:      #FFFFFF;
  --radius:     12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.14);
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── LAYOUT ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ── HEADER ── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.2rem; font-weight: 600; color: var(--gray-900);
  text-decoration: none; flex-shrink: 0;
}
.logo strong { color: var(--blue); }
.logo:hover { text-decoration: none; }

.main-nav {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}

.nav-group { position: relative; }
.nav-group-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  font-size: .9rem; font-weight: 500; color: var(--gray-700);
  padding: 8px 12px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav-group-btn:hover,
.nav-group.open .nav-group-btn { background: var(--blue-light); color: var(--blue); }
.nav-group-btn svg { transition: transform .2s; }
.nav-group.open .nav-group-btn svg { transform: rotate(180deg); }

.nav-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 200px; padding: 6px;
  z-index: 200;
}
.nav-group.open .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block; padding: 8px 12px; border-radius: 6px;
  font-size: .875rem; color: var(--gray-700);
  transition: background .12s, color .12s;
}
.nav-dropdown a:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 6px; margin-left: auto;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--gray-700); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ── HERO / TOOL CARD ── */
.page-hero {
  background: linear-gradient(135deg, var(--blue) 0%, #1E40AF 100%);
  color: var(--white); padding: 56px 0 48px;
}
.page-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; margin-bottom: 10px; }
.page-hero p  { font-size: 1.05rem; opacity: .88; max-width: 560px; }

.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: .8rem; margin-bottom: 16px; opacity: .75;
}
.breadcrumb a { color: var(--white); }
.breadcrumb span { opacity: .6; }

/* ── TOOL CARD ── */
.tool-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 32px;
  margin-top: -32px; position: relative; z-index: 5;
}

.tool-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1px solid var(--gray-200); padding-bottom: 0;
}
.tab-btn {
  padding: 10px 18px; border: none; background: none; cursor: pointer;
  font-size: .9rem; font-weight: 500; color: var(--gray-600);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── FORM ELEMENTS ── */
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 16px;
}
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: .82rem; font-weight: 600; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .04em;
}
.field input, .field select {
  border: 1.5px solid var(--gray-200); border-radius: 8px;
  padding: 12px 14px; font-size: 1rem; font-family: var(--font);
  color: var(--gray-900); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.time-input-group {
  display: flex; align-items: center; gap: 4px;
}
.time-input-group input {
  text-align: center; padding: 12px 6px; border-radius: 8px;
}
.time-input-group input[type="number"] { width: 72px; }
.time-sep { font-size: 1.3rem; font-weight: 700; color: var(--gray-400); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px; border: none;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--green); color: var(--white); }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ── RESULT BOX ── */
.result-box {
  background: var(--blue-light); border: 1.5px solid var(--blue-mid);
  border-radius: var(--radius); padding: 20px 24px;
  margin-top: 24px; display: none;
}
.result-box.show { display: block; }
.result-box .result-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--blue); margin-bottom: 6px;
}
.result-main {
  font-size: 2.2rem; font-weight: 800; color: var(--blue-dark);
  letter-spacing: -.02em; line-height: 1.2;
}
.result-sub {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px;
}
.result-chip {
  background: var(--white); border: 1px solid var(--blue-mid);
  border-radius: 20px; padding: 4px 12px;
  font-size: .875rem; font-weight: 500; color: var(--blue-dark);
}

/* quick answer box */
.quick-answer {
  background: var(--green); color: var(--white);
  border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 24px; font-size: 1.1rem; font-weight: 600;
  display: none;
}
.quick-answer.show { display: block; }

/* ── PRESETS ── */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.preset-btn {
  background: var(--blue-light); border: 1px solid var(--blue-mid);
  border-radius: 20px; padding: 5px 14px;
  font-size: .82rem; font-weight: 500; color: var(--blue);
  cursor: pointer; transition: background .12s;
}
.preset-btn:hover { background: var(--blue-mid); }

/* ── CONTENT SECTIONS ── */
.content-section { padding: 40px 0; }
.content-section + .content-section { padding-top: 0; }

.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.section-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.info-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); padding: 24px;
}
.info-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.info-card p { font-size: .9rem; color: var(--gray-600); }

/* ── EXAMPLES ── */
.examples-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .9rem; }
.examples-table th {
  background: var(--gray-100); padding: 10px 14px;
  text-align: left; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--gray-600);
}
.examples-table td { padding: 10px 14px; border-top: 1px solid var(--gray-100); }
.examples-table tr:hover td { background: var(--blue-light); }

/* ── FAQ ── */
.faq-list { list-style: none; }
.faq-item { border-top: 1px solid var(--gray-200); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none;
  padding: 16px 0; font-size: 1rem; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--gray-900);
}
.faq-q .icon { transition: transform .2s; font-size: 1.2rem; color: var(--blue); }
.faq-item.open .faq-q .icon { transform: rotate(45deg); }
.faq-a { display: none; padding-bottom: 16px; color: var(--gray-600); font-size: .95rem; line-height: 1.7; }
.faq-item.open .faq-a { display: block; }

/* ── RELATED TOOLS ── */
.related-tools { padding: 32px 0; }
.related-tools h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.related-card {
  display: block; background: var(--white);
  border: 1.5px solid var(--gray-200); border-radius: 10px;
  padding: 14px 16px; font-size: .9rem; font-weight: 500;
  color: var(--gray-700); transition: border-color .15s, color .15s, box-shadow .15s;
}
.related-card:hover {
  border-color: var(--blue); color: var(--blue);
  box-shadow: var(--shadow-sm); text-decoration: none;
}

/* ── HOMEPAGE FEATURES ── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
  padding: 40px 0;
}
.feature-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); padding: 24px;
  text-align: center;
  transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--blue-light); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 1.5rem;
}
.feature-card h3 { font-size: 1rem; margin-bottom: 6px; }
.feature-card p { font-size: .85rem; color: var(--gray-600); }
.feature-card a {
  display: inline-block; margin-top: 12px; font-size: .85rem;
  font-weight: 600; color: var(--blue);
}

/* ── TIME INPUTS (visual HH:MM) ── */
.hhmm-input {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid var(--gray-200); border-radius: 8px;
  overflow: hidden; background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.hhmm-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.hhmm-input input {
  border: none !important; border-radius: 0 !important;
  box-shadow: none !important;
  text-align: center; padding: 12px 10px;
  font-size: 1.1rem; font-weight: 600; width: 60px;
}
.hhmm-sep {
  font-size: 1.3rem; font-weight: 700; color: var(--gray-400);
  padding: 0 2px; user-select: none;
}

/* ── DYNAMIC ADD ROWS ── */
.time-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.time-row { display: flex; align-items: center; gap: 10px; }
.time-row .remove-row {
  background: none; border: 1px solid var(--gray-200); border-radius: 6px;
  padding: 4px 8px; cursor: pointer; color: var(--red); font-size: .85rem;
}

/* ── BADGES / CHIPS ── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
}
.badge-blue   { background: var(--blue-light);  color: var(--blue); }
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-orange { background: #FEF3C7; color: #92400E; }

/* ── STAT GRID ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.stat-box {
  background: var(--white); border-radius: 10px;
  border: 1px solid var(--gray-200); padding: 20px; text-align: center;
}
.stat-box .val { font-size: 1.8rem; font-weight: 800; color: var(--blue); }
.stat-box .lbl { font-size: .8rem; color: var(--gray-600); margin-top: 4px; }

/* ── HOMEPAGE HERO ── */
.home-hero {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 50%, #0EA5E9 100%);
  padding: 64px 0 80px; color: var(--white); text-align: center;
}
.home-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 14px; }
.home-hero p  { font-size: 1.15rem; opacity: .9; max-width: 540px; margin: 0 auto 32px; }
.home-hero .hero-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero-badge {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: 6px 16px; font-size: .85rem; font-weight: 500;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--gray-900); color: #D1D5DB;
  margin-top: 60px;
}
.footer-inner {
  display: grid; grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 32px; padding: 48px 0 32px;
}
.footer-col h4 {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--white); margin-bottom: 12px;
}
.footer-col a {
  display: block; color: #9CA3AF; font-size: .875rem;
  padding: 3px 0; transition: color .12s;
}
.footer-col a:hover { color: var(--white); text-decoration: none; }
.footer-col p { font-size: .875rem; line-height: 1.7; margin-top: 8px; }
.footer-bottom {
  border-top: 1px solid #374151; padding: 16px 0;
  display: flex;
}
.footer-bottom .container {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
}
.footer-bottom p { font-size: .82rem; color: #6B7280; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: .82rem; color: #6B7280; }
.footer-links a:hover { color: var(--white); text-decoration: none; }

/* ── PROGRAMMATIC TABLE ── */
.prog-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.prog-table th {
  background: var(--gray-100); padding: 12px 16px;
  text-align: left; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em;
}
.prog-table td { padding: 12px 16px; border-top: 1px solid var(--gray-100); }
.prog-table tr:hover td { background: var(--blue-light); }

/* ── COPY BUTTON ── */
.copy-btn {
  background: none; border: 1px solid var(--blue-mid);
  border-radius: 6px; padding: 4px 10px;
  font-size: .78rem; color: var(--blue); cursor: pointer;
  transition: background .12s;
}
.copy-btn:hover { background: var(--blue-light); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ── ALERT ── */
.alert {
  border-radius: 8px; padding: 14px 18px; font-size: .9rem; margin: 16px 0;
}
.alert-info { background: var(--blue-light); border-left: 4px solid var(--blue); color: var(--blue-dark); }
.alert-success { background: #D1FAE5; border-left: 4px solid var(--green); color: #065F46; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: fixed; top: 64px; left: 0; right: 0;
    background: var(--white); border-top: 1px solid var(--gray-200);
    flex-direction: column; align-items: stretch; padding: 16px;
    gap: 4px; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .nav-dropdown {
    position: static; box-shadow: none; border: none;
    padding-left: 12px; display: none;
  }
  .nav-group.open .nav-dropdown { display: block; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .section-grid { grid-template-columns: 1fr; }
  .section-grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .tool-card { padding: 20px 16px; margin-top: -16px; }
  .home-hero { padding: 40px 0 60px; }
}

/* ── UTILS ── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.fw-700 { font-weight: 700; }
.color-blue { color: var(--blue); }
.color-gray { color: var(--gray-600); }
h2 { font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
p  { margin-bottom: 10px; color: var(--gray-700); }

/* ── PRINT ── */
@media print {
  .site-header, .site-footer, .page-hero, .related-tools,
  .btn, .copy-btn, .nav-toggle, .breadcrumb { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .container { max-width: 100%; padding: 0; }
  .tool-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .result-box { box-shadow: none; border: 1px solid #aaa; }
  table { border-collapse: collapse; width: 100%; }
  th, td { border: 1px solid #ccc; padding: 4px 8px; }
  a[href]::after { content: none; }
}
