/* Festou Design System — componentes MD3.
   Todas as classes usam o prefixo fs- e dependem de tokens.css.
   Origem: projeto de Design da Festou (components/bundle.css). */
.fs-root, .fs-root * { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--on-surface); font-family: var(--font-text); font-size: 14px; line-height: 20px; letter-spacing: .25px; }
.fs-only-dark { display: none; }
[data-theme="dark"] .fs-only-dark { display: inline-block; }
[data-theme="dark"] .fs-only-light { display: none; }
.fs-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-4); }
.fs-col { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); }
.fs-icon[hidden] { display: none; }
.fs-icon { display: inline-block; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fs-state { position: relative; overflow: hidden; isolation: isolate; }
.fs-state::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; pointer-events: none; transition: opacity .12s linear; z-index: -1; }
.fs-state:hover:not(:disabled)::before { opacity: var(--state-hover); }
.fs-state:focus-visible::before { opacity: var(--state-focus); }
.fs-state:active:not(:disabled)::before { opacity: var(--state-pressed); }
:is(button, a, input, select, [tabindex]):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* Button */
.fs-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-6); border: 0; border-radius: var(--corner-full); font-family: var(--font-text); font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; cursor: pointer; text-decoration: none; background: transparent; color: var(--primary); }
.fs-btn--filled { background: var(--primary); color: var(--on-primary); }
.fs-btn--brand { background: var(--secondary-container); color: var(--on-secondary-container); }
.fs-btn--tonal { background: var(--primary-container); color: var(--on-primary-container); }
.fs-btn--outlined { box-shadow: inset 0 0 0 1px var(--outline); }
.fs-btn--text { padding: 0 var(--space-3); }
.fs-btn--elevated { background: var(--surface-container-low); box-shadow: var(--elevation-1); }
.fs-btn--large { min-height: 48px; padding: 0 var(--space-8); font-size: 16px; line-height: 24px; }
.fs-btn--full { width: 100%; }
.fs-btn:disabled { background: color-mix(in srgb, var(--on-surface) 12%, transparent); color: color-mix(in srgb, var(--on-surface) 38%, transparent); box-shadow: none; cursor: not-allowed; }
.fs-btn--text:disabled { background: transparent; }
.fs-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--corner-full); background: transparent; color: var(--on-surface-variant); cursor: pointer; }
.fs-iconbtn--filled { background: var(--primary); color: var(--on-primary); }
.fs-iconbtn--tonal { background: var(--primary-container); color: var(--on-primary-container); }
.fs-iconbtn--outlined { box-shadow: inset 0 0 0 1px var(--outline); }
.fs-iconbtn:disabled { color: color-mix(in srgb, var(--on-surface) 38%, transparent); background: transparent; box-shadow: none; cursor: not-allowed; }

/* Campos */
.fs-field { --fs-field-bg: var(--surface); position: relative; display: block; width: 100%; padding-top: 6px; }
.fs-field__box { position: relative; display: flex; align-items: center; min-height: 56px; border-radius: var(--corner-xs); box-shadow: inset 0 0 0 1px var(--outline); background: var(--fs-field-bg); }
.fs-field__box:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.fs-field--error .fs-field__box { box-shadow: inset 0 0 0 1px var(--error); }
.fs-field--error .fs-field__box:focus-within { box-shadow: inset 0 0 0 2px var(--error); }
.fs-field__input { flex: 1; min-width: 0; width: 100%; height: 56px; padding: 0 var(--space-4); border: 0; outline: 0; background: transparent; color: var(--on-surface); font-family: var(--font-text); font-size: 16px; letter-spacing: .5px; appearance: none; }
.fs-field__input:focus-visible { outline: 0; }
.fs-field__input::placeholder { color: transparent; }
.fs-field__lead { margin-left: var(--space-3); margin-right: calc(var(--space-1) * -2); color: var(--on-surface-variant); }
.fs-field__chev { position: absolute; right: var(--space-3); color: var(--on-surface-variant); pointer-events: none; }
.fs-field__label { position: absolute; left: var(--space-3); top: 0; padding: 0 var(--space-1); background: var(--fs-field-bg); color: var(--on-surface-variant); font-size: 12px; line-height: 16px; letter-spacing: .4px; pointer-events: none; transition: all .12s ease; transform: translateY(-14px); }
.fs-field__input:focus ~ .fs-field__label { color: var(--primary); }
.fs-field__input:placeholder-shown:not(:focus) ~ .fs-field__label { transform: translateY(14px); font-size: 16px; line-height: 24px; letter-spacing: .5px; background: transparent; }
.fs-field--error .fs-field__label, .fs-field--error .fs-field__input:focus ~ .fs-field__label { color: var(--error); }
.fs-field__support { display: flex; gap: var(--space-1); align-items: center; padding: var(--space-1) var(--space-4) 0; color: var(--on-surface-variant); font-size: 12px; line-height: 16px; letter-spacing: .4px; }
.fs-field--error .fs-field__support { color: var(--error); }
.fs-field--disabled { opacity: var(--disabled-content); }

/* Seleção */
.fs-check { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 40px; color: var(--on-surface); cursor: pointer; font-size: 14px; }
.fs-check input { appearance: none; flex: none; margin: 0; width: 18px; height: 18px; border: 2px solid var(--on-surface-variant); border-radius: 2px; background: transparent no-repeat center; cursor: pointer; display: grid; place-content: center; }
.fs-check input::after { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--on-primary); border-bottom: 2px solid var(--on-primary); transform: translateY(-1px) rotate(-45deg); opacity: 0; }
.fs-check input:checked { background-color: var(--primary); border-color: var(--primary); }
.fs-check input:checked::after { opacity: 1; }
.fs-check input[type=radio] { border-radius: 50%; width: 20px; height: 20px; }
.fs-check input[type=radio]::after { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--primary); transform: none; }
.fs-check input[type=radio]:checked { background-color: transparent; }
.fs-check input:disabled { opacity: var(--disabled-content); cursor: not-allowed; }
.fs-switch { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 40px; font-size: 14px; color: var(--on-surface); cursor: pointer; }
.fs-switch input { appearance: none; margin: 0; position: relative; flex: none; width: 52px; height: 32px; border: 2px solid var(--outline); border-radius: var(--corner-full); background: var(--surface-container-highest); cursor: pointer; transition: background .12s; }
.fs-switch input::after { content: ""; position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--outline); transition: all .12s ease; }
.fs-switch input:checked { background: var(--primary); border-color: var(--primary); }
.fs-switch input:checked::after { left: 22px; top: 2px; width: 24px; height: 24px; background: var(--on-primary); }
.fs-switch input:disabled { opacity: var(--disabled-content); cursor: not-allowed; }
.fs-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 0 var(--space-4); border: 0; border-radius: var(--corner-sm); box-shadow: inset 0 0 0 1px var(--outline); background: transparent; color: var(--on-surface-variant); font-family: var(--font-text); font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; cursor: pointer; }
.fs-chip[aria-pressed="true"] { background: var(--primary-container); color: var(--on-primary-container); box-shadow: none; padding-left: var(--space-2); }

/* Feedback */
.fs-badge { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 24px; padding: 0 var(--space-2) 0 6px; border-radius: var(--corner-full); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px; white-space: nowrap; }
.fs-badge--paid { background: var(--success-container); color: var(--on-success-container); }
.fs-badge--pending, .fs-badge--low { background: var(--warning-container); color: var(--on-warning-container); }
.fs-badge--cancelled { background: var(--error-container); color: var(--on-error-container); }
.fs-badge--info { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.fs-badge--draft { background: var(--surface-container-highest); color: var(--on-surface-variant); }
.fs-snackbar { display: flex; align-items: center; gap: var(--space-2); min-height: 48px; max-width: 480px; padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4); border-radius: var(--corner-sm); background: var(--inverse-surface); color: var(--inverse-on-surface); box-shadow: var(--elevation-3); }
.fs-snackbar__text { flex: 1; padding: var(--space-2) 0; }
.fs-snackbar .fs-btn { color: var(--inverse-primary); }
.fs-progress__head { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--on-surface-variant); }
.fs-progress__track { height: 8px; border-radius: var(--corner-full); background: var(--surface-container-highest); overflow: hidden; }
.fs-progress__bar { height: 100%; border-radius: var(--corner-full); background: var(--primary); }
.fs-dialog-scrim { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: var(--space-6); background: rgba(0,0,0,var(--scrim-opacity)); }
.fs-dialog { width: 100%; max-width: 420px; padding: var(--space-6); border-radius: var(--corner-xl); background: var(--surface-container-high); color: var(--on-surface); box-shadow: var(--elevation-3); }
.fs-dialog__title { margin: 0 0 var(--space-4); font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 32px; }
.fs-dialog__body { color: var(--on-surface-variant); }
.fs-dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-6); }

/* Contenção */
.fs-card { border-radius: var(--corner-lg); padding: var(--space-4); color: var(--on-surface); background: var(--surface-container-low); }
.fs-card--elevated { background: var(--surface); box-shadow: var(--elevation-1); }
.fs-card--filled { background: var(--surface-container); }
.fs-card--outlined { background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.fs-list { list-style: none; margin: 0; padding: 0; }
.fs-listitem { display: flex; align-items: center; gap: var(--space-4); width: 100%; min-height: 56px; padding: var(--space-2) var(--space-4); border: 0; background: transparent; color: var(--on-surface); text-align: left; font-family: var(--font-text); }
button.fs-listitem { cursor: pointer; }
.fs-listitem__text { flex: 1; min-width: 0; }
.fs-listitem__head { display: block; font-size: 16px; line-height: 24px; letter-spacing: .15px; font-weight: 500; }
.fs-listitem__sub { display: block; font-size: 14px; line-height: 20px; letter-spacing: .25px; color: var(--on-surface-variant); }
.fs-listitem__lead { color: var(--on-surface-variant); }
.fs-event { display: flex; flex-direction: column; max-width: 360px; border-radius: var(--corner-lg); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline-variant); color: var(--on-surface); }
.fs-event__band { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); background: var(--secondary-container); color: var(--on-secondary-container); }
.fs-event__date { font-family: var(--font-display); font-size: 32px; line-height: 40px; }
.fs-event__month { display: block; font-family: var(--font-text); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px; }
.fs-event__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.fs-event__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 32px; }
.fs-event__meta { display: flex; gap: var(--space-2); align-items: center; color: var(--on-surface-variant); }
.fs-event__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
.fs-event__price { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: .15px; }
.fs-event__price small { display: block; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--on-surface-variant); }

/* Navegação */
.fs-appbar { display: flex; align-items: center; gap: var(--space-2); min-height: 64px; padding: var(--space-2) var(--space-4); background: var(--surface); color: var(--on-surface); }
.fs-appbar__title { flex: 1; min-width: 0; margin: 0; font-size: 22px; line-height: 28px; font-weight: 500; }
.fs-rail { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); width: 88px; min-height: 100%; padding: var(--space-4) 0; background: var(--surface-container); }
.fs-rail__logo { width: 48px; height: auto; margin-bottom: var(--space-3); }
.fs-rail__item { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); width: 80px; padding: 0; border: 0; background: transparent; color: var(--on-surface-variant); font-family: var(--font-text); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px; cursor: pointer; }
.fs-rail__pill { display: flex; align-items: center; justify-content: center; width: 56px; height: 32px; border-radius: var(--corner-full); }
.fs-rail__item[aria-current="page"] { color: var(--on-surface); }
.fs-rail__item[aria-current="page"] .fs-rail__pill { background: var(--primary-container); color: var(--on-primary-container); }
.fs-tabs { display: flex; overflow-x: auto; box-shadow: inset 0 -1px 0 var(--outline-variant); }
.fs-tab { position: relative; min-height: 48px; padding: 0 var(--space-4); border: 0; background: transparent; color: var(--on-surface-variant); font-family: var(--font-text); font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; white-space: nowrap; cursor: pointer; }
.fs-tab[aria-selected="true"] { color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }
.fs-stepper { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.fs-step { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); color: var(--on-surface-variant); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px; }
.fs-step__bar { height: 4px; border-radius: var(--corner-full); background: var(--surface-container-highest); }
.fs-step--done .fs-step__bar, .fs-step--current .fs-step__bar { background: var(--primary); }
.fs-step--current { color: var(--on-surface); }

/* Dados */
.fs-table-wrap { overflow-x: auto; border-radius: var(--corner-md); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.fs-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; color: var(--on-surface); }
.fs-table th { padding: var(--space-3) var(--space-4); background: var(--surface-container-high); color: var(--on-surface); font-weight: 500; letter-spacing: .1px; text-align: left; white-space: nowrap; }
.fs-table td { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--outline-variant); white-space: nowrap; }
.fs-table .fs-num { text-align: right; font-variant-numeric: tabular-nums; }
.fs-stat { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); border-radius: var(--corner-lg); background: var(--surface-container-low); color: var(--on-surface); }
.fs-stat__label { display: flex; align-items: center; gap: var(--space-2); color: var(--on-surface-variant); }
.fs-stat__value { font-family: var(--font-display); font-size: 32px; line-height: 40px; color: var(--primary); }
.fs-stat__delta { color: var(--on-surface-variant); font-size: 12px; line-height: 16px; letter-spacing: .4px; }

/* Expressão da marca */
.fs-iconbadge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--secondary-container); color: var(--on-secondary-container); }
.fs-iconbadge--small { width: 32px; height: 32px; }
.fs-iconbadge--primary { background: var(--primary); color: var(--on-primary); }
.fs-banner { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-6) var(--space-2) var(--space-2); border-radius: var(--corner-lg); background: var(--surface-container-low); color: var(--primary); }
.fs-banner__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 32px; }
.fs-blob { position: absolute; pointer-events: none; }
.fs-blob--1 { fill: var(--decor-1); }
.fs-blob--2 { fill: var(--decor-2); }

/* ===== Extensões para o painel (Laravel/Blade) ===== */

/* Campo com ação à direita (ex.: mostrar senha) */
.fs-field__trail { flex: none; margin-right: var(--space-2); }
.fs-field__box:has(.fs-field__trail) .fs-field__input { padding-right: 0; }

/* Links */
.fs-link { color: var(--primary); font-weight: 500; text-decoration: none; }
.fs-link:hover { color: var(--on-primary-container); text-decoration: underline; }
.fs-link--touch { display: inline-flex; align-items: center; min-height: 44px; }

/* Avisos dentro de páginas (status de sessão, erros gerais) */
.fs-alert { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--corner-md); font-size: 14px; line-height: 20px; }
.fs-alert--success { background: var(--success-container); color: var(--on-success-container); }
.fs-alert--error { background: var(--error-container); color: var(--on-error-container); }
.fs-alert--info { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.fs-alert .fs-icon { margin-top: -2px; }

/* Texto só para leitores de tela */
.fs-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Rail como links (o componente original usa <button>) */
a.fs-rail__item { text-decoration: none; }
a.fs-rail__item:hover { color: var(--on-surface); }

/* Campo com ícone à esquerda */
.fs-field__label--lead { left: 44px; }

/* Cabeçalho do card (<x-fs.card title="...">) */
.fs-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.fs-card__title { margin: 0; color: var(--on-surface); }
.fs-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Snackbar flutuante (Festou.toast) */
.fs-snackbar--toast { position: fixed; left: 50%; bottom: var(--space-6); z-index: 2000; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.fs-snackbar--toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@media (max-width: 599px) { .fs-snackbar--toast { bottom: 96px; width: calc(100% - 32px); } }

/* Select: rótulo sempre no topo (o valor sempre aparece) */
.fs-field__label--static,
.fs-field__input:placeholder-shown:not(:focus) ~ .fs-field__label--static { transform: translateY(-14px); font-size: 12px; line-height: 16px; letter-spacing: .4px; background: var(--fs-field-bg); }
.fs-field--select .fs-field__input { padding-right: 44px; cursor: pointer; }

/* Cabeçalho de página (<x-fs.page-header>) */
.fs-page-header { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
.fs-page-header__back { display: inline-flex; align-items: center; gap: var(--space-1); align-self: flex-start; min-height: 44px; margin-top: calc(var(--space-2) * -1); }
.fs-page-header__row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.fs-page-header__text { min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.fs-page-header__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.fs-page-header__title { margin: 0; color: var(--on-surface); }
.fs-page-header__subtitle { margin: 0; color: var(--on-surface-variant); }
.fs-page-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* Grades e seções reutilizáveis nas telas do painel */
.fs-grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.fs-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.fs-section { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.fs-section__title { margin: 0; color: var(--on-surface); }
.fs-split { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: stretch; }
.fs-split > * { min-width: 0; }
.fs-split__main { flex: 2 1 480px; }
.fs-split__side { flex: 1 1 320px; }
.fs-panel { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); border-radius: var(--corner-lg); background: var(--surface-container-low); }
.fs-panel--outlined { background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.fs-panel__title { margin: 0; color: var(--on-surface); }
.fs-panel__value { color: var(--primary); }
.fs-panel__label { color: var(--on-surface-variant); }
.fs-plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.fs-plain-list > li { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--outline-variant); color: var(--on-surface); }
.fs-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.fs-filters > .fs-field { flex: 1 1 200px; width: auto; min-width: 0; }
.fs-filters > .fs-field--wide { flex: 2 1 320px; }
.fs-muted { color: var(--on-surface-variant); }
.fs-stat__value--sm { font-size: 24px; line-height: 32px; }
.fs-panel > .fs-btn--full:last-child { margin-top: auto; }
@media (max-width: 599px) {
  .fs-grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .fs-grid-stats .fs-stat__value { font-size: 24px; line-height: 32px; }
}
