/* ═══════════════════════════════════════════════
   TREASURYWORKS — STYLE: STRUMENTI
   ═══════════════════════════════════════════════ */

/* --- HERO STRUMENTI --- */
.hero-tools {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--orange);
}

.hero-tools::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(249, 115, 22, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-tools .hero-content {
    position: relative;
    z-index: 2;
}

.hero-tools .hero-badge {
    background: linear-gradient(135deg, var(--orange), #ea580c);
    color: #fff;
}

.hero-tools .hero-visual {
    position: absolute;
    right: -5%;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    opacity: 0.15;
}

/* --- TOOLS GRID --- */
.tools-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 35px 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.tool-card h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 10px;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tool-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn {
    background: linear-gradient(135deg, var(--orange), #ea580c);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(249, 115, 22, 0.4);
}

/* --- MINI CHARTS --- */
.mini-chart {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.mini-chart .bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-height: 10px;
    transition: height 0.8s ease;
}

/* Debt Progress */
.debt-progress {
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), #22c55e);
    border-radius: 12px;
    transition: width 1.5s ease;
}

.progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Savings Piggy */
.savings-piggy {
    position: relative;
    width: 60px;
    height: 50px;
}

.piggy-body {
    width: 60px;
    height: 45px;
    background: var(--orange);
    border-radius: 50% 50% 40% 40%;
    position: relative;
}

.piggy-body::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 15px;
    background: var(--orange);
    border-radius: 50% 50% 0 0;
}

.piggy-coin {
    position: absolute;
    top: -15px;
    right: 0;
    background: var(--gold);
    color: #1a1a2e;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    animation: coinDrop 2s ease-in-out infinite;
}

@keyframes coinDrop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(15px); }
}

/* Bias Radar */
.bias-radar {
    position: relative;
    width: 80px;
    height: 80px;
}

.radar-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--orange);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--dist) * -1));
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.6);
}

/* Growth Chart */
.growth-chart {
    width: 100%;
    height: 80px;
}

.growth-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawLine 3s ease forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

.growth-dot {
    filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.8));
}

/* Emergency Meter */
.emergency-meter {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, var(--orange));
    border-radius: 15px;
    transition: width 1.5s ease;
}

.meter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}

/* --- LIVE CALCULATOR --- */
.live-calculator {
    padding: 60px 0;
    background: linear-gradient(135deg, #16213e, #1a1a2e);
}

.calc-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.calc-wrapper h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--orange);
}

.calc-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.calc-field {
    flex: 1;
}

.calc-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.calc-field input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.3s ease;
}

.calc-field input:focus {
    border-color: var(--orange);
}

.calc-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.calc-result-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.result-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.result-value.highlight-orange { color: var(--orange); }
.result-value.highlight-green { color: #22c55e; }
.result-value.highlight-blue { color: var(--blue); }

/* --- RESPONSIVE TOOLS --- */
@media (max-width: 768px) {
    .hero-tools .hero-visual { display: none; }
    .tools-grid { grid-template-columns: 1fr; }
    .calc-inputs { flex-direction: column; }
    .calc-results { grid-template-columns: 1fr; }
    .calc-wrapper { padding: 25px; }
}
/* ===== Componenti tool page (aggiunti 2026-09-17) ===== */
.tool-section { padding: 60px 0; }
.tool-form {
  background: var(--card, #111a2e);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 28px;
  margin: 24px 0;
}
.tool-form .form-group { margin-bottom: 18px; }
.tool-form label { display:block; font-weight:600; margin-bottom:8px; color: var(--text-secondary,#94a3b8); font-size:.95rem; }
.tool-form input[type="number"] {
  width: 100%; padding: 13px 16px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--bg-input, #131f36); color: var(--foreground,#e2e8f0);
  font-size: 1.05rem; font-family: inherit;
}
.tool-form input[type="number"]:focus { outline:none; border-color: var(--orange,#f59e0b); box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.tool-result {
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.02));
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 16px; padding: 24px; margin: 24px 0;
}
.calc-results { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; }
.calc-result-card { background: var(--bg-input,#131f36); border-radius:12px; padding:18px; text-align:center; border:1px solid rgba(255,255,255,.06); }
.result-label { display:block; font-size:.85rem; color:var(--text-secondary,#94a3b8); margin-bottom:8px; }
.result-value { display:block; font-size:1.5rem; font-weight:800; color:var(--foreground,#e2e8f0); }
.highlight-green { color:#10b981 !important; }
.highlight-blue { color:#3b82f6 !important; }
.highlight-orange { color:#f59e0b !important; }
.tool-chart { background: var(--card,#111a2e); border-radius:16px; padding:20px; margin:24px 0; border:1px solid rgba(255,255,255,.06); }
.btn-large { padding: 15px 32px; font-size: 1.05rem; display:inline-block; text-align:center; border-radius:12px; }
.mt-4 { margin-top: 32px; }
