/* ==========================================================================
   FRUTIMIX — Design System  v1.0
   Mercantil Nantes de C.R., S.A.
   --------------------------------------------------------------------------
   Reusable brand tokens + components for any Frutimix web page.
   Source of truth: "PresentaciónProductosFrutimix.pptx" (brand deck).
   Full documentation: /STYLE_GUIDE.md

   USAGE
   1. Load the brand font (Outfit) in <head>:
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
   2. Link this file BEFORE any page-specific stylesheet:
        <link rel="stylesheet" href="/styles/design-system.css">
   3. Use the tokens (var(--fm-*)) and the .fm-* component classes.
      Never hard-code a brand hex value in page CSS — reference a token.

   CONTENTS
   01. Tokens: color · typography · spacing · radius · shadow · motion · layout
   02. Base / reset
   03. Typography classes
   04. Layout: container, section, section themes, grid, stack
   05. Components: button, badge, chip, card, media slot, icon circle,
       form fields, brand rule, seal, alert
   06. Utilities
   ========================================================================== */


/* ==========================================================================
   01. TOKENS
   ========================================================================== */
:root {
  /* ---- Brand palette (from the deck) ---------------------------------- */
  --fm-terracotta:        #B6582C;  /* Primary — cover slide, primary CTAs   */
  --fm-terracotta-700:    #96441F;  /* Hover / pressed                        */
  --fm-terracotta-100:    #F6E4DA;  /* Tint for soft backgrounds              */

  --fm-forest:            #1E372A;  /* Secondary — headings, dark sections   */
  --fm-forest-800:        #152820;  /* Deepest (footer)                       */
  --fm-forest-600:        #2E4F3E;  /* Hover on forest                        */
  --fm-forest-100:        #E3EAE5;  /* Tint                                   */

  --fm-olive:             #5E6C36;  /* Support — product panels              */
  --fm-olive-100:         #ECEFE1;

  --fm-mango:             #F5BF49;  /* Accent — highlights, badges           */
  --fm-mango-600:         #E2A41C;
  --fm-mango-100:         #FDF1D3;

  --fm-cacao:             #623415;  /* Accent — chocolate products, closing  */
  --fm-cacao-100:         #F1E5DC;

  /* ---- Neutrals ------------------------------------------------------- */
  --fm-white:             #FFFFFF;
  --fm-sand:              #FAF6F1;  /* Alternating section background        */
  --fm-gray-100:          #F2F2F2;
  --fm-gray-300:          #D5D5D5;  /* Dividers, input borders               */
  --fm-gray-500:          #8A8A8A;
  --fm-gray-600:          #5E5E5E;  /* Body text                             */
  --fm-gray-900:          #232323;

  /* ---- Feedback ------------------------------------------------------- */
  --fm-success:           #3F7A4E;
  --fm-error:             #B3261E;

  /* ---- Semantic aliases (use these in components) --------------------- */
  --fm-color-bg:          var(--fm-white);
  --fm-color-surface:     var(--fm-white);
  --fm-color-surface-alt: var(--fm-sand);
  --fm-color-text:        var(--fm-gray-600);
  --fm-color-heading:     var(--fm-forest);
  --fm-color-muted:       var(--fm-gray-500);
  --fm-color-border:      var(--fm-gray-300);
  --fm-color-primary:     var(--fm-terracotta);
  --fm-color-primary-hover: var(--fm-terracotta-700);
  --fm-color-secondary:   var(--fm-forest);
  --fm-color-accent:      var(--fm-mango);
  --fm-color-link:        var(--fm-terracotta);
  --fm-color-focus:       var(--fm-mango);

  /* ---- Typography ----------------------------------------------------- */
  --fm-font-sans:  "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fm-font-heading: var(--fm-font-sans);
  --fm-font-body:    var(--fm-font-sans);

  --fm-weight-light:    300;   /* Eyebrows, labels ("FRUTIMIX 2024")       */
  --fm-weight-regular:  400;   /* Body                                     */
  --fm-weight-medium:   500;   /* Buttons, nav                             */
  --fm-weight-semibold: 600;   /* Headings (deck: Outfit SemiBold)         */
  --fm-weight-bold:     700;

  /* Fluid type scale — min @ 360px, max @ 1280px */
  --fm-text-xs:   0.8125rem;                                   /* 13px  */
  --fm-text-sm:   0.9375rem;                                   /* 15px  */
  --fm-text-base: 1.0625rem;                                   /* 17px  */
  --fm-text-lg:   clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);  /* 18–20 */
  --fm-text-xl:   clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);    /* 20–24 */
  --fm-text-2xl:  clamp(1.5rem, 1.3rem + 0.9vw, 2rem);         /* 24–32 */
  --fm-text-3xl:  clamp(1.875rem, 1.5rem + 1.6vw, 2.75rem);    /* 30–44 */
  --fm-text-4xl:  clamp(2.25rem, 1.65rem + 2.6vw, 3.75rem);    /* 36–60 */
  --fm-text-5xl:  clamp(2.75rem, 1.9rem + 3.8vw, 5rem);        /* 44–80 */

  --fm-leading-tight:  1.1;
  --fm-leading-snug:   1.3;
  --fm-leading-normal: 1.6;

  --fm-tracking-tight: -0.015em;
  --fm-tracking-wide:  0.18em;   /* Uppercase eyebrows */

  /* ---- Spacing (4px base) --------------------------------------------- */
  --fm-space-1:  0.25rem;  /*  4 */
  --fm-space-2:  0.5rem;   /*  8 */
  --fm-space-3:  0.75rem;  /* 12 */
  --fm-space-4:  1rem;     /* 16 */
  --fm-space-5:  1.5rem;   /* 24 */
  --fm-space-6:  2rem;     /* 32 */
  --fm-space-7:  3rem;     /* 48 */
  --fm-space-8:  4rem;     /* 64 */
  --fm-space-9:  6rem;     /* 96 */
  --fm-space-10: 8rem;     /* 128 */
  --fm-section-y: clamp(3.5rem, 2.4rem + 5vw, 7rem);

  /* ---- Radius --------------------------------------------------------- */
  --fm-radius-sm:   6px;
  --fm-radius-md:   12px;
  --fm-radius-lg:   20px;
  --fm-radius-xl:   32px;
  --fm-radius-pill: 999px;

  /* ---- Shadows (tinted with forest green, never pure black) ----------- */
  --fm-shadow-sm: 0 1px 2px rgb(30 55 42 / 0.08), 0 1px 3px rgb(30 55 42 / 0.06);
  --fm-shadow-md: 0 4px 12px rgb(30 55 42 / 0.08), 0 2px 4px rgb(30 55 42 / 0.05);
  --fm-shadow-lg: 0 18px 40px rgb(30 55 42 / 0.14), 0 4px 10px rgb(30 55 42 / 0.06);

  /* ---- Motion --------------------------------------------------------- */
  --fm-ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
  --fm-dur-fast:  150ms;
  --fm-dur:       250ms;
  --fm-dur-slow:  600ms;

  /* ---- Layout --------------------------------------------------------- */
  --fm-container:        1200px;
  --fm-container-narrow: 760px;
  --fm-gutter:           clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --fm-header-h:         72px;

  /* ---- Image aspect ratios (see STYLE_GUIDE §6) ----------------------- */
  --fm-ratio-square:    1 / 1;   /* Product packshots  1200×1200 */
  --fm-ratio-landscape: 4 / 3;   /* Lifestyle / detail 1600×1200 */
  --fm-ratio-portrait:  4 / 5;   /* Hero / editorial   1200×1500 */
  --fm-ratio-wide:      16 / 9;  /* Banners            1920×1080 */

  /* ---- Z-index -------------------------------------------------------- */
  --fm-z-header: 100;
  --fm-z-float:  90;
  --fm-z-modal:  200;
}


/* ==========================================================================
   02. BASE / RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--fm-header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--fm-font-body);
  font-size: var(--fm-text-base);
  font-weight: var(--fm-weight-regular);
  line-height: var(--fm-leading-normal);
  color: var(--fm-color-text);
  background: var(--fm-color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--fm-space-4);
  font-family: var(--fm-font-heading);
  font-weight: var(--fm-weight-semibold);
  line-height: var(--fm-leading-tight);
  letter-spacing: var(--fm-tracking-tight);
  color: var(--fm-color-heading);
  text-wrap: balance;
}
h1 { font-size: var(--fm-text-4xl); }
h2 { font-size: var(--fm-text-3xl); }
h3 { font-size: var(--fm-text-xl); line-height: var(--fm-leading-snug); }
h4 { font-size: var(--fm-text-lg); line-height: var(--fm-leading-snug); }

p { margin: 0 0 var(--fm-space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--fm-color-link); text-underline-offset: 0.18em; }
a:hover { color: var(--fm-color-primary-hover); }

img, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--fm-color-focus);
  outline-offset: 3px;
  border-radius: var(--fm-radius-sm);
}

::selection { background: var(--fm-mango); color: var(--fm-forest); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ==========================================================================
   03. TYPOGRAPHY CLASSES
   ========================================================================== */
.fm-display { font-size: var(--fm-text-5xl); font-weight: var(--fm-weight-semibold); line-height: 1.02; letter-spacing: -0.02em; }
.fm-h1 { font-size: var(--fm-text-4xl); }
.fm-h2 { font-size: var(--fm-text-3xl); }
.fm-h3 { font-size: var(--fm-text-xl); }

/* Small uppercase label — mirrors the deck's "FRUTIMIX 2024" footer */
.fm-eyebrow {
  display: inline-block;
  margin: 0 0 var(--fm-space-3);
  font-size: var(--fm-text-xs);
  font-weight: var(--fm-weight-medium);
  letter-spacing: var(--fm-tracking-wide);
  text-transform: uppercase;
  color: var(--fm-color-primary);
}

.fm-lead { font-size: var(--fm-text-lg); line-height: 1.55; }
.fm-small { font-size: var(--fm-text-sm); }
.fm-muted { color: var(--fm-color-muted); }
.fm-text-center { text-align: center; }


/* ==========================================================================
   04. LAYOUT
   ========================================================================== */
.fm-container {
  width: 100%;
  max-width: calc(var(--fm-container) + var(--fm-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--fm-gutter);
}
.fm-container--narrow { max-width: calc(var(--fm-container-narrow) + var(--fm-gutter) * 2); }

.fm-section { padding-block: var(--fm-section-y); position: relative; }
.fm-section--tight { padding-block: var(--fm-space-7); }

.fm-section__header { max-width: 680px; margin-bottom: var(--fm-space-7); }
.fm-section__header--center { margin-inline: auto; text-align: center; }

/* Section color themes — each redefines the semantic aliases so every
   component inside adapts automatically. Mirrors the deck's full-bleed
   colored slides. */
.fm-theme-sand       { background: var(--fm-sand); }
.fm-theme-terracotta { --fm-color-text: rgb(255 255 255 / 0.9); --fm-color-heading: var(--fm-white); --fm-color-muted: rgb(255 255 255 / 0.72); --fm-color-link: var(--fm-white); --fm-color-primary: var(--fm-mango); --fm-color-border: rgb(255 255 255 / 0.28); background: var(--fm-terracotta); color: var(--fm-color-text); }
.fm-theme-forest     { --fm-color-text: rgb(255 255 255 / 0.86); --fm-color-heading: var(--fm-white); --fm-color-muted: rgb(255 255 255 / 0.65); --fm-color-link: var(--fm-mango); --fm-color-primary: var(--fm-mango); --fm-color-border: rgb(255 255 255 / 0.2); background: var(--fm-forest); color: var(--fm-color-text); }
.fm-theme-olive      { --fm-color-text: rgb(255 255 255 / 0.9); --fm-color-heading: var(--fm-white); --fm-color-muted: rgb(255 255 255 / 0.72); --fm-color-link: var(--fm-mango); --fm-color-primary: var(--fm-mango); --fm-color-border: rgb(255 255 255 / 0.25); background: var(--fm-olive); color: var(--fm-color-text); }
.fm-theme-mango      { --fm-color-text: var(--fm-forest); --fm-color-heading: var(--fm-forest); --fm-color-muted: rgb(30 55 42 / 0.75); --fm-color-link: var(--fm-forest); --fm-color-primary: var(--fm-terracotta-700); --fm-color-border: rgb(30 55 42 / 0.2); background: var(--fm-mango); color: var(--fm-color-text); }
.fm-theme-cacao      { --fm-color-text: rgb(255 255 255 / 0.86); --fm-color-heading: var(--fm-white); --fm-color-muted: rgb(255 255 255 / 0.65); --fm-color-link: var(--fm-mango); --fm-color-primary: var(--fm-mango); --fm-color-border: rgb(255 255 255 / 0.2); background: var(--fm-cacao); color: var(--fm-color-text); }

.fm-grid { display: grid; gap: var(--fm-space-5); }
.fm-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.fm-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.fm-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.fm-stack > * + * { margin-top: var(--fm-space-4); }
.fm-cluster { display: flex; flex-wrap: wrap; gap: var(--fm-space-3); align-items: center; }


/* ==========================================================================
   05. COMPONENTS
   ========================================================================== */

/* ---- Button -------------------------------------------------------------
   <a class="fm-btn fm-btn--primary" href="#">Label</a>
   Variants: --primary · --secondary · --outline · --light · --ghost
   Sizes:    --sm · --lg      Width: --block                               */
.fm-btn {
  --_bg: var(--fm-color-primary);
  --_fg: var(--fm-white);
  --_bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--fm-space-2);
  min-height: 48px;                       /* touch target */
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--_bd);
  border-radius: var(--fm-radius-pill);
  background: var(--_bg);
  color: var(--_fg);
  font-size: var(--fm-text-sm);
  font-weight: var(--fm-weight-medium);
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--fm-dur) var(--fm-ease), color var(--fm-dur) var(--fm-ease),
              border-color var(--fm-dur) var(--fm-ease), transform var(--fm-dur-fast) var(--fm-ease),
              box-shadow var(--fm-dur) var(--fm-ease);
}
.fm-btn:hover { color: var(--_fg); transform: translateY(-1px); box-shadow: var(--fm-shadow-md); }
.fm-btn:active { transform: translateY(0); box-shadow: none; }
.fm-btn svg { width: 1.15em; height: 1.15em; flex: none; }

.fm-btn--primary   { --_bg: var(--fm-terracotta); --_fg: var(--fm-white); }
.fm-btn--primary:hover { --_bg: var(--fm-terracotta-700); }
.fm-btn--secondary { --_bg: var(--fm-forest); --_fg: var(--fm-white); }
.fm-btn--secondary:hover { --_bg: var(--fm-forest-600); }
.fm-btn--accent    { --_bg: var(--fm-mango); --_fg: var(--fm-forest); }
.fm-btn--accent:hover { --_bg: var(--fm-mango-600); }
.fm-btn--outline   { --_bg: transparent; --_fg: var(--fm-forest); --_bd: var(--fm-forest); }
.fm-btn--outline:hover { --_bg: var(--fm-forest); --_fg: var(--fm-white); }
.fm-btn--light     { --_bg: var(--fm-white); --_fg: var(--fm-forest); }
.fm-btn--light:hover { --_bg: var(--fm-mango); }
.fm-btn--ghost-light { --_bg: transparent; --_fg: var(--fm-white); --_bd: rgb(255 255 255 / 0.7); }
.fm-btn--ghost-light:hover { --_bg: var(--fm-white); --_fg: var(--fm-forest); --_bd: var(--fm-white); }

.fm-btn--sm { min-height: 40px; padding: 0.5rem 1.1rem; font-size: var(--fm-text-xs); }
.fm-btn--lg { min-height: 56px; padding: 1rem 2rem; font-size: var(--fm-text-base); }
.fm-btn--block { width: 100%; }
.fm-btn[disabled], .fm-btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* ---- Badge (claims: "Sin gluten", "50% cacao") ------------------------- */
.fm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3rem 0.7rem;
  border-radius: var(--fm-radius-pill);
  background: var(--fm-forest-100);
  color: var(--fm-forest);
  font-size: var(--fm-text-xs);
  font-weight: var(--fm-weight-medium);
  line-height: 1.2;
  white-space: nowrap;
}
.fm-badge--mango      { background: var(--fm-mango-100); color: #6B4A00; }
.fm-badge--terracotta { background: var(--fm-terracotta-100); color: var(--fm-terracotta-700); }
.fm-badge--cacao      { background: var(--fm-cacao-100); color: var(--fm-cacao); }
.fm-badge--olive      { background: var(--fm-olive-100); color: #46512A; }

/* ---- Chip (package sizes: 30 g · 50 g · 180 g) ------------------------- */
.fm-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  padding: 0.35rem 0.8rem;
  border: 1.5px solid var(--fm-color-border);
  border-radius: var(--fm-radius-pill);
  font-size: var(--fm-text-sm);
  font-weight: var(--fm-weight-medium);
  color: var(--fm-color-heading);
  background: transparent;
}
.fm-chip small { font-size: 0.78em; font-weight: var(--fm-weight-regular); color: var(--fm-color-muted); }

/* ---- Card -------------------------------------------------------------- */
.fm-card {
  display: flex;
  flex-direction: column;
  background: var(--fm-color-surface);
  border-radius: var(--fm-radius-lg);
  box-shadow: var(--fm-shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--fm-dur) var(--fm-ease), transform var(--fm-dur) var(--fm-ease);
}
.fm-card--interactive:hover { box-shadow: var(--fm-shadow-lg); transform: translateY(-3px); }
.fm-card__body { display: flex; flex-direction: column; gap: var(--fm-space-3); padding: var(--fm-space-5); flex: 1; }
.fm-card__title { margin: 0; font-size: var(--fm-text-xl); }
.fm-card__footer { margin-top: auto; padding-top: var(--fm-space-3); }
.fm-card--flat { box-shadow: none; border: 1px solid var(--fm-color-border); }

/* ---- Media slot (image container with brand placeholder) ---------------
   Shows a styled placeholder until the real image exists. The <img> sits on
   top; if the file is missing, onerror removes it and the placeholder shows.

   <div class="fm-media fm-media--square" data-tone="terracotta">
     <img class="fm-media__img" src="assets/images/products/chocopina.webp"
          alt="…" width="1200" height="1200" loading="lazy" decoding="async"
          onerror="this.remove()">
     <div class="fm-media__placeholder" aria-hidden="true">
       <span class="fm-media__mark"></span>
       <span class="fm-media__label">Chocopiña</span>
       <span class="fm-media__spec">1200 × 1200 · 1:1</span>
     </div>
   </div>
   Ratios: --square (1:1) · --landscape (4:3) · --portrait (4:5) · --wide (16:9)
   Tones (data-tone): terracotta · forest · olive · mango · cacao            */
.fm-media {
  --_tone: var(--fm-terracotta);
  --_tone-bg: var(--fm-terracotta-100);
  position: relative;
  aspect-ratio: var(--fm-ratio-landscape);
  overflow: hidden;
  background: var(--_tone-bg);
  isolation: isolate;
}
.fm-media--square    { aspect-ratio: var(--fm-ratio-square); }
.fm-media--landscape { aspect-ratio: var(--fm-ratio-landscape); }
.fm-media--portrait  { aspect-ratio: var(--fm-ratio-portrait); }
.fm-media--wide      { aspect-ratio: var(--fm-ratio-wide); }
.fm-media--rounded   { border-radius: var(--fm-radius-lg); }

.fm-media[data-tone="forest"] { --_tone: var(--fm-forest);  --_tone-bg: var(--fm-forest-100); }
.fm-media[data-tone="olive"]  { --_tone: var(--fm-olive);   --_tone-bg: var(--fm-olive-100); }
.fm-media[data-tone="mango"]  { --_tone: #9A6A00;           --_tone-bg: var(--fm-mango-100); }
.fm-media[data-tone="cacao"]  { --_tone: var(--fm-cacao);   --_tone-bg: var(--fm-cacao-100); }

.fm-media__img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* lifestyle photos: fill the frame          */
}
.fm-media__img--contain {
  object-fit: contain;        /* packshots on transparent/white background */
  padding: 6%;
}

.fm-media__placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--fm-space-2);
  padding: var(--fm-space-5);
  text-align: center;
  color: var(--_tone);
  background:
    radial-gradient(circle at 50% 42%, rgb(255 255 255 / 0.65) 0 28%, transparent 62%),
    repeating-linear-gradient(135deg, transparent 0 14px, rgb(255 255 255 / 0.35) 14px 15px),
    var(--_tone-bg);
}
.fm-media__placeholder::after {           /* inset dashed frame */
  content: "";
  position: absolute;
  inset: 12px;
  border: 1.5px dashed currentColor;
  border-radius: calc(var(--fm-radius-lg) - 8px);
  opacity: 0.28;
  pointer-events: none;
}
.fm-media__mark {                         /* brand plant icon, tinted */
  width: clamp(44px, 18%, 72px);
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--fm-icon-url, url("../assets/images/brand/frutimix-icon-forest.svg")) center / contain no-repeat;
          mask: var(--fm-icon-url, url("../assets/images/brand/frutimix-icon-forest.svg")) center / contain no-repeat;
  opacity: 0.85;
}
.fm-media__label {
  font-size: var(--fm-text-lg);
  font-weight: var(--fm-weight-semibold);
  line-height: 1.2;
}
.fm-media__spec {
  font-size: var(--fm-text-xs);
  font-weight: var(--fm-weight-light);
  letter-spacing: var(--fm-tracking-wide);
  text-transform: uppercase;
  opacity: 0.8;
}

/* ---- Icon circle ------------------------------------------------------- */
.fm-icon-circle {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  background: var(--fm-terracotta-100);
  color: var(--fm-terracotta);
}
.fm-icon-circle svg { width: 26px; height: 26px; }
.fm-icon-circle--forest { background: var(--fm-forest-100); color: var(--fm-forest); }
.fm-icon-circle--mango  { background: var(--fm-mango);      color: var(--fm-forest); }
.fm-icon-circle--on-dark { background: rgb(255 255 255 / 0.12); color: var(--fm-mango); }

/* Inline icon helper (stroke icons from the sprite) */
.fm-icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Form fields ------------------------------------------------------- */
.fm-field { display: flex; flex-direction: column; gap: var(--fm-space-2); }
.fm-label { font-size: var(--fm-text-sm); font-weight: var(--fm-weight-medium); color: var(--fm-color-heading); }
.fm-label .fm-req { color: var(--fm-terracotta); }
.fm-hint  { font-size: var(--fm-text-xs); color: var(--fm-color-muted); }

.fm-input, .fm-select, .fm-textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--fm-gray-300);
  border-radius: var(--fm-radius-md);
  background: var(--fm-white);
  color: var(--fm-gray-900);
  font-size: 1rem;                   /* ≥16px prevents iOS zoom */
  transition: border-color var(--fm-dur-fast), box-shadow var(--fm-dur-fast);
}
.fm-textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.fm-select {
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E372A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 18px;
}
.fm-input:hover, .fm-select:hover, .fm-textarea:hover { border-color: var(--fm-gray-500); }
.fm-input:focus, .fm-select:focus, .fm-textarea:focus {
  outline: none;
  border-color: var(--fm-forest);
  box-shadow: 0 0 0 4px rgb(245 191 73 / 0.45);
}
.fm-input:user-invalid, .fm-select:user-invalid, .fm-textarea:user-invalid { border-color: var(--fm-error); }

.fm-check { display: flex; align-items: center; gap: var(--fm-space-2); font-size: var(--fm-text-sm); cursor: pointer; }
.fm-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--fm-terracotta); flex: none; }

/* ---- Brand rule (thin line + label, from the deck footer) -------------- */
.fm-rule {
  display: flex;
  align-items: center;
  gap: var(--fm-space-4);
  font-size: var(--fm-text-xs);
  font-weight: var(--fm-weight-light);
  letter-spacing: var(--fm-tracking-wide);
  text-transform: uppercase;
  color: var(--fm-color-muted);
}
.fm-rule::after { content: ""; flex: 1; height: 1px; background: var(--fm-color-border); }

/* ---- Seal (round "Fruta deshidratada · Dried tropical fruit" badge) ---- */
.fm-seal { width: clamp(96px, 12vw, 150px); aspect-ratio: 1; }
.fm-seal--spin { animation: fm-spin 40s linear infinite; }
@keyframes fm-spin { to { transform: rotate(360deg); } }

/* ---- Alert / form status ----------------------------------------------- */
.fm-alert {
  padding: var(--fm-space-4) var(--fm-space-5);
  border-radius: var(--fm-radius-md);
  font-size: var(--fm-text-sm);
  font-weight: var(--fm-weight-medium);
}
.fm-alert--success { background: #E5F1E8; color: var(--fm-success); }
.fm-alert--error   { background: #FBE7E5; color: var(--fm-error); }


/* ==========================================================================
   06. UTILITIES
   ========================================================================== */
.fm-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.fm-skip-link {
  position: absolute;
  top: -100px;
  left: var(--fm-space-4);
  z-index: 999;
  padding: var(--fm-space-3) var(--fm-space-4);
  border-radius: var(--fm-radius-md);
  background: var(--fm-forest);
  color: var(--fm-white);
  text-decoration: none;
}
.fm-skip-link:focus { top: var(--fm-space-4); color: var(--fm-white); }

/* Reveal-on-scroll (add .fm-reveal; JS adds .is-visible). Without JS the
   content is always visible because the hidden state needs html.js. */
.js .fm-reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--fm-dur-slow) var(--fm-ease), transform var(--fm-dur-slow) var(--fm-ease); }
.js .fm-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .fm-reveal { opacity: 1; transform: none; } }
