/*
 * C1 · Button (docs/ui/COMPONENTI.md). Solo token --hy-*.
 * Varianti: primary, secondary, ghost, info/success/danger/warning (icona colorata, D27), icon; taglie sm/md/lg/block.
 */
.hy-btn {
    --_h: 42px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--_h); min-width: var(--_h); padding: 0 16px;
    border-radius: var(--hy-radius-pill); border: 1px solid transparent;
    font: var(--hy-weight-strong) var(--hy-text-md)/1 var(--hy-font-heading);
    white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none;
    color: var(--hy-text); background: transparent;
    transition: background-color var(--hy-dur-fast), border-color var(--hy-dur-fast), color var(--hy-dur-fast), box-shadow var(--hy-dur-fast), transform var(--hy-dur-fast);
}
.hy-btn:focus { outline: none; }
.hy-btn:focus-visible { outline: 2px solid var(--hy-focus-ring); outline-offset: 2px; }
.hy-btn:hover { transform: translateY(-1px); }
.hy-btn:active { transform: none; }
.hy-btn i { font-size: 16px; line-height: 1; }

/* Primary: unico bottone pieno a riposo */
.hy-btn--primary { background: var(--hy-accent-fill); border-color: var(--hy-accent-fill); color: var(--hy-on-accent); box-shadow: var(--hy-btn-shadow); font-size: 15px; font-weight: var(--hy-weight-bold) !important; } /* !important: site.css forza ancora button { font-weight: 600 !important } (da togliere con F7) */
.hy-btn--primary:not(.hy-btn--sm) i { font-size: 17px; } /* testo e icona più evidenti, stessa altezza (scelta del 2026-10-20) */
.hy-btn--primary:hover { background: var(--hy-accent-hover); border-color: var(--hy-accent-hover); box-shadow: var(--hy-btn-shadow-hover); }

/* Secondary e varianti a icona colorata: glass a riposo */
.hy-btn--secondary, .hy-btn--info, .hy-btn--success, .hy-btn--danger, .hy-btn--warning {
    background: var(--hy-btn-glass-bg); border-color: var(--hy-btn-glass-border); color: var(--hy-btn-glass-text);
    -webkit-backdrop-filter: var(--hy-btn-glass-blur); backdrop-filter: var(--hy-btn-glass-blur);
    box-shadow: var(--hy-btn-shadow);
}
.hy-btn--secondary:hover { background: var(--hy-accent-soft); border-color: var(--hy-accent); box-shadow: var(--hy-btn-shadow-hover); }

/* Ghost: azioni leggere in toolbar, card e righe */
.hy-btn--ghost:hover { background: var(--hy-accent-soft); }

/* Icona colorata in un cerchio pieno; il bottone si riempie solo in hover/focus (D27) */
.hy-btn__dot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: -10px; border-radius: 50%; }
.hy-btn__dot i { font-size: 13px; }
.hy-btn--info .hy-btn__dot { background: var(--hy-info-fill); color: var(--hy-info-on); }
.hy-btn--success .hy-btn__dot { background: var(--hy-success-fill); color: var(--hy-success-on); }
.hy-btn--danger .hy-btn__dot { background: var(--hy-danger-fill); color: var(--hy-danger-on); }
.hy-btn--warning .hy-btn__dot { background: var(--hy-warning-fill); color: var(--hy-warning-on); }
.hy-btn--info:hover, .hy-btn--info:focus-visible { background: var(--hy-info-fill); border-color: var(--hy-info-fill); color: var(--hy-info-on); }
.hy-btn--success:hover, .hy-btn--success:focus-visible { background: var(--hy-success-fill); border-color: var(--hy-success-fill); color: var(--hy-success-on); }
.hy-btn--danger:hover, .hy-btn--danger:focus-visible { background: var(--hy-danger-fill); border-color: var(--hy-danger-fill); color: var(--hy-danger-on); }
.hy-btn--warning:hover, .hy-btn--warning:focus-visible { background: var(--hy-warning-fill); border-color: var(--hy-warning-fill); color: var(--hy-warning-on); }
.hy-btn--info:hover .hy-btn__dot, .hy-btn--success:hover .hy-btn__dot, .hy-btn--danger:hover .hy-btn__dot, .hy-btn--warning:hover .hy-btn__dot,
.hy-btn--info:focus-visible .hy-btn__dot, .hy-btn--success:focus-visible .hy-btn__dot, .hy-btn--danger:focus-visible .hy-btn__dot, .hy-btn--warning:focus-visible .hy-btn__dot { background: var(--hy-icon-circle-on-fill); }

/* Solo icona: cerchio, aria-label obbligatorio */
.hy-btn--icon { width: var(--_h); padding: 0; }

/* Taglie */
.hy-btn--sm { --_h: 32px; padding: 0 12px; font-size: var(--hy-text-sm); }
.hy-btn--sm.hy-btn--icon { padding: 0; }
.hy-btn--lg { --_h: 52px; padding: 0 20px; font-size: var(--hy-text-lg); }
.hy-btn--block { display: flex; width: 100%; }

/* Stati */
.hy-btn:disabled, .hy-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.hy-btn.is-loading { pointer-events: none; }
.hy-btn.is-loading > i:first-child, .hy-btn.is-loading .hy-btn__dot { display: none; }
.hy-btn.is-loading::before {
    content: ""; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--hy-border); border-top-color: var(--hy-accent);
    animation: hy-spin .8s linear infinite;
}
@keyframes hy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hy-btn.is-loading::before { animation-duration: 2s; } .hy-btn:hover { transform: none; } }

@media (max-width: 767.98px) {
    .hy-btn { --_h: 44px; }
    .hy-btn--sm { --_h: 32px; position: relative; }
    /* Area touch estesa a 44px per i bottoni piccoli */
    .hy-btn--sm::after { content: ""; position: absolute; inset: -6px; }
}
