/*
 * Enspire Design System: base components.
 * From the component bundle of the design system (Enspire Design System 2.0), with the font variable renamed to
 * --es-font-text and the easing to --es-ease-standard. Only tokens are used, never raw values.
 * Markup: see modules/design-system/README.md and the style guide (Enspire > Design System > Style guide).
 */


/* ---------- Button ---------- */
.es-btn {
  --b: var(--es-neutral); --bh: var(--es-neutral-hover);
  --c: var(--es-neutral-content); --ch: var(--es-neutral-content-hover);
  --s: var(--es-neutral-soft); --su: var(--es-neutral-surface); --st: var(--es-neutral-strong);
  --icon: 20px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--es-space-xs);
  box-sizing: border-box;
  height: var(--es-control-height-md);
  padding: 0 var(--es-space-md);
  border: var(--es-border-width) solid transparent;
  border-radius: var(--es-control-radius);
  font-family: var(--es-font-text); font-size: 1rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  background: var(--b); color: var(--c);
  transition: background-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              border-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-btn__icon { display: inline-flex; flex: none; }
.es-btn__icon svg { width: var(--icon); height: var(--icon); }

.es-btn--sm { height: var(--es-control-height-sm); padding: 0 var(--es-space-sm); font-size: 0.875rem; gap: var(--es-space-2xs); --icon: 16px; }
.es-btn--md { height: var(--es-control-height-md); padding: 0 var(--es-space-md); font-size: 1rem; --icon: 20px; }
.es-btn--lg { height: var(--es-control-height-lg); padding: 0 var(--es-space-lg); font-size: 1rem; --icon: 20px; }

.es-btn--primary   { --b: var(--es-primary);   --bh: var(--es-primary-hover);   --c: var(--es-primary-content);   --ch: var(--es-primary-content-hover);   --s: var(--es-primary-soft);   --su: var(--es-primary-surface);   --st: var(--es-primary-strong); }
.es-btn--secondary { --b: var(--es-secondary); --bh: var(--es-secondary-hover); --c: var(--es-secondary-content); --ch: var(--es-secondary-content-hover); --s: var(--es-secondary-soft); --su: var(--es-secondary-surface); --st: var(--es-secondary-strong); }
.es-btn--accent    { --b: var(--es-accent);    --bh: var(--es-accent-hover);    --c: var(--es-accent-content);    --ch: var(--es-accent-content-hover);    --s: var(--es-accent-soft);    --su: var(--es-accent-surface);    --st: var(--es-accent-strong); }
.es-btn--info      { --b: var(--es-info);      --bh: var(--es-info-hover);      --c: var(--es-info-content);      --ch: var(--es-info-content-hover);      --s: var(--es-info-soft);      --su: var(--es-info-surface);      --st: var(--es-info-strong); }
.es-btn--success   { --b: var(--es-success);   --bh: var(--es-success-hover);   --c: var(--es-success-content);   --ch: var(--es-success-content-hover);   --s: var(--es-success-soft);   --su: var(--es-success-surface);   --st: var(--es-success-strong); }
.es-btn--warning   { --b: var(--es-warning);   --bh: var(--es-warning-hover);   --c: var(--es-warning-content);   --ch: var(--es-warning-content-hover);   --s: var(--es-warning-soft);   --su: var(--es-warning-surface);   --st: var(--es-warning-strong); }
.es-btn--error     { --b: var(--es-error);     --bh: var(--es-error-hover);     --c: var(--es-error-content);     --ch: var(--es-error-content-hover);     --s: var(--es-error-soft);     --su: var(--es-error-surface);     --st: var(--es-error-strong); }
.es-btn--neutral   { --b: var(--es-neutral);   --bh: var(--es-neutral-hover);   --c: var(--es-neutral-content);   --ch: var(--es-neutral-content-hover);   --s: var(--es-neutral-soft);   --su: var(--es-neutral-surface);   --st: var(--es-neutral-strong); }

.es-btn--fill    { background: var(--b); color: var(--c); }
.es-btn--fill:hover, .es-btn--fill:active { background: var(--bh); color: var(--ch); }
.es-btn--soft    { background: var(--s); color: var(--st); }
.es-btn--soft:hover, .es-btn--soft:active { background: var(--su); }
.es-btn--outline { background: transparent; color: var(--st); border-color: var(--st); }
.es-btn--outline:hover, .es-btn--outline:active { background: var(--b); color: var(--c); border-color: var(--b); }
.es-btn--ghost   { background: transparent; color: var(--st); }
.es-btn--ghost:hover, .es-btn--ghost:active { background: var(--s); }

.es-btn:focus-visible { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); }

.es-btn:disabled, .es-btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: color-mix(in oklch, var(--es-base-content) 8%, transparent);
  color: color-mix(in oklch, var(--es-base-content) 40%, transparent);
  border-color: transparent;
}
.es-btn--outline:disabled, .es-btn--outline[aria-disabled="true"] { background: transparent; border-color: color-mix(in oklch, var(--es-base-content) 20%, transparent); }
.es-btn--ghost:disabled, .es-btn--ghost[aria-disabled="true"] { background: transparent; }

@media (pointer: coarse) {
  .es-btn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, var(--es-touch-target)); transform: translateY(-50%); }
}

/* ---------- Icon ---------- */
.es-icon {
  --b: var(--es-neutral); --bh: var(--es-neutral-hover);
  --c: var(--es-neutral-content); --s: var(--es-neutral-soft); --su: var(--es-neutral-surface); --st: var(--es-neutral-strong);
  --box: var(--es-control-height-md);
  --icon: 20px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  box-sizing: border-box;
  margin: 0; padding: 0;
  border: var(--es-border-width) solid transparent;
  border-radius: var(--es-control-radius);
  background: transparent; color: var(--st);
  font: inherit;
  transition: background-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              border-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-icon svg { width: var(--icon); height: var(--icon); display: block; }

/* mărimi: pătratul e control-height-*, iconița 16 / 20 / 24 */
.es-icon--sm { --box: var(--es-control-height-sm); --icon: 16px; }
.es-icon--md { --box: var(--es-control-height-md); --icon: 20px; }
.es-icon--lg { --box: var(--es-control-height-lg); --icon: 24px; }

.es-icon--fill, .es-icon--outline, .es-icon--soft { width: var(--box); height: var(--box); }
.es-icon--plain { width: var(--icon); height: var(--icon); }

/* tonuri */
.es-icon--primary   { --b: var(--es-primary);   --bh: var(--es-primary-hover);   --c: var(--es-primary-content);   --s: var(--es-primary-soft);   --su: var(--es-primary-surface);   --st: var(--es-primary-strong); }
.es-icon--secondary { --b: var(--es-secondary); --bh: var(--es-secondary-hover); --c: var(--es-secondary-content); --s: var(--es-secondary-soft); --su: var(--es-secondary-surface); --st: var(--es-secondary-strong); }
.es-icon--accent    { --b: var(--es-accent);    --bh: var(--es-accent-hover);    --c: var(--es-accent-content);    --s: var(--es-accent-soft);    --su: var(--es-accent-surface);    --st: var(--es-accent-strong); }
.es-icon--info      { --b: var(--es-info);      --bh: var(--es-info-hover);      --c: var(--es-info-content);      --s: var(--es-info-soft);      --su: var(--es-info-surface);      --st: var(--es-info-strong); }
.es-icon--success   { --b: var(--es-success);   --bh: var(--es-success-hover);   --c: var(--es-success-content);   --s: var(--es-success-soft);   --su: var(--es-success-surface);   --st: var(--es-success-strong); }
.es-icon--warning   { --b: var(--es-warning);   --bh: var(--es-warning-hover);   --c: var(--es-warning-content);   --s: var(--es-warning-soft);   --su: var(--es-warning-surface);   --st: var(--es-warning-strong); }
.es-icon--error     { --b: var(--es-error);     --bh: var(--es-error-hover);     --c: var(--es-error-content);     --s: var(--es-error-soft);     --su: var(--es-error-surface);     --st: var(--es-error-strong); }
.es-icon--neutral   { --b: var(--es-neutral);   --bh: var(--es-neutral-hover);   --c: var(--es-neutral-content);   --s: var(--es-neutral-soft);   --su: var(--es-neutral-surface);   --st: var(--es-neutral-strong); }

/* variante */
.es-icon--fill    { background: var(--b); color: var(--c); }
.es-icon--soft    { background: var(--s); color: var(--st); }
.es-icon--outline { background: transparent; color: var(--st); border-color: color-mix(in oklch, var(--st) 28%, transparent); }
.es-icon--plain   { background: transparent; color: var(--st); border-color: transparent; }

/* interactiv: butonul are hover și focus, iconița decorativă nu */
button.es-icon, a.es-icon { cursor: pointer; text-decoration: none; }
.es-icon--fill.es-icon--interactive:hover    { background: var(--bh); color: var(--c); }
.es-icon--soft.es-icon--interactive:hover    { background: var(--su); }
.es-icon--outline.es-icon--interactive:hover { background: transparent; color: var(--b); border-color: var(--b); }
.es-icon--plain.es-icon--interactive:hover   { background: var(--s); }

/* formă: pătrat cu radius-md (implicit) sau cerc cu radius-full. Plain nu are container, deci nu se aplică. */
.es-icon--circle:not(.es-icon--plain) { border-radius: var(--es-radius-full); }
.es-icon--interactive:focus-visible { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); }

.es-icon:disabled, .es-icon[aria-disabled="true"] {
  cursor: not-allowed;
  background: color-mix(in oklch, var(--es-base-content) 8%, transparent);
  color: color-mix(in oklch, var(--es-base-content) 40%, transparent);
  border-color: transparent;
}
.es-icon--plain:disabled, .es-icon--plain[aria-disabled="true"] { background: transparent; }
.es-icon--outline:disabled, .es-icon--outline[aria-disabled="true"] { background: transparent; border-color: color-mix(in oklch, var(--es-base-content) 20%, transparent); }

/* ---------- Status (punct + text) ---------- */
.es-status { --b: var(--es-neutral); --s: var(--es-neutral-soft); --st: var(--es-neutral-strong); --d: var(--es-neutral-strong);
  display: inline-flex; align-items: center; gap: var(--es-space-xs);
  font-family: var(--es-font-text); font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--st);
}
.es-status--primary   { --b: var(--es-primary);   --s: var(--es-primary-soft);   --st: var(--es-primary-strong); }
.es-status--secondary { --b: var(--es-secondary); --s: var(--es-secondary-soft); --st: var(--es-secondary-strong); }
.es-status--accent    { --b: var(--es-accent);    --s: var(--es-accent-soft);    --st: var(--es-accent-strong); }
.es-status--info      { --b: var(--es-info);      --s: var(--es-info-soft);      --st: var(--es-info-strong); }
.es-status--success   { --b: var(--es-success);   --s: var(--es-success-soft);   --st: var(--es-success-strong); }
.es-status--warning   { --b: var(--es-warning);   --s: var(--es-warning-soft);   --st: var(--es-warning-strong); }
.es-status--error     { --b: var(--es-error);     --s: var(--es-error-soft);     --st: var(--es-error-strong); }
.es-status--neutral   { --b: var(--es-neutral);   --s: var(--es-neutral-soft);   --st: var(--es-neutral-strong); }
.es-status__dot { flex: none; width: 8px; height: 8px; border-radius: var(--es-radius-full); background: var(--b); box-shadow: 0 0 0 3px var(--s); }
.es-status__text { min-width: 0; }

/* ---------- Badge ---------- */
/* static: nu e control, deci nu are înălțime fixă. Radius-ul e rolul badge (xs în preset-ul soft). */
.es-badge {
  --b: var(--es-neutral); --c: var(--es-neutral-content); --s: var(--es-neutral-soft); --st: var(--es-neutral-strong);
  display: inline-flex; align-items: center; gap: var(--es-space-2xs);
  box-sizing: border-box;
  padding: var(--es-space-3xs) var(--es-space-xs);
  border-radius: var(--es-radius-xs);
  font-family: var(--es-font-text); font-size: 0.75rem; font-weight: 600; line-height: 1.4;
  white-space: nowrap; vertical-align: middle;
  background: var(--b); color: var(--c);
}
.es-badge__icon { display: inline-flex; flex: none; }
.es-badge__icon svg { width: 14px; height: 14px; display: block; }

.es-badge--primary   { --b: var(--es-primary);   --c: var(--es-primary-content);   --s: var(--es-primary-soft);   --st: var(--es-primary-strong); }
.es-badge--secondary { --b: var(--es-secondary); --c: var(--es-secondary-content); --s: var(--es-secondary-soft); --st: var(--es-secondary-strong); }
.es-badge--accent    { --b: var(--es-accent);    --c: var(--es-accent-content);    --s: var(--es-accent-soft);    --st: var(--es-accent-strong); }
.es-badge--info      { --b: var(--es-info);      --c: var(--es-info-content);      --s: var(--es-info-soft);      --st: var(--es-info-strong); }
.es-badge--success   { --b: var(--es-success);   --c: var(--es-success-content);   --s: var(--es-success-soft);   --st: var(--es-success-strong); }
.es-badge--warning   { --b: var(--es-warning);   --c: var(--es-warning-content);   --s: var(--es-warning-soft);   --st: var(--es-warning-strong); }
.es-badge--error     { --b: var(--es-error);     --c: var(--es-error-content);     --s: var(--es-error-soft);     --st: var(--es-error-strong); }
.es-badge--neutral   { --b: var(--es-neutral);   --c: var(--es-neutral-content);   --s: var(--es-neutral-soft);   --st: var(--es-neutral-strong); }

.es-badge--solid { background: var(--b); color: var(--c); }
.es-badge--soft  { background: var(--s); color: var(--st); }

/* ---------- Tag ---------- */
/* pill (radius-full). Apăsabil, ștergibil sau selectabil. Text centrat vertical și orizontal: line-height fix, fără font: inherit. */
.es-tag {
  --b: var(--es-neutral); --c: var(--es-neutral-content); --s: var(--es-neutral-soft); --su: var(--es-neutral-surface); --st: var(--es-neutral-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--es-space-2xs);
  box-sizing: border-box;
  margin: 0;
  padding: 0 var(--es-space-sm);
  height: 28px;
  border: var(--es-border-width) solid transparent;
  border-radius: var(--es-radius-full);
  font-family: var(--es-font-text); font-size: 0.875rem; font-weight: 500; line-height: 1;
  text-align: center; white-space: nowrap; vertical-align: middle;
  background: var(--s); color: var(--st);
  transition: background-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
              color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-tag--primary   { --b: var(--es-primary); --c: var(--es-primary-content);   --s: var(--es-primary-soft);   --su: var(--es-primary-surface);   --st: var(--es-primary-strong); }
.es-tag--secondary { --b: var(--es-secondary); --c: var(--es-secondary-content); --s: var(--es-secondary-soft); --su: var(--es-secondary-surface); --st: var(--es-secondary-strong); }
.es-tag--accent    { --b: var(--es-accent); --c: var(--es-accent-content);    --s: var(--es-accent-soft);    --su: var(--es-accent-surface);    --st: var(--es-accent-strong); }
.es-tag--info      { --b: var(--es-info); --c: var(--es-info-content);      --s: var(--es-info-soft);      --su: var(--es-info-surface);      --st: var(--es-info-strong); }
.es-tag--success   { --b: var(--es-success); --c: var(--es-success-content);   --s: var(--es-success-soft);   --su: var(--es-success-surface);   --st: var(--es-success-strong); }
.es-tag--warning   { --b: var(--es-warning); --c: var(--es-warning-content);   --s: var(--es-warning-soft);   --su: var(--es-warning-surface);   --st: var(--es-warning-strong); }
.es-tag--error     { --b: var(--es-error); --c: var(--es-error-content);     --s: var(--es-error-soft);     --su: var(--es-error-surface);     --st: var(--es-error-strong); }
.es-tag--neutral   { --b: var(--es-neutral); --c: var(--es-neutral-content);   --s: var(--es-neutral-soft);   --su: var(--es-neutral-surface);   --st: var(--es-neutral-strong); }

/* variante: solid (fundal plin, text pe ton), soft (implicit), outline */
.es-tag--solid { background: var(--b); color: var(--c); }
.es-tag--solid.es-tag--interactive:hover { background: var(--st); }
.es-tag--solid.es-tag--selected { background: var(--st); color: var(--c); }

.es-tag--outline { background: transparent; border-color: var(--st); }
.es-tag--outline.es-tag--interactive:hover { background: var(--s); }

/* interactiv (apăsabil) */
button.es-tag, a.es-tag { cursor: pointer; text-decoration: none; }
.es-tag--interactive:hover { background: var(--su); }
.es-tag--outline.es-tag--interactive:hover { background: var(--s); }
.es-tag--interactive:focus-visible, .es-tag__remove:focus-visible { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); }

/* selectat: fundal surface, text strong */
.es-tag--selected { background: var(--su); color: var(--st); }
.es-tag--outline.es-tag--selected { background: var(--su); }

/* butonul de ștergere: iconiță, aceeași culoare ca textul */
/* cu „×”, padding-ul din dreapta scade, ca iconița să stea aproape de margine */
.es-tag--removable { padding-right: var(--es-space-2xs); }

.es-tag__remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin: 0 0 0 var(--es-space-3xs); padding: 0;
  border: 0; border-radius: var(--es-radius-full);
  background: transparent; color: inherit; cursor: pointer;
}
.es-tag__remove:hover { background: var(--su); }
/* pe fundal plin, hover-ul ×-ului e un ton transparent de culoarea textului, nu un fundal deschis */
.es-tag--solid .es-tag__remove:hover { background: color-mix(in oklch, var(--c) 22%, transparent); }
.es-tag__remove svg { width: 14px; height: 14px; display: block; }

.es-tag:disabled, .es-tag[aria-disabled="true"] {
  cursor: not-allowed;
  background: color-mix(in oklch, var(--es-base-content) 8%, transparent);
  color: color-mix(in oklch, var(--es-base-content) 40%, transparent);
  border-color: transparent;
}

/* zona de atingere minimă pe ecrane touch */
@media (pointer: coarse) {
  .es-tag__remove { position: relative; }
  .es-tag__remove::after { content: ""; position: absolute; inset: -12px; }
}

/* ---------- Feature (iconiță + titlu + text) ---------- */
.es-feature { display: flex; align-items: center; gap: var(--es-space-md); min-width: 0; font-family: var(--es-font-text); }
.es-feature__icon { flex: none; display: inline-flex; }
.es-feature__body { display: grid; gap: var(--es-space-3xs); min-width: 0; }
.es-feature__title { font-size: 1rem; line-height: 1.4; font-weight: 600; color: var(--es-base-content); }
.es-feature__text { font-size: 0.875rem; line-height: 1.5; color: var(--es-base-content-subtle); }

/* ---------- Formulare ---------- */
.es-field { display: grid; gap: var(--es-space-2xs); min-width: 0; font-family: var(--es-font-text); }
.es-field__control { min-width: 0; }
.es-field__label { font-size: 0.875rem; font-weight: 500; line-height: 1.4; color: var(--es-base-content); }
.es-field__req { color: var(--es-error-strong); }
.es-field__hint { font-size: 0.75rem; line-height: 1.4; color: var(--es-base-content-subtle); }
.es-field__error { display: flex; align-items: flex-start; gap: var(--es-space-2xs); font-size: 0.75rem; line-height: 1.4; color: var(--es-error-strong); }
.es-field__error svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

/* text: input, textarea, select */
.es-input {
  box-sizing: border-box; display: block; width: 100%; margin: 0;
  padding: 0 var(--es-space-sm);
  font-family: var(--es-font-text); font-size: 1rem; line-height: 1.5; color: var(--es-base-content);
  background: var(--es-base-bg);
  border: var(--es-border-width) solid var(--es-base-border);
  border-radius: var(--es-control-radius);
  transition: border-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-input::placeholder { color: var(--es-base-content-subtle); opacity: 1; }
.es-input--sm { height: var(--es-control-height-sm); padding: 0 var(--es-space-xs); font-size: 0.875rem; }
.es-input--md { height: var(--es-control-height-md); }
.es-input--lg { height: var(--es-control-height-lg); font-size: 1.125rem; }
.es-textarea { height: auto; min-height: 96px; padding: var(--es-space-sm); resize: vertical; }
.es-input:hover:not(:disabled) { border-color: var(--es-base-content-muted); }
.es-input:focus-visible { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); border-color: var(--es-primary); }
.es-input--invalid, .es-input--invalid:hover { border-color: var(--es-error); }
.es-input--invalid:focus-visible { outline-color: var(--es-error-strong); border-color: var(--es-error); }
.es-input:disabled { cursor: not-allowed; background: color-mix(in oklch, var(--es-base-content) 6%, transparent); color: color-mix(in oklch, var(--es-base-content) 40%, transparent); border-color: transparent; }

.es-select { position: relative; display: block; width: 100%; }
.es-select .es-input { padding-right: calc(var(--es-space-sm) * 2 + 16px); appearance: none; cursor: pointer; }
.es-select__chevron { position: absolute; right: var(--es-space-sm); top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--es-base-content-subtle); pointer-events: none; }
.es-select__chevron svg { width: 16px; height: 16px; display: block; }

/* alegere: checkbox, radio, switch */
.es-check { --box: 20px; position: relative; display: inline-flex; align-items: center; gap: var(--es-space-xs); cursor: pointer; font-family: var(--es-font-text); font-size: 1rem; line-height: 1.5; color: var(--es-base-content); }
.es-check--sm { --box: 16px; font-size: 0.875rem; }
.es-check--lg { --box: 24px; }
.es-check__input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.es-check__box {
  flex: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  width: var(--box); height: var(--box);
  background: var(--es-base-surface);
  border: var(--es-border-width) solid var(--es-base-border);
  border-radius: var(--es-radius-xs);
  color: var(--es-primary-content);
  transition: background-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1)), border-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-check__box svg { width: calc(var(--box) - 6px); height: calc(var(--box) - 6px); display: block; opacity: 0; }
.es-check__text { min-width: 0; }
.es-check:hover .es-check__box { border-color: var(--es-base-content-muted); }
.es-check__input:checked + .es-check__box { background: var(--es-primary); border-color: var(--es-primary); }
.es-check__input:checked + .es-check__box svg { opacity: 1; }
.es-check__input:focus-visible + .es-check__box { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); }
.es-check--invalid .es-check__box { border-color: var(--es-error); }
.es-check:has(.es-check__input:disabled) { cursor: not-allowed; color: color-mix(in oklch, var(--es-base-content) 40%, transparent); }
.es-check__input:disabled + .es-check__box { background: color-mix(in oklch, var(--es-base-content) 8%, transparent); border-color: transparent; }
.es-check__input:disabled:checked + .es-check__box { background: color-mix(in oklch, var(--es-base-content) 30%, transparent); }

.es-radio .es-check__box { border-radius: var(--es-radius-full); }
.es-radio .es-check__box::after { content: ""; width: calc(var(--box) * 0.5); height: calc(var(--box) * 0.5); border-radius: var(--es-radius-full); background: var(--es-primary); transform: scale(0); transition: transform var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1)); }
.es-radio .es-check__input:checked + .es-check__box { background: var(--es-base-surface); border-color: var(--es-primary); }
.es-radio .es-check__input:checked + .es-check__box::after { transform: scale(1); }
.es-radio .es-check__input:disabled:checked + .es-check__box { background: var(--es-base-surface); border-color: transparent; }
.es-radio .es-check__input:disabled:checked + .es-check__box::after { background: color-mix(in oklch, var(--es-base-content) 30%, transparent); }

.es-switch { --w: 36px; --h: 20px; }
.es-switch.es-check--sm { --w: 28px; --h: 16px; }
.es-switch.es-check--lg { --w: 44px; --h: 24px; }
.es-switch__track {
  position: relative; flex: none; box-sizing: border-box;
  width: var(--w); height: var(--h);
  background: color-mix(in oklch, var(--es-base-content) 22%, transparent);
  border-radius: var(--es-radius-full);
  transition: background-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: calc(var(--h) - 4px); height: calc(var(--h) - 4px);
  border-radius: var(--es-radius-full); background: var(--es-base-surface);
  transition: transform var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-switch .es-check__input:checked + .es-switch__track { background: var(--es-primary); }
.es-switch .es-check__input:checked + .es-switch__track::after { transform: translateX(calc(var(--w) - var(--h))); }
.es-switch .es-check__input:focus-visible + .es-switch__track { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); }
.es-switch .es-check__input:disabled + .es-switch__track { opacity: 0.4; }

/* ---------- Combobox ---------- */
.es-combo { position: relative; display: block; width: 100%; }
/* cât timp are focus, combo-ul e deasupra câmpurilor de sub el, ca lista să nu fie acoperită */
.es-combo:focus-within { z-index: 1; }
.es-combo .es-input { padding-right: calc(var(--es-space-sm) * 2 + 16px); cursor: text; }
.es-combo .es-select__chevron { right: var(--es-space-sm); }
.es-combo__list {
  position: absolute; top: calc(100% + var(--es-space-3xs)); left: 0; right: 0;
  box-sizing: border-box; margin: 0; padding: var(--es-space-2xs);
  list-style: none; display: grid; gap: 2px;
  max-height: 240px; overflow-y: auto;
  background: var(--es-base-surface);
  border: var(--es-border-width) solid var(--es-base-border);
  border-radius: var(--es-control-radius);
  box-shadow: var(--es-shadow-md);
  font-family: var(--es-font-text); font-size: 0.9375rem; line-height: 1.4;
}
.es-combo__option { padding: var(--es-space-xs) var(--es-space-sm); border-radius: var(--es-radius-sm); color: var(--es-base-content); cursor: pointer; user-select: none; }
.es-combo__option--active { background: var(--es-primary-soft); color: var(--es-primary-strong); }
.es-combo__option--selected { font-weight: 600; color: var(--es-primary-strong); }
.es-combo__option--disabled { color: color-mix(in oklch, var(--es-base-content) 40%, transparent); cursor: not-allowed; }
.es-combo__empty { padding: var(--es-space-xs) var(--es-space-sm); color: var(--es-base-content-subtle); }

/* ---------- InputAction (câmp cu buton înăuntru) ---------- */
.es-input-action {
  --h: var(--es-control-height-lg);
  box-sizing: border-box; display: flex; align-items: center; gap: var(--es-space-2xs);
  width: 100%; height: var(--h); padding: var(--es-space-2xs);
  background: var(--es-base-surface);
  border: var(--es-border-width) solid var(--es-base-border);
  border-radius: var(--es-control-radius);
  font-family: var(--es-font-text);
  transition: border-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-input-action:hover:not(.es-input-action--disabled) { border-color: var(--es-base-content-muted); }
.es-input-action:focus-within { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); border-color: var(--es-primary); }
.es-input-action--invalid, .es-input-action--invalid:hover { border-color: var(--es-error); }
.es-input-action--invalid:focus-within { outline-color: var(--es-error-strong); border-color: var(--es-error); }
.es-input-action--disabled { background: color-mix(in oklch, var(--es-base-content) 6%, transparent); border-color: transparent; }

.es-input-action__field {
  flex: 1 1 auto; min-width: 0; height: 100%; box-sizing: border-box; margin: 0;
  padding: 0 var(--es-space-md);
  border: 0; outline: none; background: transparent;
  font-family: inherit; font-size: 1.125rem; line-height: 1.5; color: var(--es-base-content);
}
.es-input-action__field::placeholder { color: var(--es-base-content-subtle); opacity: 1; }
.es-input-action__field:disabled { cursor: not-allowed; color: color-mix(in oklch, var(--es-base-content) 40%, transparent); }

.es-input-action__action { flex: none; display: inline-flex; align-items: center; }
.es-input-action__action .es-btn {
  height: calc(var(--h) - 2 * var(--es-space-2xs) - 2 * var(--es-border-width));
  border-radius: var(--es-control-radius);
  padding-left: var(--es-space-md); padding-right: var(--es-space-md);
}

/* layout 'side': câmpul și butonul sunt alăturate, fiecare cu propriul contur */
.es-input-action--side { background: transparent; border: 0; border-radius: 0; padding: 0; gap: var(--es-space-xs); }
.es-input-action--side:hover:not(.es-input-action--disabled), .es-input-action--side:focus-within { border-color: transparent; }
.es-input-action--side:focus-within { outline: none; }
.es-input-action--side .es-input-action__field {
  background: var(--es-base-surface);
  border: var(--es-border-width) solid var(--es-base-border);
  border-radius: var(--es-control-radius);
  padding: 0 var(--es-space-md);
  transition: border-color var(--es-duration-fast, 120ms) var(--es-ease-standard, cubic-bezier(0.2, 0, 0, 1));
}
.es-input-action--side .es-input-action__field:hover:not(:disabled) { border-color: var(--es-base-content-muted); }
.es-input-action--side .es-input-action__field:focus-visible { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); border-color: var(--es-primary); }
.es-input-action--side.es-input-action--invalid .es-input-action__field, .es-input-action--side.es-input-action--invalid .es-input-action__field:hover { border-color: var(--es-error); }
.es-input-action--side.es-input-action--invalid .es-input-action__field:focus-visible { outline-color: var(--es-error-strong); border-color: var(--es-error); }
.es-input-action--side.es-input-action--disabled .es-input-action__field { background: color-mix(in oklch, var(--es-base-content) 6%, transparent); border-color: transparent; }
.es-input-action--side .es-input-action__action .es-btn { height: var(--h); border-radius: var(--es-control-radius); }

/* ---------- Consent (checkbox cu text de consimțământ) ---------- */
.es-consent-wrap { display: grid; gap: var(--es-space-2xs); min-width: 0; }
.es-consent { align-items: flex-start; font-size: 0.875rem; line-height: 1.5; }
.es-consent .es-check__box { margin-top: 2px; }
.es-consent__text { min-width: 0; color: var(--es-base-content-muted); }
.es-consent__text a { color: var(--es-primary-strong); text-decoration: underline; text-underline-offset: 2px; border-radius: var(--es-radius-xs); }
.es-consent__text a:focus-visible { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); }

/* ---------- Alert ---------- */
/* Background {tone}-soft, border {tone}-surface, icon and title {tone}-strong. Always icon + text, never color alone. */
.es-alert {
  --s: var(--es-info-soft); --su: var(--es-info-surface); --st: var(--es-info-strong);
  display: flex; align-items: flex-start; gap: var(--es-space-sm);
  box-sizing: border-box;
  padding: var(--es-space-sm) var(--es-space-md);
  border: var(--es-border-width) solid var(--su);
  border-radius: var(--es-radius-md);
  background: var(--s); color: var(--es-base-content);
  font-family: var(--es-font-text); font-size: 0.875rem; line-height: 1.5;
}
.es-alert__icon { flex: none; display: inline-flex; color: var(--st); margin-top: 1px; }
.es-alert__icon svg { width: 20px; height: 20px; display: block; }
.es-alert__body { display: grid; gap: var(--es-space-3xs); min-width: 0; }
.es-alert__title { font-weight: 600; color: var(--st); }
.es-alert a { color: var(--st); text-decoration: underline; }
.es-alert--primary   { --s: var(--es-primary-soft);   --su: var(--es-primary-surface);   --st: var(--es-primary-strong); }
.es-alert--secondary { --s: var(--es-secondary-soft); --su: var(--es-secondary-surface); --st: var(--es-secondary-strong); }
.es-alert--accent    { --s: var(--es-accent-soft);    --su: var(--es-accent-surface);    --st: var(--es-accent-strong); }
.es-alert--info      { --s: var(--es-info-soft);      --su: var(--es-info-surface);      --st: var(--es-info-strong); }
.es-alert--success   { --s: var(--es-success-soft);   --su: var(--es-success-surface);   --st: var(--es-success-strong); }
.es-alert--warning   { --s: var(--es-warning-soft);   --su: var(--es-warning-surface);   --st: var(--es-warning-strong); }
.es-alert--error     { --s: var(--es-error-soft);     --su: var(--es-error-surface);     --st: var(--es-error-strong); }
.es-alert--neutral   { --s: var(--es-neutral-soft);   --su: var(--es-neutral-surface);   --st: var(--es-neutral-strong); }

/* ---------- Card ---------- */
.es-card {
  box-sizing: border-box; display: grid; gap: var(--es-space-sm); min-width: 0;
  padding: var(--es-card-padding-md);
  border: var(--es-border-width) solid var(--es-base-border);
  border-radius: var(--es-radius-lg);
  background: var(--es-base-surface); color: var(--es-base-content);
}
.es-card--sm { padding: var(--es-card-padding-sm); }
.es-card--lg { padding: var(--es-card-padding-lg); }
.es-card--raised { border-color: transparent; background: var(--es-base-bg); box-shadow: var(--es-shadow-md); }
.es-card__title { margin: 0; font-family: var(--es-heading-md-family); font-size: var(--es-heading-md-size); line-height: var(--es-heading-md-line-height); font-weight: var(--es-heading-md-weight); }
.es-card__text { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--es-base-content-muted); }

/* ---------- Theme toggle (dark mode) ---------- */
.es-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  box-sizing: border-box; width: var(--es-control-height-sm); height: var(--es-control-height-sm);
  margin: 0; padding: 0;
  border: var(--es-border-width) solid var(--es-base-border); border-radius: var(--es-control-radius);
  background: var(--es-base-surface); color: var(--es-base-content);
  cursor: pointer;
  transition: border-color var(--es-duration-fast) var(--es-ease-standard), color var(--es-duration-fast) var(--es-ease-standard);
}
.es-theme-toggle:hover { border-color: var(--es-base-content-muted); }
.es-theme-toggle:focus-visible { outline: var(--es-focus-ring-width) solid var(--es-primary-strong); outline-offset: var(--es-focus-ring-offset); }
.es-theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.es-theme-toggle__moon { display: none; }
.es-theme-toggle[aria-pressed="true"] .es-theme-toggle__sun { display: none; }
.es-theme-toggle[aria-pressed="true"] .es-theme-toggle__moon { display: block; }
