/* --- Глобальные переменные и стили --- */
:root {
    --primary-color: #007bff; /* Синий */
    --secondary-color: #2c3e50; /* Темно-синий */
    --light-bg: #f8f9fa; /* Светлый фон */
    --text-color: #333;
    --white-color: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    line-height: 1.7;
    background-color: var(--white-color);
    color: var(--text-color);
    font-size: 16px;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--secondary-color);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 50px; }
h3 { font-size: 1.5rem; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 80px 0; }
.bg-light { background-color: var(--light-bg); }

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}
.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white-color);
}
.btn-secondary:hover {
    background-color: #1a2531;
}

/* --- Шапка (Hero Header) --- */
.hero-header {
    height: 90vh;
    min-height: 600px;
    background: url('../img/back-home.jpg') no-repeat center center/cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    color: var(--white-color);
}
.hero-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}
.hero-content h1 {
    color: var(--white-color);
    line-height: 1.2;
    margin-bottom: 20px;
}
.hero-content p {
    font-size: 1.4rem;
    margin-bottom: 30px;
}

/* --- Навигация --- */
.main-nav {
    background-color: var(--white-color);
    padding: 15px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}
.main-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    margin: 0 20px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}
.main-nav a:hover {
    color: var(--primary-color);
}

/* --- Основной контент --- */
#welcome ul {
    list-style: none;
    padding-left: 0;
}
#welcome li {
    padding-left: 1.5em;
    text-indent: -1.5em;
    margin-bottom: 10px;
}
#welcome li::before {
    content: '\f058'; /* FontAwesome check-circle icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-color);
    margin-right: 10px;
}

/* --- Карточки услуг --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.service-card img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}
.service-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.service-card a:hover {
    text-decoration: underline;
}

/* --- Форма заявки --- */
.loan-form {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.loan-form h3 {
    margin-top: 30px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}
.loan-form h3:first-child {
    margin-top: 0;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
}
.form-group-radio, .form-group-checkbox {
    margin-bottom: 20px;
}
.form-group-radio label, .form-group-checkbox label {
    font-weight: 500;
}
.form-group-radio div {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.form-group-radio input, .form-group-checkbox input {
    margin-right: 8px;
}

/* --- Верификация --- */
#verification p {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 30px;
}
.bank-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.bank-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 70px;
    padding: 0 25px;
}
.bank-button img {
    max-height: 40px;
    width: auto;
}
.bank-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* --- Калькулятор --- */
.calculator-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    background: var(--white-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.slider-group {
    margin-bottom: 30px;
}
.slider-group label {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 15px;
    display: block;
}
.slider-value {
    color: var(--primary-color);
    font-weight: 700;
}
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
.calculator-results {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 1.3rem;
    text-align: center;
}
.calculator-results p {
    margin: 10px 0;
}
.calculator-results span {
    font-weight: 700;
    color: var(--primary-color);
}

/* --- FAQ --- */
.faq-grid {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
}
.faq-item h3 {
    font-size: 1.2rem;
    margin: 0;
    padding: 20px;
    cursor: pointer;
    position: relative;
    user-select: none;
}
.faq-item h3::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}
.faq-item.open h3::after {
    transform: translateY(-50%) rotate(45deg);
}
.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
}
.faq-item.open .faq-answer {
    max-height: 200px; /* Adjust if needed */
    padding-bottom: 20px;
}

/* --- Чат-виджет --- */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.5s ease-out;
    overflow: hidden;
}
.chat-header {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 10px 15px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-close {
    background: none;
    border: none;
    color: var(--white-color);
    font-size: 1.5rem;
    cursor: pointer;
}
.chat-body {
    padding: 20px;
    text-align: center;
}
.chat-body p {
    margin: 0 0 15px 0;
}
@keyframes slideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- НОВЫЙ СОВРЕМЕННЫЙ ФУТЕР (Улучшенная версия) --- */

.site-footer {
    background-color: #1c2833; 
    color: #b3c1d1;
    padding: 80px 0 0;
    text-align: left;
}

/* Главная сетка футера: делит его на 2 колонки */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две равные колонки */
    gap: 60px; 
    padding-bottom: 60px;
}

/* Общие стили для заголовков в обеих колонках */
.footer-heading {
    color: var(--white-color);
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 25px;
}


/* --- Левая колонка: Информация --- */

.footer-info p.footer-description {
    margin-bottom: 25px;
    line-height: 1.7;
}
.contact-details p {
    display: flex;
    align-items: center;
    margin: 0 0 15px 0;
}
.contact-details i {
    color: var(--primary-color);
    font-size: 1rem;
    width: 20px;
    margin-right: 15px;
}
.contact-details span {
    flex: 1;
}
.contact-details a {
    color: #b3c1d1;
    text-decoration: none;
    transition: color 0.3s;
}
.contact-details a:hover {
    color: var(--white-color);
}
.social-links {
    margin-top: 30px;
}
.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #2c3e50;
    color: var(--white-color);
    border-radius: 50%;
    text-decoration: none;
    margin-right: 10px;
    transition: background-color 0.3s, transform 0.3s;
}
.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}


/* --- Правая колонка: Форма --- */

/* Стили для обертки правой колонки */
.footer-form-wrapper {
    /* Этот блок является контейнером для правой колонки.
       Его положение контролируется родительской сеткой .footer-grid.
       Дополнительные стили здесь не нужны. */
}
.footer-form-wrapper p {
    margin-top: 0;
    margin-bottom: 25px;
    line-height: 1.7;
}

/* Стили для самого тега <form> */
.footer-form {
    display: flex; /* Включаем Flexbox для управления элементами формы */
    flex-direction: column; /* Располагаем элементы друг под другом */
    gap: 15px; /* Современный способ сделать отступы между полями и кнопкой */
}

/* Убираем старый отступ у .form-group, так как теперь используется gap */
.footer-form .form-group {
    margin-bottom: 0;
}

.footer-form input,
.footer-form textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #4a627a;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    background-color: #2c3e50;
    color: var(--white-color);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.footer-form input::placeholder,
.footer-form textarea::placeholder {
    color: #8592a2;
}
.footer-form input:focus,
.footer-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
.footer-form button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}


/* --- Нижняя строка с копирайтом --- */

.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid #2c3e50;
    font-size: 0.9rem;
    text-align: center;
    color: #8592a2;
}


/* --- Адаптивность для футера --- */

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr; /* На планшетах и мобильных - одна колонка */
        gap: 50px;
    }
    .site-footer {
        padding-top: 60px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        padding: 10px 0;
    }
    .main-nav a {
        margin: 0 10px;
        font-size: 1rem;
    }
    .services-grid {
        grid-template-columns: 1fr 1fr;
    }
    .loan-form, .calculator-container {
        padding: 30px;
    }
}

@media (max-width: 576px) {
    body { font-size: 15px; }
    h1 { font-size: 2.2rem; }
    .hero-content p { font-size: 1.2rem; }
    .main-nav .container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .main-nav a { margin: 0; }
    .section { padding: 60px 0; }
    h2 { margin-bottom: 30px; }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .loan-form, .calculator-container {
        padding: 20px;
    }
    .bank-logos {
        gap: 15px;
    }
    .bank-button {
        height: 60px;
        padding: 0 20px;
    }
    .chat-widget {
        width: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}