/* =======================================================
   NavTools - Interessi Conto Deposito / Certificato di Deposito
   Stile coerente con gli altri tool del progetto
   ======================================================= */

.tool-container {
    padding-top: 24px;
    padding-bottom: 48px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 20px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--primary-dark);
    text-decoration: underline;
}

.tool-header {
    max-width: 760px;
    margin: 0 auto 28px;
    text-align: center;
}

.tool-header .logo {
    width: 96px;
    max-width: 30vw;
    margin: 0 auto 14px;
}

h1 {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: clamp(2rem, 4vw, 2.7rem);
    letter-spacing: 0;
}

.description {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

/* -------------------------------------------------------
   Layout griglia
   ------------------------------------------------------- */

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 20px;
    align-items: start;
}

.input-column,
.result-column {
    display: grid;
    gap: 20px;
}

/* -------------------------------------------------------
   Pannelli e Card
   ------------------------------------------------------- */

.panel,
.result-card {
    padding: 24px;
}

.panel h2 {
    margin: 0 0 18px;
    color: var(--primary);
    font-size: 1.2rem;
}

label,
legend {
    display: block;
    margin: 16px 0 6px;
    color: #263846;
    font-weight: 700;
}

label:first-child,
legend:first-child {
    margin-top: 0;
}

input,
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cddbd6;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

.field-note {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

/* -------------------------------------------------------
   Card Risultato e Dettaglio
   ------------------------------------------------------- */

.result-card {
    text-align: center;
    border-top: 5px solid var(--accent);
}

#resultTitle {
    margin: 0 0 10px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

#resultValue {
    min-height: 58px;
    color: var(--primary);
    font-size: clamp(2.1rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 6px;
}

#resultMessage {
    margin: 0;
    font-size: 0.9rem;
    min-height: 1.2em;
}

#resultMessage.error {
    color: var(--danger);
    font-weight: 600;
}

.result-details {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #edf2f0;
    text-align: left;
}

.result-detail-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text);
}

.result-detail-line:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: var(--muted);
}

.detail-val {
    font-weight: 700;
}

/* -------------------------------------------------------
   Tabella di Dettaglio Frequenze
   ------------------------------------------------------- */

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th {
    padding: 10px 6px;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    text-align: right;
}

.detail-table th:first-child {
    text-align: left;
    padding-left: 0;
}

.detail-table td {
    padding: 12px 6px;
    vertical-align: middle;
    font-size: 0.9rem;
    text-align: right;
    font-weight: 600;
}

.detail-table td:first-child {
    text-align: left;
    padding-left: 0;
    color: var(--muted);
    font-weight: 600;
}

.detail-table td:last-child {
    color: var(--primary);
    font-weight: 700;
    padding-right: 0;
}

.detail-table tr:not(:last-child) {
    border-bottom: 1px solid #edf2f0;
}

.detail-table tr.non-applicabile td {
    color: #c5d0d8 !important;
    font-weight: normal !important;
    font-style: italic;
}

/* -------------------------------------------------------
   Blocco di Riepilogo
   ------------------------------------------------------- */

.summary-block {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px dashed var(--border);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.summary-line span:first-child {
    color: var(--muted);
}

.summary-line span:last-child {
    font-weight: 700;
}

.summary-line.highlight {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0;
    margin-top: 12px;
}

.summary-line.highlight span:first-child {
    color: var(--primary);
    font-weight: 700;
}

.summary-line.highlight span:last-child {
    color: var(--accent);
}

/* -------------------------------------------------------
   Box Informativi e Note
   ------------------------------------------------------- */

.info-note-inline {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #eef7f2;
    border: 1px solid #c5e0d5;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

.info-note-inline.warning-style {
    background: #fff8ec;
    border-color: #f0d9a8;
    border-left-color: #b26000;
    color: #7a541a;
}

.info-note-inline.warning-style .info-icon {
    color: #b26000;
}

.info-icon {
    flex-shrink: 0;
    font-size: 1.05rem;
    color: var(--accent);
    line-height: 1.4;
}

.info-card {
    margin-top: 20px;
    padding: 24px;
    color: var(--muted);
}

.info-card h2 {
    margin: 0 0 16px;
    color: var(--primary);
    font-size: 1.1rem;
}

.info-card p {
    margin: 0 0 12px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.info-card p:last-of-type {
    margin-bottom: 0;
}

.info-card ul {
    margin: 0 0 12px;
    padding-left: 20px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.info-card ul li {
    margin-bottom: 6px;
}

.info-card ul li:last-child {
    margin-bottom: 0;
}

.info-card table {
    width: 100%;
    border-collapse: collapse;
}

.info-card td {
    padding: 11px 0;
    vertical-align: top;
    font-size: 0.93rem;
}

.info-card td:first-child {
    color: var(--muted);
}

.info-card td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--text);
}

.info-card tr:not(:last-child) {
    border-bottom: 1px solid #edf2f0;
}

.disclaimer-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
}

/* -------------------------------------------------------
   Responsività
   ------------------------------------------------------- */

@media (max-width: 960px) {
    .detail-table th {
        font-size: 0.72rem;
        padding: 8px 4px;
    }
    .detail-table td {
        font-size: 0.82rem;
        padding: 10px 4px;
    }
}

@media (max-width: 820px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .tool-container {
        width: min(100% - 28px, 680px);
        padding-top: 18px;
    }
}

@media (max-width: 560px) {
    .panel,
    .result-card,
    .info-card {
        padding: 18px;
    }
    
    .detail-table th {
        font-size: 0.65rem;
    }
}
