/* ==========================================================================
 * BIBLIOTECA YESICODE — Frontend UI 2026
 * Design system istituzionale chiaro, coerente con l'admin (byic-v2 / app-*).
 * Scope: .byic-fe-scope (isolato dal theme host).
 * ========================================================================== */

.byic-fe-scope {
    /* Surfaces */
    --bfe-bg:            #f8fafc;
    --bfe-surface:       #ffffff;
    --bfe-surface-2:     #f1f5f9;
    --bfe-surface-3:     #e2e8f0;

    /* Borders */
    --bfe-border:        #e2e8f0;
    --bfe-border-strong: #cbd5e1;

    /* Text */
    --bfe-fg:            #0f172a;
    --bfe-fg-soft:       #334155;
    --bfe-fg-muted:      #64748b;
    --bfe-fg-inverse:    #ffffff;

    /* Brand */
    --bfe-primary:       #0f172a;
    --bfe-primary-2:     #1e293b;
    --bfe-accent:        #4f46e5;

    /* State */
    --bfe-success:       #16a34a;
    --bfe-success-bg:    #f0fdf4;
    --bfe-success-fg:    #166534;
    --bfe-danger:        #dc2626;
    --bfe-danger-bg:     #fef2f2;
    --bfe-danger-fg:     #991b1b;
    --bfe-warning:       #f59e0b;
    --bfe-warning-bg:    #fffbeb;
    --bfe-warning-fg:    #92400e;
    --bfe-info:          #2563eb;
    --bfe-info-bg:       #eff6ff;
    --bfe-info-fg:       #1e40af;

    /* Radius */
    --bfe-r:        10px;
    --bfe-r-md:     12px;
    --bfe-r-lg:     16px;
    --bfe-r-xl:     20px;
    --bfe-r-pill:   9999px;

    /* Shadow */
    --bfe-sh-xs:    0 1px 2px rgba(15, 23, 42, 0.04);
    --bfe-sh-sm:    0 2px 6px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --bfe-sh-md:    0 8px 18px rgba(15, 23, 42, 0.08), 0 3px 6px rgba(15, 23, 42, 0.05);
    --bfe-sh-lg:    0 24px 48px rgba(15, 23, 42, 0.10), 0 8px 16px rgba(15, 23, 42, 0.06);

    /* Spacing */
    --bfe-s1: 4px;
    --bfe-s2: 8px;
    --bfe-s3: 12px;
    --bfe-s4: 16px;
    --bfe-s5: 20px;
    --bfe-s6: 24px;
    --bfe-s7: 32px;
    --bfe-s8: 40px;

    /* Motion */
    --bfe-dur:      200ms;
    --bfe-dur-fast: 140ms;
    --bfe-ease:     cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--bfe-fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.byic-fe-scope *,
.byic-fe-scope *::before,
.byic-fe-scope *::after { box-sizing: border-box; }

/* === ALERT ================================================================ */
.byic-fe-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--bfe-s3);
    padding: var(--bfe-s4) var(--bfe-s5);
    border: 1px solid var(--bfe-border);
    border-left-width: 4px;
    border-radius: var(--bfe-r-md);
    background: var(--bfe-surface);
    box-shadow: var(--bfe-sh-xs);
    margin: 0 auto var(--bfe-s4);
    max-width: 720px;
}
.byic-fe-alert__icon {
    display: inline-flex;
    flex-shrink: 0;
    margin-top: 1px;
}
.byic-fe-alert__body {
    flex: 1;
    min-width: 0;
}
.byic-fe-alert__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
    color: var(--bfe-fg);
}
.byic-fe-alert__msg {
    font-size: 14px;
    color: var(--bfe-fg-soft);
    margin: 0;
    line-height: 1.5;
}
.byic-fe-alert__close {
    border: none;
    background: transparent;
    color: var(--bfe-fg-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: var(--bfe-r);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--bfe-dur-fast) var(--bfe-ease), color var(--bfe-dur-fast) var(--bfe-ease);
}
.byic-fe-alert__close:hover {
    background: var(--bfe-surface-2);
    color: var(--bfe-fg);
}

.byic-fe-alert--success {
    border-left-color: var(--bfe-success);
    background: var(--bfe-success-bg);
}
.byic-fe-alert--success .byic-fe-alert__icon { color: var(--bfe-success); }
.byic-fe-alert--success .byic-fe-alert__title { color: var(--bfe-success-fg); }

.byic-fe-alert--danger {
    border-left-color: var(--bfe-danger);
    background: var(--bfe-danger-bg);
}
.byic-fe-alert--danger .byic-fe-alert__icon { color: var(--bfe-danger); }
.byic-fe-alert--danger .byic-fe-alert__title { color: var(--bfe-danger-fg); }

.byic-fe-alert--warning {
    border-left-color: var(--bfe-warning);
    background: var(--bfe-warning-bg);
}
.byic-fe-alert--warning .byic-fe-alert__icon { color: var(--bfe-warning); }
.byic-fe-alert--warning .byic-fe-alert__title { color: var(--bfe-warning-fg); }

.byic-fe-alert--info {
    border-left-color: var(--bfe-info);
    background: var(--bfe-info-bg);
}
.byic-fe-alert--info .byic-fe-alert__icon { color: var(--bfe-info); }
.byic-fe-alert--info .byic-fe-alert__title { color: var(--bfe-info-fg); }

/* === AUTH (login/registrazione) =========================================== */
.byic-fe-auth {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--bfe-s6) var(--bfe-s4);
    background: var(--bfe-bg);
}
.byic-fe-auth__shell {
    width: 100%;
    max-width: 880px;
}
.byic-fe-auth__header {
    text-align: center;
    margin-bottom: var(--bfe-s6);
}
.byic-fe-auth__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bfe-fg-muted);
    margin-bottom: var(--bfe-s2);
}
.byic-fe-auth__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--bfe-fg);
    line-height: 1.2;
    margin: 0 0 var(--bfe-s2);
}
.byic-fe-auth__lead {
    font-size: 15px;
    color: var(--bfe-fg-muted);
    margin: 0;
    line-height: 1.5;
}

/* === CARD ================================================================= */
.byic-fe-card {
    background: var(--bfe-surface);
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-lg);
    box-shadow: var(--bfe-sh-md);
}
.byic-fe-card--auth {
    padding: var(--bfe-s7);
    max-width: 480px;
    margin: 0 auto;
}
.byic-fe-card--wide { max-width: 720px; }

/* === FORM ================================================================= */
.byic-fe-form {
    display: flex;
    flex-direction: column;
    gap: var(--bfe-s4);
}
.byic-fe-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bfe-s4);
}
.byic-fe-form__actions {
    display: flex;
    flex-direction: column;
    gap: var(--bfe-s3);
    margin-top: var(--bfe-s3);
}

.byic-fe-field {
    display: flex;
    flex-direction: column;
    gap: var(--bfe-s2);
    min-width: 0;
}
.byic-fe-field--full { grid-column: 1 / -1; }
.byic-fe-field__help {
    font-size: 13px;
    color: var(--bfe-fg-muted);
}

.byic-fe-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--bfe-fg);
}

.byic-fe-input,
.byic-fe-select,
.byic-fe-textarea {
    width: 100%;
    height: 44px;
    padding: 0 var(--bfe-s4);
    border: 1px solid var(--bfe-border-strong);
    border-radius: var(--bfe-r);
    background: var(--bfe-surface);
    color: var(--bfe-fg);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.2;
    transition: border-color var(--bfe-dur-fast) var(--bfe-ease),
                box-shadow var(--bfe-dur-fast) var(--bfe-ease);
}
.byic-fe-textarea {
    height: auto;
    min-height: 110px;
    padding: var(--bfe-s3) var(--bfe-s4);
    resize: vertical;
}
.byic-fe-input::placeholder,
.byic-fe-textarea::placeholder { color: var(--bfe-fg-muted); }

.byic-fe-input:hover,
.byic-fe-select:hover,
.byic-fe-textarea:hover {
    border-color: var(--bfe-fg-muted);
}
.byic-fe-input:focus,
.byic-fe-select:focus,
.byic-fe-textarea:focus {
    outline: none;
    border-color: var(--bfe-fg);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.byic-fe-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right var(--bfe-s4) center;
    background-size: 16px;
    padding-right: calc(var(--bfe-s4) + 24px);
    cursor: pointer;
}

/* === BUTTON =============================================================== */
.byic-fe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--bfe-s2);
    height: 46px;
    padding: 0 var(--bfe-s5);
    border: 1px solid var(--bfe-border-strong);
    border-radius: var(--bfe-r);
    background: var(--bfe-surface);
    color: var(--bfe-fg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--bfe-dur-fast) var(--bfe-ease),
                border-color var(--bfe-dur-fast) var(--bfe-ease),
                color var(--bfe-dur-fast) var(--bfe-ease),
                box-shadow var(--bfe-dur-fast) var(--bfe-ease),
                transform var(--bfe-dur-fast) var(--bfe-ease);
}
.byic-fe-btn:hover { border-color: var(--bfe-fg-muted); background: var(--bfe-surface-2); text-decoration: none; color: var(--bfe-fg); }
.byic-fe-btn:active { transform: translateY(1px); }
.byic-fe-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
    border-color: var(--bfe-fg);
}
.byic-fe-btn[disabled],
.byic-fe-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.byic-fe-btn--primary,
.byic-fe-btn--primary:visited {
    background: var(--bfe-primary);
    border-color: var(--bfe-primary);
    color: var(--bfe-fg-inverse);
}
.byic-fe-btn--primary:hover {
    background: var(--bfe-primary-2);
    border-color: var(--bfe-primary-2);
    color: var(--bfe-fg-inverse);
}

.byic-fe-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--bfe-fg-soft);
}
.byic-fe-btn--ghost:hover {
    background: var(--bfe-surface-2);
    border-color: var(--bfe-border);
    color: var(--bfe-fg);
}

.byic-fe-btn--block { width: 100%; }

.byic-fe-btn__label { display: inline-flex; align-items: center; }

/* === SPINNER ============================================================== */
.byic-fe-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: byicFeSpin 0.7s linear infinite;
}
@keyframes byicFeSpin {
    to { transform: rotate(360deg); }
}

/* === INLINE ERROR ========================================================= */
.byic-fe-inline-error {
    padding: var(--bfe-s3) var(--bfe-s4);
    background: var(--bfe-danger-bg);
    border: 1px solid var(--bfe-danger);
    border-radius: var(--bfe-r);
    color: var(--bfe-danger-fg);
    font-size: 14px;
    line-height: 1.4;
}

/* === PILL / BADGE (sobri ma leggibili) ================================== */
.byic-fe-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--bfe-r-pill);
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid transparent;
}
.byic-fe-pill--success { background: #dcfce7; border-color: #86efac; color: #15803d; }
.byic-fe-pill--danger  { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.byic-fe-pill--warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.byic-fe-pill--info    { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.byic-fe-pill--neutral { background: #e2e8f0; border-color: #cbd5e1; color: #334155; }

/* Override badge catalogo (sopra cover) — chip glass professionale con dot stato */
.byic-fe-scope .byic-badge,
.byic-fe-scope .byic-book-card__badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 11px 5px 9px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    border-radius: var(--bfe-r-pill) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    line-height: 1.2 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #334155 !important;
    backdrop-filter: blur(8px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(140%) !important;
}
.byic-fe-scope .byic-badge::before,
.byic-fe-scope .byic-book-card__badge::before {
    content: '' !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    background: #94a3b8 !important;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25) !important;
}
.byic-fe-scope .byic-badge.byic-badge--success { color: #15803d !important; }
.byic-fe-scope .byic-badge.byic-badge--success::before {
    background: #16a34a !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25) !important;
}
.byic-fe-scope .byic-badge.byic-badge--danger { color: #b91c1c !important; }
.byic-fe-scope .byic-badge.byic-badge--danger::before {
    background: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25) !important;
}
.byic-fe-scope .byic-badge.byic-badge--warning { color: #92400e !important; }
.byic-fe-scope .byic-badge.byic-badge--warning::before {
    background: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25) !important;
}
.byic-fe-scope .byic-badge.byic-badge--info { color: #1e40af !important; }
.byic-fe-scope .byic-badge.byic-badge--info::before {
    background: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25) !important;
}

/* === CATALOG (light, institutional brand) ================================ */
.byic-catalog--lite {
    --bcat-brand:        #1e3a8a;
    --bcat-brand-2:      #1d4ed8;
    --bcat-brand-fg:     #ffffff;
}

/* Hero brand */
.byic-fe-scope .byic-catalog__hero--brand {
    padding: var(--bfe-s7) var(--bfe-s7);
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
    border: none;
    border-radius: var(--bfe-r-lg);
    color: var(--bcat-brand-fg);
    box-shadow: var(--bfe-sh-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--bfe-s6);
    flex-wrap: wrap;
    margin-bottom: var(--bfe-s5);
}
.byic-fe-scope .byic-catalog__hero--brand .byic-catalog__hero-text { color: #ffffff; }
.byic-fe-scope .byic-catalog__hero--brand .byic-catalog__hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: var(--bfe-s2);
}
.byic-fe-scope .byic-catalog__hero--brand h1 {
    margin: 0 0 var(--bfe-s2);
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.15;
}
.byic-fe-scope .byic-catalog__hero--brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.5;
}

/* Counter brand */
.byic-fe-scope .byic-catalog__counter--brand {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: var(--bfe-s4) var(--bfe-s6);
    border-radius: var(--bfe-r-md);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    min-width: 140px;
}
.byic-fe-scope .byic-catalog__counter--brand .byic-catalog__counter-num {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.02em;
}
.byic-fe-scope .byic-catalog__counter--brand .byic-catalog__counter-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 6px;
    font-weight: 600;
}

/* Filters brand */
.byic-fe-scope .byic-catalog__filters--brand {
    display: grid;
    grid-template-columns: minmax(160px, 1.4fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) auto auto;
    gap: var(--bfe-s3);
    align-items: end;
    background: #ffffff;
    border: 1px solid var(--bfe-border);
    border-top: 3px solid #1d4ed8;
    border-radius: var(--bfe-r-md);
    padding: var(--bfe-s5);
    margin-bottom: var(--bfe-s4);
    box-shadow: var(--bfe-sh-sm);
}
@media (max-width: 1100px) {
    .byic-fe-scope .byic-catalog__filters--brand {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .byic-fe-scope .byic-catalog__filters--brand > button,
    .byic-fe-scope .byic-catalog__filters--brand > a.byic-btn--ghost { grid-column: span 1; }
}
@media (max-width: 700px) {
    .byic-fe-scope .byic-catalog__filters--brand { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .byic-fe-scope .byic-catalog__filters--brand { grid-template-columns: 1fr; }
}

/* Select look = input (consistente) */
.byic-fe-scope .byic-catalog__filters--brand .byic-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right var(--bfe-s4) center;
    background-size: 16px;
    padding-right: calc(var(--bfe-s4) + 22px);
    cursor: pointer;
}

/* Active filter chips */
.byic-fe-scope .byic-fe-catalog-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--bfe-s2);
    margin: 0 0 var(--bfe-s4);
    padding: var(--bfe-s3) var(--bfe-s4);
    background: var(--bfe-surface-2);
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-md);
}
.byic-fe-scope .byic-fe-catalog-chips__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bfe-fg-muted);
    margin-right: var(--bfe-s2);
}
.byic-fe-scope .byic-fe-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-pill);
    color: var(--bfe-fg-soft);
    font-size: 12px;
    text-decoration: none;
    transition: background var(--bfe-dur-fast) var(--bfe-ease), border-color var(--bfe-dur-fast) var(--bfe-ease), color var(--bfe-dur-fast) var(--bfe-ease);
}
.byic-fe-scope .byic-fe-chip strong { color: var(--bfe-fg); font-weight: 700; }
.byic-fe-scope .byic-fe-chip:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.byic-fe-scope .byic-fe-chip:hover strong { color: #b91c1c; }
.byic-fe-scope .byic-catalog__filters--brand .byic-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bfe-fg);
    margin-bottom: 6px;
    display: block;
}
.byic-fe-scope .byic-catalog__filters--brand .byic-input {
    width: 100%;
    height: 42px;
    padding: 0 var(--bfe-s4);
    border: 1px solid var(--bfe-border-strong);
    border-radius: var(--bfe-r);
    background: #ffffff;
    color: var(--bfe-fg);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--bfe-dur-fast) var(--bfe-ease), box-shadow var(--bfe-dur-fast) var(--bfe-ease);
}
.byic-fe-scope .byic-catalog__filters--brand .byic-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

/* Buttons inside the brand filter bar */
.byic-fe-scope .byic-catalog__filters--brand .byic-btn,
.byic-fe-scope .byic-catalog__filters--brand .byic-btn--primary,
.byic-fe-scope .byic-catalog__filters--brand .byic-btn--ghost {
    height: 42px;
    padding: 0 var(--bfe-s5);
    border-radius: var(--bfe-r);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--bfe-dur-fast) var(--bfe-ease), border-color var(--bfe-dur-fast) var(--bfe-ease);
}
.byic-fe-scope .byic-catalog__filters--brand .byic-btn--primary {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
}
.byic-fe-scope .byic-catalog__filters--brand .byic-btn--primary:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
}
.byic-fe-scope .byic-catalog__filters--brand .byic-btn--ghost {
    background: transparent;
    color: var(--bfe-fg-soft);
    border-color: var(--bfe-border-strong);
    text-decoration: none;
}
.byic-fe-scope .byic-catalog__filters--brand .byic-btn--ghost:hover {
    background: var(--bfe-surface-2);
    color: var(--bfe-fg);
}

/* Viewbar (Griglia / Lista) — light */
.byic-fe-scope.byic-catalog .byic-catalog__viewbar {
    color: var(--bfe-fg-soft);
}
.byic-fe-scope.byic-catalog .byic-soft {
    color: var(--bfe-fg-muted);
    font-size: 13px;
}
.byic-fe-scope.byic-catalog .byic-segmented {
    background: var(--bfe-surface-2);
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-pill);
    padding: 4px;
    gap: 2px;
}
.byic-fe-scope.byic-catalog .byic-segmented__btn {
    background: transparent;
    color: var(--bfe-fg-soft);
    border: none;
    padding: 6px 14px;
    border-radius: var(--bfe-r-pill);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.byic-fe-scope.byic-catalog .byic-segmented__btn svg { width: 16px; height: 16px; }
.byic-fe-scope.byic-catalog .byic-segmented__btn.is-active {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: var(--bfe-sh-xs);
}

/* === BOOK CARD light (override su scope) ================================ */
.byic-fe-scope.byic-catalog .byic-catalog__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--bfe-s5);
}
.byic-fe-scope.byic-catalog .byic-catalog__item { min-width: 0; }
.byic-fe-scope.byic-catalog .byic-book-card {
    background: #ffffff;
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-lg);
    overflow: hidden;
    box-shadow: var(--bfe-sh-sm);
    transition: transform var(--bfe-dur) var(--bfe-ease),
                box-shadow var(--bfe-dur) var(--bfe-ease),
                border-color var(--bfe-dur) var(--bfe-ease);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.byic-fe-scope.byic-catalog .byic-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(29, 78, 216, 0.14), 0 4px 10px rgba(15, 23, 42, 0.08);
    border-color: #bfdbfe;
}
.byic-fe-scope.byic-catalog .byic-book-card__cover {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--bfe-surface-2);
    position: relative;
}
.byic-fe-scope.byic-catalog .byic-book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--bfe-dur) var(--bfe-ease) !important;
    filter: none !important;
}
.byic-fe-scope.byic-catalog .byic-book-card:hover .byic-book-card__cover img {
    transform: scale(1.04) !important;
}
.byic-fe-scope.byic-catalog .byic-book-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    z-index: 2;
}

/* No hover overlay (info gia presenti sotto la card) */
.byic-fe-scope.byic-catalog .byic-book-card__overlay {
    display: none !important;
}
.byic-fe-scope.byic-catalog .byic-book-card:hover .byic-book-card__cover::after,
.byic-fe-scope.byic-catalog .byic-book-card:hover .byic-book-card__cover::before {
    display: none !important;
    opacity: 0 !important;
}

.byic-fe-scope.byic-catalog .byic-book-card__meta {
    padding: var(--bfe-s4);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    border-top: 1px solid var(--bfe-surface-3);
}
.byic-fe-scope.byic-catalog .byic-book-card__title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--bfe-fg);
    line-height: 1.35;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.byic-fe-scope.byic-catalog .byic-book-card__author {
    font-size: 12.5px;
    color: var(--bfe-fg-muted);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* desc nascosta in griglia, visibile solo in lista */
.byic-fe-scope.byic-catalog .byic-book-card__desc { display: none; }

/* === LIST VIEW (toggle .is-view-list) =================================== */
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list {
    grid-template-columns: 1fr;
    gap: var(--bfe-s3);
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-catalog__item { width: 100%; }
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 0;
    align-items: stretch;
    padding: 0;
    min-height: 240px;
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card:hover {
    transform: translateY(-2px);
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__cover {
    aspect-ratio: auto;
    width: 170px;
    height: 100%;
    border-radius: var(--bfe-r-lg) 0 0 var(--bfe-r-lg);
    flex-shrink: 0;
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__cover img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__badge {
    top: 10px;
    left: 10px;
    right: auto;
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__meta {
    padding: var(--bfe-s5) var(--bfe-s6);
    justify-content: flex-start;
    gap: var(--bfe-s2);
    border-top: none;
    border-left: 1px solid var(--bfe-surface-3);
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__title {
    font-size: 18px;
    -webkit-line-clamp: 2;
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__author {
    font-size: 13.5px;
    -webkit-line-clamp: 1;
}
.byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__desc {
    display: -webkit-box;
    margin: var(--bfe-s2) 0 0;
    font-size: 14px;
    color: var(--bfe-fg-soft);
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 560px) {
    .byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card { grid-template-columns: 120px 1fr; min-height: 180px; }
    .byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__cover { width: 120px; }
    .byic-fe-scope.byic-catalog .byic-catalog__list.is-view-list .byic-book-card__desc { -webkit-line-clamp: 3; }
}

/* === DETAIL LIGHT ======================================================= */
.byic-fe-scope.byic-detail-wrap { padding: var(--bfe-s5) var(--bfe-s4); }
.byic-fe-scope .byic-detail__back { margin: 0 0 var(--bfe-s5); }

.byic-fe-scope .byic-detail--lite {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--bfe-s7);
    padding: var(--bfe-s7);
    background: #ffffff;
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-lg);
    box-shadow: var(--bfe-sh-md);
}
@media (max-width: 880px) {
    .byic-fe-scope .byic-detail--lite {
        grid-template-columns: 1fr;
        padding: var(--bfe-s5);
        gap: var(--bfe-s5);
    }
}

.byic-fe-scope .byic-detail--lite .byic-detail__cover {
    aspect-ratio: 2 / 3;
    border-radius: var(--bfe-r-md);
    overflow: hidden;
    background: var(--bfe-surface-2);
    box-shadow: var(--bfe-sh-md);
    align-self: start;
    position: sticky;
    top: 24px;
}
.byic-fe-scope .byic-detail--lite .byic-detail__cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.byic-fe-scope .byic-detail--lite .byic-detail__title {
    font-size: clamp(24px, 2.6vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: var(--bfe-s3) 0 var(--bfe-s2);
    color: var(--bfe-fg);
    line-height: 1.15;
}
.byic-fe-scope .byic-detail--lite .byic-detail__author {
    color: var(--bfe-fg-muted);
    font-style: italic;
    margin: 0 0 var(--bfe-s5);
    font-size: 17px;
}

/* Stats evident (Copie totali / Disponibili) */
.byic-fe-scope .byic-detail__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bfe-s4);
    margin: 0 0 var(--bfe-s5);
}
.byic-fe-scope .byic-detail__stat {
    padding: var(--bfe-s5);
    border-radius: var(--bfe-r-md);
    border: 1px solid var(--bfe-border);
    background: var(--bfe-surface-2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: relative;
    overflow: hidden;
}
.byic-fe-scope .byic-detail__stat::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--bfe-fg-muted);
    border-radius: 4px 0 0 4px;
}
.byic-fe-scope .byic-detail__stat-num {
    font-size: 36px;
    font-weight: 800;
    color: var(--bfe-fg);
    line-height: 1;
    letter-spacing: -0.02em;
}
.byic-fe-scope .byic-detail__stat-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bfe-fg-muted);
}
.byic-fe-scope .byic-detail__stat--total {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.byic-fe-scope .byic-detail__stat--total::before { background: #2563eb; }
.byic-fe-scope .byic-detail__stat--total .byic-detail__stat-num  { color: #1e40af; }
.byic-fe-scope .byic-detail__stat--total .byic-detail__stat-label { color: #1e3a8a; }

.byic-fe-scope .byic-detail__stat--available {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.byic-fe-scope .byic-detail__stat--available::before { background: #16a34a; }
.byic-fe-scope .byic-detail__stat--available .byic-detail__stat-num  { color: #15803d; }
.byic-fe-scope .byic-detail__stat--available .byic-detail__stat-label { color: #166534; }

.byic-fe-scope .byic-detail__stat--unavailable {
    background: #fef2f2;
    border-color: #fecaca;
}
.byic-fe-scope .byic-detail__stat--unavailable::before { background: #dc2626; }
.byic-fe-scope .byic-detail__stat--unavailable .byic-detail__stat-num  { color: #b91c1c; }
.byic-fe-scope .byic-detail__stat--unavailable .byic-detail__stat-label { color: #991b1b; }

.byic-fe-scope .byic-detail--lite .byic-detail__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--bfe-s3);
    margin-bottom: var(--bfe-s5);
}
.byic-fe-scope .byic-detail--lite .byic-detail__meta-item {
    background: #ffffff;
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r);
    padding: var(--bfe-s3) var(--bfe-s4);
}
.byic-fe-scope .byic-detail--lite .byic-detail__meta-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--bfe-fg-muted);
    margin-bottom: 4px;
    font-weight: 700;
}
.byic-fe-scope .byic-detail--lite .byic-detail__meta-value {
    display: block;
    color: var(--bfe-fg);
    font-weight: 600;
    font-size: 14px;
}

/* Description light */
.byic-fe-scope .byic-detail--lite .byic-detail__description {
    margin: var(--bfe-s5) 0;
    background: var(--bfe-surface-2);
    color: var(--bfe-fg-soft);
    border-radius: var(--bfe-r-md);
    padding: var(--bfe-s6);
    border: 1px solid var(--bfe-border);
}
.byic-fe-scope .byic-detail--lite .byic-detail__description h2 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 var(--bfe-s3);
    color: var(--bfe-fg);
    border-bottom: 1px solid var(--bfe-border);
    padding-bottom: var(--bfe-s2);
}
.byic-fe-scope .byic-detail--lite .byic-detail__description-body p {
    color: var(--bfe-fg-soft);
    line-height: 1.7;
    font-size: 15px;
    margin: 0 0 var(--bfe-s3);
    text-align: justify;
}
.byic-fe-scope .byic-detail--lite .byic-detail__description-body p:last-child { margin-bottom: 0; }

.byic-fe-scope .byic-detail__actions {
    display: flex;
    align-items: center;
    gap: var(--bfe-s4);
    flex-wrap: wrap;
    margin-top: var(--bfe-s5);
}
.byic-fe-scope .byic-detail__form { margin: 0; }
.byic-fe-scope .byic-detail__note {
    color: var(--bfe-fg-muted);
    font-size: 13px;
    margin: 0;
    font-style: italic;
    flex: 1;
    min-width: 220px;
}

.byic-fe-btn--lg {
    height: 52px;
    padding: 0 var(--bfe-s7);
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--bfe-r-md);
}

/* === PROFILE =========================================================== */
.byic-fe-profile {
    padding: var(--bfe-s5) var(--bfe-s4) var(--bfe-s7);
    background: transparent;
    max-width: 1200px;
    margin: 0 auto;
}

.byic-fe-profile__hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
    border-radius: var(--bfe-r-lg);
    padding: var(--bfe-s7);
    color: #ffffff;
    box-shadow: var(--bfe-sh-md);
    margin-bottom: var(--bfe-s6);
}
.byic-fe-profile__hero-inner {
    display: flex;
    align-items: center;
    gap: var(--bfe-s6);
    flex-wrap: wrap;
}
.byic-fe-profile__avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.32);
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.byic-fe-profile__identity { flex: 1; min-width: 220px; }
.byic-fe-profile__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: var(--bfe-s2);
}
.byic-fe-profile__name {
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: #ffffff;
    line-height: 1.15;
}
.byic-fe-profile__sub {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    word-break: break-all;
}

.byic-fe-profile__grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: var(--bfe-s5);
    align-items: start;
}
@media (max-width: 900px) {
    .byic-fe-profile__grid { grid-template-columns: 1fr; }
}

.byic-fe-profile__card {
    padding: var(--bfe-s6);
    background: #ffffff;
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-lg);
    box-shadow: var(--bfe-sh-sm);
}
.byic-fe-profile__card--wide { min-width: 0; }

.byic-fe-profile__card-head {
    margin-bottom: var(--bfe-s5);
    padding-bottom: var(--bfe-s4);
    border-bottom: 1px solid var(--bfe-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--bfe-s3);
    flex-wrap: wrap;
}
.byic-fe-profile__card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--bfe-fg);
    letter-spacing: -0.01em;
}
.byic-fe-profile__card-lead {
    margin: 0;
    color: var(--bfe-fg-muted);
    font-size: 13px;
    line-height: 1.4;
}
.byic-fe-profile__count {
    font-size: 12px;
    font-weight: 700;
    color: var(--bfe-fg-muted);
    background: var(--bfe-surface-2);
    padding: 4px 10px;
    border-radius: var(--bfe-r-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* DL anagrafica */
.byic-fe-profile__dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--bfe-s3);
}
.byic-fe-profile__dl-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--bfe-s3);
    padding: var(--bfe-s2) 0;
    border-bottom: 1px dashed var(--bfe-border);
}
.byic-fe-profile__dl-item:last-child { border-bottom: none; }
.byic-fe-profile__dl-item dt {
    font-size: 11px;
    font-weight: 700;
    color: var(--bfe-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    flex-shrink: 0;
}
.byic-fe-profile__dl-item dd {
    font-size: 14px;
    color: var(--bfe-fg);
    font-weight: 600;
    margin: 0;
    text-align: right;
    word-break: break-word;
}

/* Table prenotazioni */
.byic-fe-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--bfe-border);
    border-radius: var(--bfe-r-md);
}
.byic-fe-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: #ffffff;
    margin: 0;
}
.byic-fe-table thead th {
    background: var(--bfe-surface-2);
    color: var(--bfe-fg-soft);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    padding: var(--bfe-s3) var(--bfe-s4);
    border-bottom: 1px solid var(--bfe-border);
}
.byic-fe-table tbody td {
    padding: var(--bfe-s4);
    border-bottom: 1px solid var(--bfe-border);
    color: var(--bfe-fg-soft);
    vertical-align: middle;
}
.byic-fe-table tbody tr:last-child td { border-bottom: none; }
.byic-fe-table tbody tr:hover td { background: var(--bfe-surface-2); }
.byic-fe-table__strong { color: var(--bfe-fg); font-weight: 700; }

.byic-fe-profile__pagination {
    margin-top: var(--bfe-s5);
    display: flex;
    justify-content: center;
}

.byic-fe-profile__empty {
    text-align: center;
    padding: var(--bfe-s7) var(--bfe-s5);
    color: var(--bfe-fg-muted);
    border: 1px dashed var(--bfe-border);
    border-radius: var(--bfe-r-md);
    background: var(--bfe-surface-2);
}
.byic-fe-profile__empty h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--bfe-fg);
    font-weight: 700;
}
.byic-fe-profile__empty p { margin: 0; font-size: 14px; }

/* === PAGINATION (scope FE) ============================================== */
.byic-fe-scope .pagination,
.byic-fe-scope .byic-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--bfe-s2);
    margin: var(--bfe-s5) 0 0;
    padding: 0;
    list-style: none;
}
.byic-fe-scope .pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--bfe-s3);
    border: 1px solid var(--bfe-border-strong);
    border-radius: var(--bfe-r);
    background: #ffffff;
    color: var(--bfe-fg-soft);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--bfe-dur-fast) var(--bfe-ease),
                border-color var(--bfe-dur-fast) var(--bfe-ease),
                color var(--bfe-dur-fast) var(--bfe-ease);
}
.byic-fe-scope .pagination a:hover {
    background: var(--bfe-surface-2);
    border-color: var(--bfe-fg-muted);
    color: var(--bfe-fg);
}
.byic-fe-scope .pagination a.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
    cursor: default;
}

/* === ERROR PAGE ======================================================== */
.byic-fe-error {
    padding: var(--bfe-s7) var(--bfe-s4);
    background: transparent;
}
.byic-fe-error__shell {
    max-width: 720px;
    margin: 0 auto;
}

/* Alert standalone: spazio sopra quando appare a inizio pagina */
.byic-fe-scope > .byic-fe-alert:first-child { margin-top: var(--bfe-s5); }

/* === RESPONSIVE =========================================================== */
@media (max-width: 640px) {
    .byic-fe-card--auth { padding: var(--bfe-s5); }
    .byic-fe-form__grid { grid-template-columns: 1fr; }
    .byic-fe-auth__title { font-size: 22px; }
    .byic-fe-scope .byic-catalog__hero--brand,
    .byic-fe-profile__hero { padding: var(--bfe-s5); }
    .byic-fe-scope .byic-detail__stats { grid-template-columns: 1fr; }
    .byic-fe-profile__card { padding: var(--bfe-s5); }
}
