/**
 * KFZ-Web Contact Form Styles
 *
 * @package KFZ_Web
 * @since 3.0.0
 */

/* Form Container */
.kfzweb-contact-form {
    background: var(--kfzweb-bg-alt);
    border: 1px solid var(--kfzweb-border);
    border-radius: var(--kfzweb-radius);
    padding: var(--kfzweb-space-6);
    max-width: 500px;
}

.kfzweb-contact-title {
    margin: 0 0 var(--kfzweb-space-5) 0;
    font-size: var(--kfzweb-text-xl);
    font-weight: var(--kfzweb-font-semibold);
    color: var(--kfzweb-primary);
}

/* Vehicle Preview */
.kfzweb-contact-vehicle {
    display: flex;
    align-items: center;
    gap: var(--kfzweb-space-4);
    padding: var(--kfzweb-space-4);
    background: var(--kfzweb-bg);
    border: 1px solid var(--kfzweb-border);
    border-radius: var(--kfzweb-radius);
    margin-bottom: var(--kfzweb-space-5);
}

.kfzweb-contact-vehicle-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--kfzweb-radius-sm);
    flex-shrink: 0;
}

.kfzweb-contact-vehicle-info {
    display: flex;
    flex-direction: column;
    gap: var(--kfzweb-space-1);
}

.kfzweb-contact-vehicle-info strong {
    font-size: var(--kfzweb-text-sm);
    color: var(--kfzweb-text);
    line-height: 1.3;
}

.kfzweb-contact-vehicle-price {
    font-size: var(--kfzweb-text-base);
    font-weight: var(--kfzweb-font-semibold);
    color: var(--kfzweb-primary);
}

/* Form Fields */
.kfzweb-contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--kfzweb-space-4);
}

@media (max-width: 480px) {
    .kfzweb-contact-row {
        grid-template-columns: 1fr;
    }
}

.kfzweb-contact-field {
    margin-bottom: var(--kfzweb-space-4);
}

.kfzweb-contact-field label {
    display: block;
    margin-bottom: var(--kfzweb-space-2);
    font-weight: var(--kfzweb-font-medium);
    font-size: var(--kfzweb-text-sm);
    color: var(--kfzweb-text);
}

.kfzweb-contact-field label .required {
    color: var(--kfzweb-danger);
}

.kfzweb-contact-field input[type="text"],
.kfzweb-contact-field input[type="email"],
.kfzweb-contact-field input[type="tel"],
.kfzweb-contact-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--kfzweb-border);
    border-radius: var(--kfzweb-radius-sm);
    font-size: var(--kfzweb-text-sm);
    font-family: inherit;
    transition: border-color var(--kfzweb-transition), box-shadow var(--kfzweb-transition);
    background: var(--kfzweb-bg);
}

.kfzweb-contact-field input:focus,
.kfzweb-contact-field textarea:focus {
    outline: none;
    border-color: var(--kfzweb-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--kfzweb-primary) 15%, transparent);
}

.kfzweb-contact-field input::placeholder,
.kfzweb-contact-field textarea::placeholder {
    color: var(--kfzweb-gray-400);
}

.kfzweb-contact-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox Field */
.kfzweb-contact-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: var(--kfzweb-space-2);
    font-weight: var(--kfzweb-font-normal);
    cursor: pointer;
}

.kfzweb-contact-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--kfzweb-primary);
}

.kfzweb-contact-checkbox span {
    font-size: var(--kfzweb-text-sm);
    color: var(--kfzweb-text-muted);
    line-height: 1.4;
}

.kfzweb-contact-checkbox a {
    color: var(--kfzweb-primary);
}

/* Submit Button */
.kfzweb-contact-submit {
    margin-top: var(--kfzweb-space-5);
}

.kfzweb-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--kfzweb-space-2);
    width: 100%;
    padding: 10px 20px;
    background: var(--kfzweb-primary);
    color: #fff;
    border: none;
    border-radius: var(--kfzweb-radius);
    font-size: var(--kfzweb-text-sm);
    font-weight: var(--kfzweb-font-semibold);
    cursor: pointer;
    transition: all var(--kfzweb-transition);
}

.kfzweb-contact-btn:hover {
    background: var(--kfzweb-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--kfzweb-shadow-md);
}

.kfzweb-contact-btn:active {
    transform: scale(0.98);
}

.kfzweb-contact-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.kfzweb-contact-btn svg {
    flex-shrink: 0;
}

/* Loading State */
.kfzweb-contact-btn.loading {
    position: relative;
    color: transparent;
}

.kfzweb-contact-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: kfzweb-spin 0.8s linear infinite;
}

@keyframes kfzweb-spin {
    to { transform: rotate(360deg); }
}

/* Feedback Messages */
.kfzweb-contact-feedback {
    margin-top: var(--kfzweb-space-4);
    padding: var(--kfzweb-space-3) var(--kfzweb-space-4);
    border-radius: var(--kfzweb-radius-sm);
    font-size: var(--kfzweb-text-sm);
    display: flex;
    align-items: center;
    gap: var(--kfzweb-space-2);
}

.kfzweb-contact-feedback.success {
    background: var(--kfzweb-success-light);
    color: var(--kfzweb-success-dark);
    border: 1px solid var(--kfzweb-success);
}

.kfzweb-contact-feedback.error {
    background: var(--kfzweb-danger-light);
    color: var(--kfzweb-danger-dark);
    border: 1px solid var(--kfzweb-danger);
}

.kfzweb-contact-feedback svg {
    flex-shrink: 0;
}

/* Validation States */
.kfzweb-contact-field.has-error input,
.kfzweb-contact-field.has-error textarea {
    border-color: var(--kfzweb-danger);
}

.kfzweb-contact-field .error-message {
    color: var(--kfzweb-danger);
    font-size: var(--kfzweb-text-xs);
    margin-top: var(--kfzweb-space-1);
}

/* Success State - Hide Form */
.kfzweb-contact-form.submitted .kfzweb-contact-form-inner {
    display: none;
}

.kfzweb-contact-form.submitted .kfzweb-contact-feedback {
    display: flex !important;
}
