/* Aula Contigo — visual system (brand manual in code).
   Loads after tokens.css. The manual that explains each piece is docs/manual-de-marca.md,
   and guia.html shows every component live.

   Rule: no color, radius, font size, space or shadow outside these tokens.
   Components are prefixed `ac-` so they do not collide with the older classes
   (.card, .chip, .panel, .tile…) while pages migrate to them. */

:root {
  /* ---------- Color roles (built on the palette in tokens.css) ---------- */
  --c-bg: var(--cream);            /* page background */
  --c-surface: var(--paper);       /* cards, panels, inputs */
  --c-surface-2: var(--cream-2);   /* alternate section, quiet boxes */
  --c-text: var(--ink);
  --c-text-2: var(--ink-2);
  --c-muted: var(--ink-mut);
  --c-action: var(--ink);          /* primary button */
  --c-accent: var(--mustard);      /* the one highlighted action on a screen */
  --c-link: var(--leaf-dark);
  --c-focus: var(--orange);
  --c-ok: var(--leaf);       --c-ok-soft: var(--sage-soft);
  --c-warn: var(--coral-ink); --c-warn-soft: var(--coral-soft);
  --c-note-soft: var(--mustard-soft);
  --c-info-soft: var(--sky-soft);
  --c-curriculum: var(--lilac);    /* OA, ejes, ficha docente */
  --c-curriculum-ink: var(--lilac-ink);

  /* Hover shades: the only darker versions allowed */
  --ink-hover: #173a2c;
  --mustard-hover: #eaa520;
  --coral-hover: #e7765a;
  --sage-hover: #d4e5c8;

  /* Support colors (each with one job) */
  --white: #fff;            /* only drawing surfaces, images and printed sheets */
  --ink-deep: #10271d;      /* phone frames */
  --mustard-ink: #8a5b0b;   /* text on mustard-soft */
  --lilac-soft: #efe6f8;
  --teal: #6fb3c8;          /* rainbow letters, info stripe */

  /* ---------- Type scale: 9 sizes and nothing else ---------- */
  --t-h1: clamp(2.2rem, 6vw, 3.4rem);      /* page title, one per page */
  --t-h2: clamp(1.9rem, 4vw, 2.8rem);      /* section title */
  --t-h3: clamp(1.5rem, 3.4vw, 2rem);      /* screen or sub-section title, big numbers */
  --t-h4: 1.25rem;                         /* card or panel title */
  --t-lead: 1.125rem;                      /* intro paragraph, item name */
  --t-body: 1.0625rem;                     /* running text (body default) */
  --t-small: .9375rem;                     /* secondary text, buttons sm, chips */
  --t-caption: .8125rem;                   /* captions, metadata, legal */
  --t-micro: .75rem;                       /* overline, tags, badges */
  /* Caveat Brush accents (step numbers, kickers): their own three sizes */
  --t-script-1: 1.5rem;
  --t-script-2: 2rem;
  --t-script-3: 2.4rem;

  /* ---------- Space: base 4, modular for big gaps ---------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 40px; --s-7: 64px; --s-8: 96px;

  /* Side gutter and widths */
  --gx: 20px;
  --w-page: 1180px;    /* web sections */
  --w-app: 720px;      /* app screens, forms */
  --w-text: 62ch;      /* paragraphs */

  /* ---------- Radius: 4 levels + the bubble ---------- */
  --r-sm: 10px;        /* inside a padded box: thumbs, small icon buttons */
  --r-md: 16px;        /* inputs, menu items, small boxes */
  --r-lg: 24px;        /* cards and panels */
  --r-pill: 999px;     /* buttons, chips, tags */
  --r-device: 38px;    /* phone frames and posters */
  --r-bubble: 6px var(--r-lg) var(--r-lg) var(--r-lg); /* speech bubble (Lía, teacher voice) */

  /* ---------- Borders ---------- */
  --b-1: 1.5px solid var(--line);
  --b-2: 1.5px solid var(--line-strong);
}
@media (min-width: 720px) { :root { --gx: 32px; } }
@media (min-width: 1100px) { :root { --gx: 64px; } }

/* ================= Typography ================= */
.ac-h1 { font-size: var(--t-h1); font-weight: 900; letter-spacing: -0.03em; line-height: 1.04; }
.ac-h2 { font-size: var(--t-h2); font-weight: 900; letter-spacing: -0.026em; line-height: 1.08; }
.ac-h3 { font-size: var(--t-h3); font-weight: 900; letter-spacing: -0.02em; line-height: 1.12; }
.ac-h4 { font-size: var(--t-h4); font-weight: 800; letter-spacing: -0.012em; line-height: 1.25; }
.ac-h5 { font-size: var(--t-lead); font-weight: 800; letter-spacing: -0.006em; line-height: 1.3; }
.overline { font-size: var(--t-micro); }
.ac-lead { font-size: var(--t-lead); color: var(--c-muted); max-width: var(--w-text); }
.ac-body { font-size: var(--t-body); }
.ac-small { font-size: var(--t-small); }
.ac-caption { font-size: var(--t-caption); letter-spacing: .006em; line-height: 1.45; color: var(--c-muted); }
.ac-muted { color: var(--c-muted); }
.ac-num { font-variant-numeric: tabular-nums; }

/* ================= Layout ================= */
.ac-wrap { max-width: var(--w-page); margin-inline: auto; padding-inline: var(--gx); }
.ac-wrap--app { max-width: calc(var(--w-app) + 2 * var(--gx)); }
.ac-stack { display: grid; gap: var(--s-4); }
.ac-stack--sm { gap: var(--s-2); }
.ac-stack--lg { gap: var(--s-5); }
.ac-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

/* Section: dense by default, roomy for opening and closing blocks */
.ac-sec { padding-block: var(--s-7); }
.ac-sec--roomy { padding-block: var(--s-8) calc(var(--s-8) + var(--s-6)); }
.ac-sec--tight { padding-block: var(--s-6); }
.ac-sec--alt { background: var(--c-surface); border-block: 1px solid var(--line); }
.ac-sec__head { max-width: 760px; margin-bottom: var(--s-5); }
.ac-sec__head .ac-h2 { margin: var(--s-2) 0 var(--s-3); }

/* ================= Buttons =================
   Base .btn lives in tokens.css (pill, 48px, ink). Sizes: sm 40 · md 48 · lg 56 · kid 64. */
.btn--lg, .btn--big { min-height: 56px; padding: 12px 32px 13px; font-size: var(--t-lead); }
.btn--kid { min-height: 64px; padding: 16px 32px 17px; font-size: var(--t-h4); }
.btn--sm { font-size: var(--t-small); }
.btn--block { width: 100%; }
.btn--coral { --bg: var(--coral); color: var(--ink); }
.btn--coral:hover { --bg: var(--coral-hover); }
.btn--light { --bg: transparent; color: var(--cream); border-color: rgb(248 243 230 / .35); box-shadow: none; }
.btn--light:hover { --bg: rgb(248 243 230 / .1); }
.btn--icon { width: 48px; padding: 0; }
.btn--icon.btn--sm { width: 40px; }
.ac-link { background: none; border: 0; padding: var(--s-1) 2px; color: var(--c-link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ================= Cards ================= */
.ac-card {
  background: var(--c-surface); border: var(--b-1); border-radius: var(--r-lg);
  padding: 20px 24px 24px; box-shadow: var(--shadow-1); color: var(--c-text);
}
.ac-card > * + * { margin-top: var(--s-2); }
.ac-card.ac-stack > * + * { margin-top: 0; }
.ac-card--note { background: var(--c-note-soft); border-color: transparent; box-shadow: none; }
.ac-card--quiet { background: var(--c-surface-2); border-color: transparent; box-shadow: none; }
.ac-card--bubble { border-radius: var(--r-bubble); }
.ac-card--link { display: block; text-decoration: none; cursor: pointer; transition: transform 90ms var(--ease-snap), box-shadow 180ms var(--ease-out); }
.ac-card--link:hover { box-shadow: var(--shadow-2); }
.ac-card--link:active { transform: scale(.985); }

/* Media card (activities): 8px frame, so the image radius is 24 - 8 = 16 */
.ac-tile {
  display: grid; gap: var(--s-2); padding: var(--s-2) var(--s-2) 16px; border-radius: var(--r-lg);
  background: var(--c-surface); border: var(--b-1); box-shadow: var(--shadow-1);
  color: var(--c-text); text-decoration: none;
  transition: transform 90ms var(--ease-snap), box-shadow 180ms var(--ease-out);
}
.ac-tile:hover { box-shadow: var(--shadow-2); }
.ac-tile:active { transform: scale(.985); }
.ac-tile__media { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-md); object-fit: cover; background: var(--c-surface-2); }
.ac-tile__body { display: grid; gap: 2px; padding: 0 var(--s-2); line-height: 1.25; }
.ac-tile__body b { font-size: var(--t-lead); }
.ac-tile__body small { color: var(--c-muted); font-weight: 600; font-size: var(--t-small); }
.ac-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }

/* ================= Chips and tags ================= */
.ac-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px 9px;
  border-radius: var(--r-pill); border: var(--b-2); background: var(--c-surface);
  font-weight: 700; font-size: var(--t-small); color: var(--c-text); cursor: pointer;
  transition: background-color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}
.ac-chip:hover { background: var(--c-ok-soft); }
.ac-chip[aria-pressed="true"] { background: var(--c-action); color: var(--cream); border-color: var(--c-action); }
.ac-tag {
  --tag: var(--sage);
  display: inline-block; padding: 2px 8px 3px; border-radius: var(--r-pill);
  font-size: var(--t-micro); font-weight: 800; color: var(--ink);
  background: color-mix(in srgb, var(--tag) 45%, var(--paper));
}
.ac-tag--curriculum { --tag: var(--lilac); }
.ac-tag--warn { --tag: var(--coral); }
.ac-tag--note { --tag: var(--mustard); }
.ac-tag--info { --tag: var(--sky); }

/* ================= Forms ================= */
.ac-field { display: grid; gap: 8px; font-weight: 800; font-size: var(--t-small); }
.ac-field__hint { font-weight: 600; font-size: var(--t-caption); color: var(--c-muted); }
.ac-input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--r-md); border: var(--b-2);
  background: var(--c-surface); color: var(--c-text); font: inherit; font-size: var(--t-body); font-weight: 500; line-height: 1.45;
  transition: border-color 140ms var(--ease-snap), box-shadow 140ms var(--ease-snap);
}
textarea.ac-input { min-height: 120px; resize: vertical; }
.ac-input:focus { outline: none; border-color: var(--c-ok); box-shadow: 0 0 0 3px var(--c-ok-soft); }
.ac-field.is-error .ac-input { border-color: var(--coral); background: var(--c-warn-soft); }
.ac-field.is-error .ac-field__hint { color: var(--c-warn); }
/* Password: every password field gets a Show/Hide button */
.ac-pw { position: relative; display: block; }
.ac-pw .ac-input { padding-right: 120px; }
.ac-pw__btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--c-link);
  font: inherit; font-size: var(--t-small); font-weight: 800; cursor: pointer;
}
.ac-pw__btn:hover { background: var(--c-ok-soft); }

/* ================= Alerts ================= */
.ac-alert {
  display: flex; gap: var(--s-3); align-items: flex-start; padding: 16px 16px 17px;
  border-radius: var(--r-md); background: var(--c-info-soft); color: var(--c-text); font-size: var(--t-small);
}
.ac-alert .icon { margin-top: 2px; }
.ac-alert--ok { background: var(--c-ok-soft); }
.ac-alert--warn { background: var(--c-warn-soft); }
.ac-alert--note { background: var(--c-note-soft); }
