/* =====================================================================
   1% pour les Enfants — Components
   Depends on colors_and_type.css.
   ===================================================================== */

/* =====================================================================
   BUTTONS
   Two styles only: PRIMARY (filled) and GHOST (text + animated
   underline). Modifiers: size (.btn-sm / .btn-md / .btn-lg) and brand
   color (.btn-pink default / .btn-deep / .btn-sun / .btn-sky).
   ===================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);          /* Montserrat — gives buttons brand voice */
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease),
              color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              transform var(--dur-base) var(--ease);
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  /* --btn-color tokens — each color modifier sets these three and the
     primary / ghost styles consume them. */
  --btn-fill: var(--pink-500);
  --btn-fill-hover: var(--pink-700);
  --btn-fill-deeper: var(--pink-900);
  --btn-text: var(--snow);
  --btn-shadow: 230, 0, 122;
}

/* Sizes */
.btn-sm { font-size: 14px; padding: 9px 16px; min-height: 38px; }
.btn-md { font-size: 15px; padding: 13px 22px; min-height: 46px; }
.btn-lg { font-size: 17px; padding: 16px 28px; min-height: 54px; }

/* Built-in arrow that slides on hover. Wrap your icon in
   <span class="btn-arrow">…</span>. */
.btn .btn-arrow {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--dur-base) var(--ease);
}
.btn:hover .btn-arrow { transform: translateX(3px); }

/* --- Color modifiers — set the three token slots. */
.btn-pink { --btn-fill: var(--pink-500); --btn-fill-hover: var(--pink-700); --btn-fill-deeper: var(--pink-900); --btn-text: var(--snow); --btn-shadow: 230, 0, 122; }
.btn-deep { --btn-fill: var(--deep-500); --btn-fill-hover: var(--deep-700); --btn-fill-deeper: var(--deep-900); --btn-text: var(--snow); --btn-shadow: 20, 46, 98; }
.btn-sun  { --btn-fill: var(--sun-500);  --btn-fill-hover: var(--sun-700);  --btn-fill-deeper: var(--sun-900);  --btn-text: var(--ink-900); --btn-shadow: 255, 199, 60; }
.btn-sky  { --btn-fill: var(--sky-500);  --btn-fill-hover: var(--sky-700);  --btn-fill-deeper: var(--deep-700); --btn-text: var(--ink-900); --btn-shadow: 125, 167, 255; }

/* --- Primary — filled. Confident two-tone with inset highlight + dark
   bottom edge so it feels "physical" without being skeuomorphic. */
.btn-primary {
  background: var(--btn-fill);
  color: var(--btn-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 var(--btn-fill-hover),
    0 1px 2px rgba(var(--btn-shadow), 0.22);
}
.btn-primary:hover {
  background: var(--btn-fill-hover);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 var(--btn-fill-deeper),
    0 8px 18px rgba(var(--btn-shadow), 0.32),
    0 2px 4px rgba(var(--btn-shadow), 0.22);
}
.btn-primary:active {
  background: var(--btn-fill-deeper);
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 var(--btn-fill-deeper),
    0 1px 2px rgba(var(--btn-shadow), 0.22);
}
.btn-primary:disabled, .btn-primary[aria-disabled="true"] {
  background: var(--ink-200); color: var(--ink-500);
  cursor: not-allowed; transform: none;
  box-shadow: none;
}

/* --- Ghost — text with an animated underline. Looks unmistakably like
   a link-button, not a CTA. */
.btn-ghost {
  background: transparent;
  color: var(--btn-fill);
  padding-left: 4px; padding-right: 4px;
  border-radius: 4px;
  box-shadow: none;
}
.btn-ghost::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: 8px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0.18);
  transform-origin: left;
  opacity: 0.6;
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
}
.btn-ghost.btn-sm::after { bottom: 6px; }
.btn-ghost.btn-lg::after { bottom: 10px; }
.btn-ghost:hover { color: var(--btn-fill-hover); }
.btn-ghost:hover::after { transform: scaleX(1); opacity: 1; }
.btn-ghost:active { color: var(--btn-fill-deeper); }
.btn-ghost.btn-sun  { color: var(--sun-700); }
.btn-ghost.btn-sun:hover { color: var(--sun-900); }

/* --- Outline — bordered, quiet. For secondary actions (file pickers,
   uploads) where the underlined ghost reads like a text link. */
.btn-outline {
  background: var(--snow);
  color: var(--btn-fill);
  border: 1.5px solid var(--btn-fill);
  box-shadow: none;
}
.btn-outline:hover {
  background: rgba(var(--btn-shadow), 0.08);
  color: var(--btn-fill-hover);
  border-color: var(--btn-fill-hover);
}
.btn-outline:active { color: var(--btn-fill-deeper); border-color: var(--btn-fill-deeper); }

/* Icon-only action button — pair with .btn-outline/.btn-ghost + a color
   modifier. Always give it an aria-label + title. */
.btn-icon {
  width: 36px; min-height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon svg { width: 16px; height: 16px; }

/* Loading state */
.btn-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn-loading::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid var(--btn-text); border-top-color: transparent;
  border-radius: 50%;
  animation: btnspin 600ms linear infinite;
}
@keyframes btnspin { to { transform: rotate(360deg); } }

/* =====================================================================
   FORM CONTROLS
   ===================================================================== */
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font: 700 12px/1.2 var(--font-display);
  color: var(--ink-900);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-helper { font: 400 12px/1.4 var(--font-body); color: var(--ink-500); }
.form-error {
  font: 500 12px/1.4 var(--font-body);
  color: var(--error);
  display: inline-flex; align-items: center; gap: 6px;
}
.form-error::before {
  content: "!";
  width: 14px; height: 14px;
  font: 800 10px/14px var(--font-display);
  text-align: center;
  background: var(--error);
  color: var(--snow);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Input wrapper — used when the input has a leading icon or suffix.
   <div class="input-wrap"><i class="input-icon">…</i><input class="input"></div> */
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-left: 42px; }
.input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-500);
  pointer-events: none;
  transition: color var(--dur-base) var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
}
.input-wrap:focus-within .input-icon { color: var(--deep-500); }

.input,
.textarea,
.select {
  font: 500 16px/1.4 var(--font-body);
  color: var(--ink-900);
  background: var(--snow);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--dur-base) var(--ease),
              background var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-300); font-weight: 400; }

.input:hover, .textarea:hover, .select:hover { border-color: var(--ink-300); background: var(--paper); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--deep-500);
  background: var(--snow);
  box-shadow: 0 0 0 4px var(--sky-100);
}

/* Filled-and-valid — Sun underline accent on inputs the user filled
   that pass validation. Apply via [data-state="filled"]. */
.input[data-state="filled"],
.textarea[data-state="filled"],
.select[data-state="filled"] {
  border-color: var(--ink-200);
  border-bottom-color: var(--sun-500);
  border-bottom-width: 2.5px;
  padding-bottom: 11px;
}

.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12);
}
.input:disabled, .textarea:disabled, .select:disabled {
  background: var(--ink-100); color: var(--ink-500); cursor: not-allowed;
  border-color: var(--ink-200);
}
.textarea { min-height: 104px; padding: 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23142E62' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

/* Floating label */
.floating { position: relative; }
.floating .input,
.floating .textarea { padding-top: 24px; padding-bottom: 8px; }
.floating .form-label {
  position: absolute; left: 14px; top: 16px;
  font-size: 13px; color: var(--ink-500);
  text-transform: none; letter-spacing: 0;
  font-family: var(--font-body); font-weight: 500;
  pointer-events: none;
  transition: transform var(--dur-base) var(--ease), font-size var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
  background: transparent;
}
.floating .input:focus + .form-label,
.floating .input:not(:placeholder-shown) + .form-label,
.floating .textarea:focus + .form-label,
.floating .textarea:not(:placeholder-shown) + .form-label {
  transform: translateY(-10px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--deep-500);
}

/* Checkbox / Radio */
.check, .radio {
  appearance: none; width: 18px; height: 18px;
  border: 1.5px solid var(--ink-300);
  background: var(--snow);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  display: inline-grid; place-items: center;
}
.check { border-radius: 4px; }
.radio { border-radius: 50%; }
.check:hover, .radio:hover { border-color: var(--deep-500); }
.check:checked, .radio:checked { background: var(--deep-500); border-color: var(--deep-500); }
.check:checked::after {
  content: ""; width: 10px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}
.radio:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--snow); }

/* Switch */
.switch { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--ink-200); position: relative; cursor: pointer; transition: background var(--dur-base) var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--snow); box-shadow: var(--shadow-sm); transition: left var(--dur-base) var(--ease); }
.switch:checked { background: var(--deep-500); }
.switch:checked::after { left: 20px; }

/* =====================================================================
   TAGS / CHIPS / BADGES
   ===================================================================== */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px/1 var(--font-body);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}
.tag-neutral { background: var(--ink-100); color: var(--ink-700); }
.tag-pink    { background: var(--pink-50); color: var(--pink-700); }
.tag-sun     { background: var(--sun-50); color: var(--sun-900); }
.tag-sky     { background: var(--sky-50); color: var(--deep-700); }
.tag-deep    { background: var(--deep-500); color: var(--snow); }
.tag svg { width: 14px; height: 14px; }
/* Article header meta pills (author / date / reading time) */
.article-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Article header: category + topic tags, kept separate from author meta */
.article-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.article-tags .sep { width: 1px; align-self: stretch; min-height: 18px; background: var(--ink-200); margin: 0 2px; }
.tag-outline { background: transparent; color: var(--ink-600); border: 1px solid var(--ink-200); }
.article-author { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.article-author .avatar { flex-shrink: 0; }
.article-author .who strong { font: 700 14px/1.2 var(--font-display); color: var(--ink-900); display: block; margin-bottom: 2px; }
.article-author .who .t-body-sm { color: var(--ink-500); }

.badge {
  display: inline-flex; align-items: center;
  font: 700 11px/1 var(--font-body);
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-count { padding: 3px 7px; border-radius: 999px; font-size: 11px; text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; background: var(--pink-500); color: var(--snow); }

/* =====================================================================
   AVATAR
   ===================================================================== */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--sky-100); color: var(--deep-700); font: 600 14px/1 var(--font-body); overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* =====================================================================
   CARDS
   ===================================================================== */
.card {
  background: var(--snow);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-bordered { box-shadow: none; border: 1px solid var(--ink-200); }

/* =====================================================================
   DIVIDER
   ===================================================================== */
.divider { height: 1px; background: var(--ink-200); width: 100%; }
.divider-vert { width: 1px; background: var(--ink-200); align-self: stretch; }

/* =====================================================================
   TOOLTIP
   ===================================================================== */
.tooltip {
  display: inline-block;
  background: var(--ink-900);
  color: var(--snow);
  font: 500 12px/1.3 var(--font-body);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* Candidature steps indicator (associations page) */
.candidature-steps .step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  opacity: .6;
}
.candidature-steps .step.is-active {
  color: var(--text);
  opacity: 1;
}
.candidature-steps .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: 700 12px/1 var(--font-display);
}
.candidature-steps .step.is-active .step-num {
  background: var(--brand-pink, var(--accent, #e84a8d));
  color: #fff;
}

/* =====================================================================
   BOUTIQUE — product grid + ordering paths
   ===================================================================== */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.shop-card {
  background: var(--snow);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.shop-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.shop-media { aspect-ratio: 1 / 1; background: var(--sky-50); }
.shop-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-body {
  padding: 18px 18px 20px;
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.shop-body h3 {
  font: 700 17px/1.25 var(--font-display);
  letter-spacing: -0.01em; color: var(--ink-900);
}
.shop-body p { font: 400 13.5px/1.5 var(--font-body); color: var(--ink-700); flex: 1; }
.shop-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--ink-200);
}
.shop-price { font: 800 20px/1 var(--font-display); color: var(--pink-700); }
.shop-free  { font: 600 12px/1.3 var(--font-body); color: var(--success); }
.shop-note  { font: 600 12px/1.3 var(--font-body); color: var(--ink-500); }

/* Ordering paths */
.shop-intro-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.shop-path {
  background: var(--snow);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
}
.shop-path h3 { font: 700 22px/1.2 var(--font-display); letter-spacing: -0.01em; color: var(--ink-900); }
.shop-path p { font: 400 15px/1.55 var(--font-body); color: var(--ink-700); }
.shop-path .btn { align-self: flex-start; margin-top: 4px; }
.path-badge {
  align-self: flex-start;
  font: 700 12px/1 var(--font-display);
  letter-spacing: 0.02em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid currentColor;
}
.path-badge.t-pink { color: var(--pink-700); }
.path-badge.t-mint { color: var(--success); }

@media (max-width: 900px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-intro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .shop-grid { grid-template-columns: 1fr; }
}
