/* ============================================================
   KS Contractor Form — Styles
   ============================================================ */

.ks-cf-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: inherit;
}

/* Секции */
.ks-cf-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

.ks-cf-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    color: #1a1a2e;
}

.ks-cf-section-desc {
    color: #666;
    margin: -12px 0 20px;
    font-size: 14px;
}

/* Строки и поля */
.ks-cf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.ks-cf-field {
    display: flex;
    flex-direction: column;
    position: relative;
}

.ks-cf-field.ks-cf-full {
    grid-column: 1 / -1;
}

.ks-cf-field label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.ks-cf-field label small {
    font-weight: 400;
    color: #888;
}

.ks-cf-field input[type="text"],
.ks-cf-field input[type="email"],
.ks-cf-field input[type="tel"],
.ks-cf-field input[type="url"],
.ks-cf-field input[type="number"],
.ks-cf-field select,
.ks-cf-field textarea {
    border: 1.5px solid #ddd;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.ks-cf-field input:focus,
.ks-cf-field select:focus,
.ks-cf-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    background: #fff;
}

.ks-cf-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Ошибки */
.ks-cf-err {
    display: none;
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: #dc2626 !important;
    background: #fff5f5;
}

.has-error .ks-cf-err {
    display: block;
}

.ks-cf-error-banner {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #991b1b;
    font-size: 14px;
}

/* Обязательные */
.req {
    color: #dc2626;
}

/* Радио */
.ks-cf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.ks-cf-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 400 !important;
    color: #333;
}

.ks-cf-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

/* Загрузка файлов */
.ks-cf-doc-row {
    margin-bottom: 16px;
    position: relative;
}

.ks-cf-doc-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.ks-cf-file-drop {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 16px 20px;
    background: #f9fafb;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}

.ks-cf-file-drop:hover,
.ks-cf-file-drop.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}

.ks-cf-file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.ks-cf-drop-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6b7280;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.ks-cf-drop-label svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.ks-cf-file-preview {
    margin-top: 8px;
    position: relative;
    z-index: 3;
    pointer-events: none;
    min-height: 4px;
}

.ks-cf-file-preview:not(:empty) {
    pointer-events: auto;
}

.ks-cf-file-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    margin: 2px 4px 2px 0;
}

.ks-cf-file-item .remove-file {
    cursor: pointer;
    font-weight: 700;
    opacity: .6;
    line-height: 1;
}

.ks-cf-file-item .remove-file:hover { opacity: 1; }

/* Согласия */
.ks-cf-section-consent {
    background: #f8fafc;
}

.ks-cf-checkbox-row {
    margin-bottom: 14px;
    position: relative;
}

.ks-cf-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    font-weight: 400 !important;
}

.ks-cf-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Кнопка отправки */
.ks-cf-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
    margin-top: 16px;
    font-family: inherit;
}

.ks-cf-submit:hover {
    background: #1d4ed8;
}

.ks-cf-submit:active {
    transform: scale(.98);
}

/* Счётчик символов */
.ks-cf-counter {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

/* Успех */
.ks-cf-success {
    text-align: center;
    padding: 60px 40px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}

.ks-cf-success h3 {
    font-size: 24px;
    color: #166534;
    margin: 16px 0 8px;
}

.ks-cf-success p {
    color: #4b7c5b;
    font-size: 15px;
}

/* Уведомление о создании ЛК */
.ks-cf-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0 16px;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.5;
}
.ks-cf-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #3b82f6;
}

/* Адаптив */
@media (max-width: 600px) {
    .ks-cf-row {
        grid-template-columns: 1fr;
    }
    .ks-cf-section {
        padding: 20px 16px;
    }
}
