/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    margin-left: 80px;
}

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

/* Navigation Styles */
.nav {
    display: flex;
    gap: 35px;
    align-items: center;
    margin-left: auto;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-link:hover {
    color: #ac1a24;
}

.nav-link.active {
    color: #333;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ac1a24;
}

/* Скрываем ссылку Perfil на десктопе */
.nav-link-perfil {
    display: none;
}

/* Profile Button */
.btn-perfil {
    background-color: #ac1a24;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(172, 26, 36, 0.3);
}

.btn-perfil:hover {
    background-color: #8d1520;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(172, 26, 36, 0.4);
}

.btn-perfil i {
    font-size: 14px;
}

/* Red Separator Line */
.separator {
    height: 3px;
    background: #ac1a24;
    box-shadow: 0 1px 3px rgba(172, 26, 36, 0.3);
}

/* Main Content */
.main-content {
    background-color: #f5f5f5;
    padding: 40px 0;
}

/* Calculator Header */
.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.calculator-title h1 {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.calculator-title h2 {
    font-size: 24px;
    font-weight: 600;
    color: #275193;
    margin-bottom: 10px;
}

.calculator-subtitle {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Calculator Content */
.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Calculator Form */
.calculator-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border-top: 4px solid #275193;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* Убираем стрелочки у input type="number" */
.form-input::-webkit-outer-spin-button,
.form-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-input[type=number] {
    -moz-appearance: textfield;
}

.form-input:focus {
    outline: none;
    border-color: #275193;
    box-shadow: 0 0 0 3px rgba(39, 81, 147, 0.1);
}

.input-suffix {
    position: absolute;
    right: 15px;
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    margin: 15px 0 5px 0;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ac1a24;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.slider::-moz-range-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    border: none;
}

.slider::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: #ac1a24;
    border: none;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ac1a24;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.input-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    font-style: italic;
}

/* Calculator Results */
.calculator-results {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.results-header {
    background: #ac1a24;
    color: white;
    padding: 18px 25px;
}

.results-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.results-header p {
    font-size: 13px;
    opacity: 0.95;
}

.results-body {
    padding: 15px 25px;
}

.monthly-payment {
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
}

.monthly-payment h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.payment-amount {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.chart-legend {
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.progress-bar {
    display: flex;
    height: 25px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    transition: width 0.3s ease;
}

.calculation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4CAF50;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.calculation-status i {
    font-size: 18px;
}

.total-amount {
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 0;
}

.total-amount h4 {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.total-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.important-note {
    background: #ffe6e6;
    border-left: 4px solid #ac1a24;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}

.important-note strong {
    color: #ac1a24;
}

/* Responsive Design */
@media (max-width: 968px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .logo {
        order: 1;
        margin-left: 0;
    }

    .nav {
        order: 2;
        margin-left: 0;
        flex-basis: 100%;
        justify-content: center;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 12px;
        row-gap: 10px;
    }

    .nav-link {
        padding: 5px 2px;
        white-space: nowrap;
    }

    .btn-perfil {
        display: none;
    }

    /* Показываем ссылку Perfil на мобильных */
    .nav-link-perfil {
        display: inline-flex;
        align-items: center;
        background-color: #ac1a24;
        color: white !important;
        padding: 5px 15px;
        border-radius: 6px;
        font-weight: 600;
        position: relative;
        height: auto;
    }

    .nav-link-perfil:hover {
        color: white !important;
        background-color: #8d1520;
    }

    .nav-link-perfil.active::after {
        display: none;
    }

    .nav-link-perfil::before {
        content: '';
        display: none;
    }

    .calculator-content {
        grid-template-columns: 1fr;
    }

    .calculator-header {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .nav {
        gap: 10px;
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 13px;
    }
    
    .nav-link-perfil {
        font-size: 13px;
        padding: 5px 12px;
    }

    .calculator-title h1 {
        font-size: 28px;
    }

    .calculator-title h2 {
        font-size: 20px;
    }

    .payment-amount {
        font-size: 28px;
    }

    .total-value {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 50px;
    }

    .btn-perfil {
        padding: 10px 20px;
        font-size: 14px;
    }

    .main-content {
        padding: 20px 0;
    }

    .calculator-form,
    .calculator-results .results-body {
        padding: 20px;
    }

    .calculator-title h1 {
        font-size: 24px;
    }

    .calculator-title h2 {
        font-size: 18px;
    }
}

