/* Contact Form Styles */

.contact-form-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    font-family: "Roboto", sans-serif;
}

.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form-title {
    text-align: center;
    color: #0f172a;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 15px;
}

.contact-form-subtitle {
    text-align: center;
    color: #475569;
    font-size: 1.125rem;
    margin-bottom: 40px;
}

.contact-form {
    background: white;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 14px;
}

/* Парные поля в один ряд на десктопе (на мобиле - в столбец, см. медиазапрос) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-label .required {
    color: #ff3366;
    margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #1c5fa1;
    box-shadow: 0 0 0 3px rgba(28, 95, 161, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
}

.form-textarea {
    min-height: 60px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-submit {
    width: 100%;
    margin-top: 4px;
    padding: 13px 32px;
    background: #1c5fa1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-submit:hover {
    background: #1a5089;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 95, 161, 0.3);
}

.form-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    display: none;
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.form-privacy {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-top: 10px;
    line-height: 1.45;
}

.form-privacy a {
    color: #1c5fa1;
    text-decoration: underline;
}

.form-privacy a:hover {
    color: #1a5089;
}

/* Responsive */
@media (max-width: 768px) {
    .contact-form-section {
        padding: 60px 20px;
    }
    
    .contact-form {
        padding: 30px 20px;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 0;
    }

    .form-row .form-group {
        margin-bottom: 14px;
    }
}

/* Honeypot - антиспам. Скрыто off-screen (не display:none), боты заполняют */
.form-hp {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Подсветка незаполненного обязательного поля при мягкой валидации */
.form-invalid {
    border-color: #ff3366 !important;
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.12) !important;
}

/* ===== Табы формы: розница / опт ===== */
.form-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #eef2f7;
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-family: "Manrope", "Roboto", sans-serif;
}

.form-tab {
    appearance: none;
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    min-height: 44px;
}

.form-tab:hover {
    color: #1c5fa1;
}

.form-tab.is-active {
    background: #ffffff;
    color: #1c5fa1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* Панель таба и шаг мастера: плавное появление */
.form-panel,
.form-step {
    display: none;
}

.form-panel.is-active,
.form-step.is-active {
    display: block;
    animation: formFade 0.25s ease;
}

@keyframes formFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-step-title {
    font-family: "Manrope", "Roboto", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1c5fa1;
    margin: 0 0 12px;
}

/* Две колонки на десктопе (одна на мобиле, см. медиазапрос) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    margin-bottom: 12px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

/* Кнопки шага 2: Назад / Отправить в один ряд */
.form-step-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-top: 4px;
}

.form-back {
    appearance: none;
    width: 100%;
    padding: 13px 16px;
    background: #eef2f7;
    color: #334155;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
    box-sizing: border-box;
    min-height: 44px;
}

.form-back:hover {
    background: #e2e8f0;
}

.form-step-actions .form-submit {
    margin-top: 0;
}

/* Textarea в B2B-анкете - невысокая (2-3 строки) */
.form-panel[data-panel="wholesale"] .form-textarea {
    min-height: 52px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-grid .form-group {
        margin-bottom: 12px;
    }
}

/* Компактный режим формы внутри модалки на мобиле - чтобы шаг мастера влезал по высоте */
@media (max-width: 640px) {
    .modal-body .contact-form {
        padding: 10px;
    }

    .modal-body .form-label {
        margin-bottom: 4px;
        font-size: 0.85rem;
    }

    .modal-body .form-input,
    .modal-body .form-select,
    .modal-body .form-textarea {
        padding: 9px 12px;
    }

    .modal-body .form-grid .form-group {
        margin-bottom: 10px;
    }

    .modal-body .form-tabs {
        margin-bottom: 12px;
    }

    .modal-body .form-step-title {
        margin-bottom: 10px;
    }

    .modal-body .form-panel[data-panel="wholesale"] .form-textarea {
        min-height: 46px;
    }
}
