/* Форма */
.cff-form {
    max-width: 100%;
    margin: 0 auto;
}
.cff-form label {
    display: block;
    margin-top: 10px;
}
.cff-form .cff-required {
    color: #dc3545;
    font-weight: bold;
}
.cff-form input, .cff-form textarea {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    box-sizing: border-box;
    font-size: 16px;
}
.cff-form textarea {
    min-height: 180px;
    resize: vertical;
}
.cff-form button {
    margin-top: 15px;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}
.cff-form button:hover {
    background: #005a87;
}
.cff-field {
    margin-bottom: 10px;
}

/* Пошаговая форма */
.cff-multistep .cff-step {
    display: none;
}
.cff-multistep .cff-step.active {
    display: block;
}

/* Прогресс-бар */
.cff-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    gap: 10px;
}
.cff-progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    position: relative;
}
.cff-progress-step.active {
    background: #007cba;
    color: white;
}
.cff-progress-step.completed {
    background: #28a745;
    color: white;
}
.cff-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    width: 10px;
    height: 2px;
    background: #e0e0e0;
    transform: translateY(-50%);
}
.cff-progress-step.completed:not(:last-child)::after {
    background: #28a745;
}

/* Кнопки навигации */
.cff-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.cff-prev-btn {
    background: #6c757d !important;
}
.cff-prev-btn:hover {
    background: #545b62 !important;
}
.cff-next-btn {
    flex: 1;
}

/* Honeypot: скрытое поле от ботов */
.cff-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Блок подтверждения на странице /thanks/ */
.cff-confirm-container {
    max-width: 500px;
    margin: 20px auto;
}

.cff-confirm-container h3 {
    margin: 0 0 20px 0;
    color: #ff0000 !important;
}

.cff-confirm-container,
.cff-confirm-container p,
.cff-confirm-container strong {
    color: #333 !important;
}

.cff-confirm-data {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.cff-confirm-data p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.cff-confirm-data p:last-child {
    margin-bottom: 0;
}

.cff-confirm-data .cff-message {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #eee;
    margin-top: 10px;
}

.cff-confirm-buttons {
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

#cff-edit {
    padding: 15px 30px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#cff-edit:hover {
    background: #5a6268;
}

#cff-confirm {
    padding: 15px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#cff-confirm:hover {
    background: #218838;
}

/* Кнопки сохранения и отмены */
#cff-save-edit {
    padding: 15px 30px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

#cff-save-edit:hover { background: #0056b3; }
#cff-save-edit:disabled { background: #6c757d; cursor: not-allowed; }

#cff-cancel-edit {
    padding: 15px 30px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

#cff-cancel-edit:hover { background: #c82333; }

/* Режим просмотра */
.cff-field-row {
    display: block;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: transparent;
    border-bottom: 1px solid #eee;
    position: relative;
}

.cff-field-row:last-child {
    border-bottom: none;
}

.cff-field-row strong {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 13px;
}

.cff-field-row .cff-value {
    display: block;
    font-size: 16px;
    word-break: break-word;
}

.cff-field-row .cff-message {
    display: block;
    margin: 0;
    font-size: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

.cff-edit-field-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
    opacity: 0.4;
}

.cff-edit-field-btn:hover { opacity: 1; }

/* Режим редактирования */
.cff-edit-mode .cff-field {
    margin-bottom: 15px;
}

.cff-edit-mode .cff-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.cff-edit-mode .cff-field input,
.cff-edit-mode .cff-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.cff-edit-mode .cff-field textarea {
    min-height: 100px;
    resize: vertical;
}

.cff-error {
    text-align: center;
    padding: 20px;
}

.cff-error p {
    color: #666;
}

.cff-error a {
    color: #007cba;
}

/* Модальное окно ошибки отправки */
.cff-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cff-fadeIn 0.3s ease;
}

@keyframes cff-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cff-error-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: cff-slideUp 0.3s ease;
}

@keyframes cff-slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.cff-error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.cff-error-title {
    color: #dc3545 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    margin: 0 0 15px 0 !important;
}

.cff-error-text {
    color: #333 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin: 0 0 20px 0 !important;
}

.cff-error-email-block {
    background: #f8f9fa;
    border: 2px dashed #dc3545;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.cff-error-label {
    color: #666 !important;
    font-size: 13px !important;
    margin: 0 0 8px 0 !important;
}

.cff-error-email {
    color: #dc3545 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    word-break: break-all;
}

.cff-error-hint {
    color: #666 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin: 0 0 20px 0 !important;
}

.cff-error-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cff-error-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    text-align: center;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cff-error-btn-primary {
    background: #dc3545 !important;
    color: #fff !important;
    border: none;
}

.cff-error-btn-primary:hover {
    background: #c82333 !important;
    color: #fff !important;
}

.cff-error-btn-copy {
    background: #f8f9fa !important;
    color: #333 !important;
    border: 2px solid #dee2e6 !important;
}

.cff-error-btn-copy:hover {
    background: #e9ecef !important;
    border-color: #ced4da !important;
}

.cff-error-btn-close {
    margin-top: 15px;
    background: transparent !important;
    color: #6c757d !important;
    border: none !important;
    font-size: 13px !important;
    padding: 10px !important;
}

.cff-error-btn-close:hover {
    color: #495057 !important;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .cff-error-modal {
        padding: 25px 20px;
    }
    
    .cff-error-title {
        font-size: 18px !important;
    }
    
    .cff-error-email {
        font-size: 16px !important;
    }
}
