/* ===== LEGAL TOOLS INDEX ===== */
.legal-tools-wrapper {
    padding: 60px 0 80px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.tools-header {
    text-align: center;
    margin-bottom: 50px;
}

.tools-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tools-title .highlight {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tools-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.tools-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 20px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
}

.tool-card:hover:not(.tool-coming-soon) {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.12);
    border-color: #2563eb;
}

.tool-card.tool-coming-soon {
    opacity: 0.7;
    cursor: default;
}

.tool-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-icon svg {
    width: 28px;
    height: 28px;
    color: #2563eb;
}

.tool-content {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 6px;
}

.tool-status {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tool-status.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.tool-status.status-coming {
    background: #fef3c7;
    color: #d97706;
}

.tool-arrow {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.tool-card:hover:not(.tool-coming-soon) .tool-arrow {
    transform: translateX(4px);
    color: #2563eb;
}

/* ===== CTA Section ===== */
.tools-cta {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 20px;
    padding: 50px 60px;
    text-align: center;
    color: #fff;
}

.tools-cta h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tools-cta p {
    font-size: 16px;
    opacity: 0.8;
    margin-bottom: 24px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.tools-cta .btn {
    padding: 12px 32px;
}

.tools-cta .btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.tools-cta .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== DELAY PAYMENT CALCULATOR ===== */
.delay-calculator-wrapper {
    padding: 30px 0 70px;
    background: #f8fafc;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    margin-top: 30px;
}

.calculator-main {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
}

/* ===== Form Styles ===== */
.calculator-form {
    margin-bottom: 10px;
}

.form-row {
    margin-bottom: 24px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group .required {
    color: #ef4444;
}

.input-group {
    position: relative;
}

.input-group .form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.3s ease;
    color: var(--text-primary);
    direction: ltr;
    text-align: right;
}

.input-group .form-control:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-group .form-control.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

.btn-update-rate {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

/* ===== Loading ===== */
.calculator-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Results ===== */
.calculation-results {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-results {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.btn-close-results:hover {
    color: #64748b;
}

.btn-close-results svg {
    width: 24px;
    height: 24px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.result-card {
    padding: 20px;
    border-radius: 14px;
    text-align: center;
}

.result-card-primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
}

.result-card-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
}

.result-card-total {
    background: #dcfce7;
    color: #16a34a;
}

.result-label {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.result-value {
    font-size: 28px;
    font-weight: 800;
}

.result-unit {
    font-size: 13px;
    margin-top: 2px;
}

/* ===== Details ===== */
.results-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
}

.detail-label {
    font-size: 12px;
    color: #94a3b8;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-unit {
    font-size: 12px;
    color: #94a3b8;
}

/* ===== Chart ===== */
.results-chart {
    margin-bottom: 24px;
}

.chart-bar {
    display: flex;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    background: #f1f5f9;
}

.chart-segment {
    height: 100%;
    transition: width 0.6s ease;
}

.chart-segment.debt {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.chart-segment.penalty {
    background: #f59e0b;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.chart-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.debt-label .color-dot {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.penalty-label .color-dot {
    background: #f59e0b;
}

/* ===== Results Actions ===== */
.results-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.results-actions .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
    gap: 8px;
}

/* ===== Sidebar ===== */
.calculator-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.sidebar-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.legal-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legal-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.legal-info-list li:last-child {
    border-bottom: none;
}

.info-label {
    color: #94a3b8;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Explanation ===== */
.sidebar-explanation p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.explanation-formula {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.formula-label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.explanation-formula code {
    font-size: 13px;
    color: #2563eb;
    background: transparent;
    direction: ltr;
    display: block;
    text-align: left;
}

/* ===== FAQ ===== */
.sidebar-faq details {
    margin-bottom: 10px;
}

.sidebar-faq details summary {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px 0;
    font-size: 14px;
}

.sidebar-faq details summary:hover {
    color: #2563eb;
}

.sidebar-faq details p {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0 8px 12px;
    line-height: 1.6;
    margin: 0;
}

/* ===== Sidebar CTA ===== */
.sidebar-cta {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
}

.sidebar-cta h4 {
    color: #fff;
}

.sidebar-cta p {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 16px;
    line-height: 1.6;
}

.sidebar-cta .btn {
    width: 100%;
    justify-content: center;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tools-title {
        font-size: 32px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .tool-card {
        padding: 18px 20px;
    }

    .calculator-main {
        padding: 24px;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
    }

    .tools-cta {
        padding: 30px 24px;
    }

    .tools-cta h3 {
        font-size: 22px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }

    .page-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .calculator-main {
        padding: 16px;
    }

    .result-value {
        font-size: 22px;
    }

    .results-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Print Styles ===== */
@media print {
    .calculator-sidebar,
    .btn-close-results,
    .results-actions .btn:not(.btn-print-result) {
        display: none !important;
    }

    .calculator-main {
        box-shadow: none !important;
        padding: 20px !important;
    }

    .calculator-container {
        display: block !important;
    }

    .results-grid {
        break-inside: avoid;
    }

    .result-card {
        border: 1px solid #e2e8f0 !important;
    }
}
