/* =========================================================
   Style - Calculatrice d'impôt Québec / Canada
   Fichier : impot-quebec.css
   Dernière maj : 01-11-2025
   ========================================================= */

:root {
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #6b7280;
  --green: #16a34a;
  --red: #ef4444;
  --blue: #0ea5e9;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.topbar {
  background: #0f172a;
  color: #fff;
  padding: 24px 16px 28px;
  text-align: center;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
}

.topbar .subtitle {
  margin-top: 6px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.impot-layout {
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 14px 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 22px;
  align-items: flex-start;
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(15, 23, 42, 0.03);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px 22px;
}

.impot-form h2,
.impot-result h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

form {
  width: 100%;
}

.form-row {
  margin-bottom: 16px;
  display: block;
}

.form-row label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #0f172a;
}

.form-row input,
.form-row select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8.5px 11px;
  font-size: 0.95rem;
  background: #fff;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-inline {
  display: flex;
  gap: 12px;
}

.form-inline .form-row.small {
  flex: 1 1 0;
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 8.5px 17px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.12s ease;
}

.btn-primary {
  background: #0ea5e9;
  color: #fff;
  margin-right: 6px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #0284c7;
}

.btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
  margin-right: 6px;
}

.btn-secondary:hover {
  background: #cbd5f5;
}

/* =============================
   Boîte de remboursement
   ============================= */

.impot-result {
  position: sticky;
  top: 18px;
}

.refund-box {
  border-radius: 14px;
  padding: 16px 16px 14px;
  margin-bottom: 16px;
  text-align: center;
}

.refund-box.refund {
  background: #dcfce7;
  border: 1px solid rgba(22, 163, 74, 0.4);
}

.refund-box.balance {
  background: #fee2e2;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.refund-box .label {
  font-weight: 600;
  margin-bottom: 4px;
}

.refund-box .amount {
  font-size: 2.1rem;
  font-weight: 700;
}

.refund-box .note {
  font-size: 0.75rem;
  color: #374151;
}

.breakdown .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.4);
  font-size: 0.9rem;
}

.breakdown .row:last-child {
  border-bottom: none;
}

.breakdown .row span:last-child {
  font-weight: 600;
}

.breakdown .total {
  font-weight: 700;
  margin-top: 4px;
}

.breakdown .highlight {
  background: rgba(14, 165, 233, 0.07);
  border-radius: 9px;
  padding: 8px 6px;
  margin-top: 6px;
}

.breakdown .small {
  font-size: 0.8rem;
  color: #475569;
}

/* =============================
   Disclaimer
   ============================= */
.disclaimer {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 10px;
}

/* =========================================================
   ✅ Correctif : champ d’aide qui ne passait pas à la ligne
   ========================================================= */

/* tous les groupes qui ont une aide */
.form-row.has-hint {
  display: flex;
  flex-wrap: wrap;           /* permet de repasser à la ligne */
  gap: 4px;
}

.form-row.has-hint label {
  flex: 1 0 100%;            /* le label prend toute la ligne */
}

.form-row.has-hint input,
.form-row.has-hint select {
  flex: 1 0 100%;            /* l’input aussi */
}

.form-row.has-hint .hint {
  flex: 1 0 100%;            /* et l’aide passe sous l’input */
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.3;
}

/* cas particulier du champ Québec (long label) */
#qcTaxPaidGroup {
  row-gap: 2px;
}

/* =============================
   Impression
   ============================= */
@media print {
  body {
    background: #fff;
  }

  .no-print {
    display: none !important;
  }

  .impot-layout {
    display: block;
    max-width: 900px;
  }

  .impot-result {
    position: static;
    margin-top: 20px;
  }
}

/* =============================
   Responsive
   ============================= */
@media (max-width: 960px) {
  .impot-layout {
    grid-template-columns: 1fr;
  }

  .impot-result {
    position: static;
  }

  .form-inline {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .topbar h1 {
    font-size: 1.45rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
    margin-bottom: 6px;
  }
}
