/* ═══════════════════════════════════════════════════════════════════════
   Glocal Legal Suite — Calcolatori CSS v1.2.0
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Layout sidebar + main ──────────────────────────────────────────── */
.gls-calc-suite { font-family: var(--gls-font-b, 'Crimson Pro', Georgia, serif); }

.gls-calc-layout {
    display: flex;
    min-height: 600px;
    background: #f5f4f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(13,21,35,.10);
}

/* Sidebar */
.gls-calc-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1a2744;
    padding: 0 0 24px;
}
.gls-calc-sidebar__title {
    padding: 18px 16px 14px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 14px;
    font-weight: 700;
    color: #c9a84c;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 6px;
}
.gls-calc-nav { display: flex; flex-direction: column; }
.gls-calc-nav__btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,.5);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all .18s;
    line-height: 1.3;
}
.gls-calc-nav__btn:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.05); }
.gls-calc-nav__btn--active {
    color: #e0c46e;
    background: rgba(201,168,76,.1);
    border-left-color: #c9a84c;
    font-weight: 700;
}

/* Main content */
.gls-calc-main { flex: 1; padding: 28px 32px 40px; overflow-y: auto; max-height: 85vh; }

/* Panels */
.gls-calc-panel { display: none; }
.gls-calc-panel--active { display: block; animation: calcFadeIn .22s ease; }
@keyframes calcFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.gls-calc-panel__header { margin-bottom: 22px; }
.gls-calc-panel__header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 4px;
}
.gls-calc-panel__header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a2744;
    margin: 18px 0 12px;
}
.gls-calc-panel__header p { font-size: 14px; color: #6b7a99; }

/* Sub-tabs */
.gls-sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #fff;
    border: 1.5px solid #e0dbd0;
    border-radius: 8px;
    padding: 4px;
    flex-wrap: wrap;
}
.gls-sub-tab {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7a99;
    cursor: pointer;
    font-family: inherit;
    transition: all .17s;
    white-space: nowrap;
}
.gls-sub-tab:hover { color: #1a2744; }
.gls-sub-tab--active { background: #1a2744; color: #e0c46e; }
.gls-sub-tabs--inner { margin: 12px 0; }
.gls-sub-tab--sm { padding: 6px 12px; font-size: 12px; }

.gls-sub-panel { display: none; }
.gls-sub-panel--active { display: block; animation: calcFadeIn .2s ease; }

/* Form grid */
.gls-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.gls-fg { display: flex; flex-direction: column; gap: 5px; }
.gls-fg--full { grid-column: 1 / -1; }
.gls-fg label { font-size: 13px; font-weight: 700; color: #1a2744; letter-spacing: .01em; }

.gls-inp {
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid #e0dbd0;
    border-radius: 7px;
    font-family: inherit;
    font-size: 15px;
    color: #0d1523;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
    width: 100%;
}
.gls-inp:focus { border-color: #1a2744; box-shadow: 0 0 0 3px rgba(26,39,68,.08); }
.gls-inp[type="date"] { font-size: 14px; }

/* Checkbox group */
.gls-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    background: #fff;
    border: 1.5px solid #e0dbd0;
    border-radius: 7px;
    padding: 12px 14px;
}
.gls-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 500;
    color: #243560;
    cursor: pointer;
}
.gls-checkbox-group input[type="checkbox"] { accent-color: #1a2744; width: 16px; height: 16px; }

/* Calc button */
.gls-calc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: #1a2744;
    border: none;
    border-radius: 8px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    color: #e0c46e;
    cursor: pointer;
    transition: all .18s;
    letter-spacing: .02em;
    margin-top: 4px;
}
.gls-calc-btn:hover { background: #243560; box-shadow: 0 6px 20px rgba(26,39,68,.25); transform: translateY(-1px); }
.gls-calc-btn:disabled { opacity: .6; cursor: wait; transform: none; }

/* Info box */
.gls-info-box {
    background: rgba(26,39,68,.05);
    border-left: 3px solid #c9a84c;
    border-radius: 0 7px 7px 0;
    padding: 10px 14px;
    font-size: 13px;
    color: #6b7a99;
    margin: 12px 0;
}
.gls-info-box--gold { border-left-color: #c9a84c; background: rgba(201,168,76,.07); color: #7a5c10; }

/* ── Risultati ──────────────────────────────────────────────────────── */
.gls-result-box {
    margin-top: 22px;
    animation: calcFadeIn .25s ease;
}

/* Riquadro totale */
.gls-res-total {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 20px;
    background: #1a2744;
    border-radius: 10px;
    margin-bottom: 16px;
}
.gls-res-total__item { flex: 1; min-width: 120px; }
.gls-res-total__label { display: block; font-size: 11px; color: rgba(255,255,255,.45); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.gls-res-total__value { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: 22px; font-weight: 700; color: #e0c46e; }
.gls-res-total__value--small { font-size: 16px; color: rgba(255,255,255,.8); }

/* Tabella risultati */
.gls-res-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gls-res-table th { background: #243560; color: #e0c46e; font-weight: 700; padding: 9px 12px; text-align: left; font-size: 12px; letter-spacing: .04em; }
.gls-res-table td { padding: 8px 12px; border-bottom: 1px solid #e0dbd0; color: #1a2744; }
.gls-res-table tr:nth-child(even) td { background: rgba(26,39,68,.03); }
.gls-res-table tr:hover td { background: rgba(201,168,76,.07); }
.gls-res-table th:first-child { border-radius: 6px 0 0 0; }
.gls-res-table th:last-child  { border-radius: 0 6px 0 0; }

/* Righe risultato chiave-valore */
.gls-res-rows { background: #fff; border: 1px solid #e0dbd0; border-radius: 8px; overflow: hidden; }
.gls-res-row { display: flex; align-items: center; padding: 11px 16px; border-bottom: 1px solid #f0ede6; }
.gls-res-row:last-child { border-bottom: none; }
.gls-res-row--highlight { background: rgba(201,168,76,.08); font-weight: 700; }
.gls-res-row--danger { background: rgba(155,35,53,.06); }
.gls-res-row__label { flex: 1; font-size: 14px; color: #6b7a99; }
.gls-res-row__value { font-size: 15px; font-weight: 700; color: #1a2744; }

/* Badge */
.gls-res-badge { display: inline-flex; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; }
.gls-res-badge--ok      { background: #d4edda; color: #155724; }
.gls-res-badge--error   { background: #f8d7da; color: #721c24; }
.gls-res-badge--warning { background: #fff3cd; color: #856404; }
.gls-res-badge--info    { background: rgba(26,39,68,.1); color: #1a2744; }

/* Notice */
.gls-calc-notice {
    padding: 12px 16px; border-radius: 7px;
    font-size: 14px; border-left: 3px solid;
}
.gls-calc-notice--error   { background: #f8d7da; color: #721c24; border-color: #dc3545; }
.gls-calc-notice--success { background: #d4edda; color: #155724; border-color: #28a745; }
.gls-calc-notice--info    { background: #d1ecf1; color: #0c5460; border-color: #17a2b8; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .gls-calc-layout { flex-direction: column; }
    .gls-calc-sidebar { width: 100%; }
    .gls-calc-nav { flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 4px; }
    .gls-calc-nav__btn { border-left: none; border-bottom: 2px solid transparent; border-radius: 6px; padding: 7px 10px; font-size: 12px; }
    .gls-calc-nav__btn--active { border-bottom-color: #c9a84c; }
    .gls-calc-main { padding: 20px 16px; max-height: none; }
    .gls-form-grid { grid-template-columns: 1fr; }
    .gls-res-total { flex-direction: column; gap: 8px; }
}
