/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- CSS переменные для легкой смены дизайна --- */
:root {
    --primary-color: #0d253f;
    --secondary-color: #01b4e4;
    --accent-color: #90cea1;
    --text-color: #333;
    --light-text-color: #f8f9fa;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --header-gradient: linear-gradient(90deg, #0d253f 0%, #01b4e4 100%);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
    --font-family: 'Poppins', sans-serif;
}

/* --- Базовые стили --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main {
    overflow-x: hidden; /* Предотвращает горизонтальный скролл от анимаций */
}

.section {
    padding: 80px 0;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.section.active {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- Header --- */
.site-header {
    background: var(--header-gradient);
    color: var(--light-text-color);
    padding: 40px 0;
    text-align: center;
    position: relative;
}
.header-content {
    max-width: 800px;
    margin: 0 auto;
}
.header-title {
    font-size: 3rem;
    font-weight: 700;
}
.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* --- Навигация --- */
.main-nav {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}
.main-nav .container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}
.main-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 5px 15px;
    border-radius: var(--border-radius);
    transition: color 0.3s, background-color 0.3s;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--light-text-color);
    background-color: var(--secondary-color);
}

/* --- Секция Intro --- */
#intro .intro-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}
#intro h2 { color: var(--primary-color); font-size: 1.8rem; margin-bottom: 15px; }

/* --- Кредитный калькулятор (Новая фишка) --- */
#calculator {
    background-color: #eaf6ff;
}
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background: var(--card-background);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.calculator-form, .calculator-results {
    padding: 20px;
}
.form-group {
    margin-bottom: 25px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}
.form-group .value-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}
input[type="range"]:hover {
    opacity: 1;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--secondary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--card-background);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.calculator-results h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}
.result-item {
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.result-item span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: block;
}
.cta-button {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--light-text-color);
    padding: 12px 25px;
    margin-top: 20px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(1, 180, 228, 0.4);
}

/* --- Секция Features --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.feature-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}
.feature-card .icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}
.feature-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* --- Секция Comparison (Creditor Cards) --- */
.creditor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}
.creditor-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.creditor-logo {
    max-height: 40px;
    width: auto;
    margin-bottom: 20px;
    align-self: center;
}
.creditor-card h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
}
.creditor-card ul {
    list-style: none;
    margin-bottom: 25px;
}
.creditor-card li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}
.creditor-card li i {
    color: var(--secondary-color);
    margin-right: 12px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}
.creditor-card .cta-button {
    margin-top: auto; /* Прижимает кнопку к низу карточки */
    align-self: center;
}

/* --- Сравнительная таблица --- */
.comparison-table-wrapper {
    overflow-x: auto; /* Делает таблицу скроллящейся на мобильных */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-background);
}
.comparison-table th, .comparison-table td {
    padding: 18px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.comparison-table th {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    font-weight: 600;
}
.comparison-table tr:last-child td {
    border-bottom: none;
}
.comparison-table tr:nth-child(even) {
    background-color: #f8f9fa;
}
.comparison-table td a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
}

/* --- Секция Application Form --- */
#application {
    background-color: #eaf6ff;
}
.form-section {
    max-width: 700px;
    margin: 0 auto;
    background: var(--card-background);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.form-section form {
    display: grid;
    gap: 20px;
}
.form-section label {
    font-weight: 600;
}
.form-section input, .form-section select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-section input:focus, .form-section select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(1, 180, 228, 0.2);
}

/* --- Секция FAQ --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    background: var(--card-background);
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--border-color);
    transition: border-left-color 0.3s;
}
.faq-item.active {
    border-left-color: var(--secondary-color);
}
.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}
.faq-question i {
    transition: transform 0.3s ease-in-out;
}
.faq-item.active .faq-question i {
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease;
    padding: 0 20px;
}
.faq-answer p {
    padding-bottom: 20px;
}

/* --- Секция Contacts --- */
.contact-section {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--card-background);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.contact-section p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* --- Footer --- */
.site-footer-bottom {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 50px 0 20px;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}
.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}
.footer-col p, .footer-col a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-bottom: 8px;
}
.footer-col i {
    margin-right: 8px;
}
.social-icons a {
    color: var(--light-text-color);
    font-size: 1.3rem;
    margin-right: 15px;
    transition: color 0.3s;
}
.social-icons a:hover {
    color: var(--secondary-color);
}
.footer-bottom-text {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

/* --- Адаптивность --- */
@media (max-width: 992px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-title { font-size: 2.5rem; }
    .section-title { font-size: 2rem; }
    .main-nav .container { justify-content: space-around; }
    .main-nav a { padding: 5px 10px; font-size: 0.9rem; }
}

@media (max-width: 576px) {
    .header-title { font-size: 2rem; }
    .header-subtitle { font-size: 1rem; }
    .section { padding: 60px 0; }
    .calculator-wrapper, .form-section, .contact-section { padding: 25px; }
}

/* --- Стили для Мобильной Навигации --- */

.mobile-nav-toggle {
    display: none; /* Скрыт на десктопе */
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
}

.mobile-nav-toggle .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--light-text-color);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.mobile-nav-toggle .bar:nth-child(2) {
    margin: 6px 0;
}

/* Анимация бургера в крестик */
.mobile-nav-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.mobile-nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.mobile-nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(13, 37, 63, 0.98); /* --primary-color с прозрачностью */
    backdrop-filter: blur(5px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.4s ease-in-out;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.mobile-nav a {
    color: var(--light-text-color);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 20px 0;
    transition: color 0.3s;
}

.mobile-nav a:hover {
    color: var(--secondary-color);
}

/* Класс для body, чтобы запретить скролл при открытом меню */
.body-mobile-nav-open {
    overflow: hidden;
}


/* --- Медиа-запросы для адаптивности --- */
/* Меняем breakpoint на 992px для более раннего переключения на мобильное меню */
@media (max-width: 992px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
    
    .main-nav {
        display: none;
    }
    .mobile-nav-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .header-title { font-size: 2.5rem; }
    .section-title { font-size: 2rem; }
}

@media (max-width: 576px) {
    .header-title { font-size: 2rem; }
    .header-subtitle { font-size: 1rem; }
    .section { padding: 60px 0; }
    .calculator-wrapper, .form-section, .contact-section { padding: 25px; }
}