/**
 * Map + Contact Form Widget Styles
 * Base styles only - colors/typography controlled via Elementor
 */

.ktf-map-form-wrapper {
    display: flex;
    min-height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.ktf-map-form-wrapper.ktf-map-right {
    flex-direction: row-reverse;
}

/* Map Section */
.ktf-map-section {
    flex: 0 0 50%;
    min-height: 100%;
}

.ktf-map-section iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Form Section */
.ktf-form-section {
    flex: 0 0 50%;
    padding: 40px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ktf-form-title {
    margin: 0 0 8px 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.ktf-form-subtitle {
    margin: 0 0 24px 0;
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

/* Form Fields - Managed Forms with Flex Layout */
.ktf-contact-form.ktf-managed-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.ktf-contact-form.ktf-managed-form .ktf-field {
    margin-bottom: 0;
}

/* Field Widths */
.ktf-field-width-100 {
    flex: 0 0 100%;
}

.ktf-field-width-50 {
    flex: 0 0 calc(50% - 10px);
}

.ktf-field-width-33 {
    flex: 0 0 calc(33.333% - 14px);
}

.ktf-field-width-25 {
    flex: 0 0 calc(25% - 15px);
}

/* Legacy Form Fields */
.ktf-contact-form .ktf-field {
    margin-bottom: 20px;
}

.ktf-contact-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.ktf-contact-form label .required {
    color: #ef4444;
    margin-left: 2px;
}

.ktf-contact-form input,
.ktf-contact-form textarea,
.ktf-contact-form select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.ktf-contact-form input:focus,
.ktf-contact-form textarea:focus,
.ktf-contact-form select:focus {
    background: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ktf-contact-form input::placeholder,
.ktf-contact-form textarea::placeholder {
    color: #94a3b8;
}

.ktf-contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* Submit Button */
.ktf-form-footer {
    margin-top: 8px;
}

.ktf-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ktf-submit-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ktf-submit-btn:active {
    transform: translateY(0);
}

.ktf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ktf-submit-btn .ktf-spinner {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: ktf-spin 0.8s linear infinite;
}

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

/* reCAPTCHA Branding */
.ktf-recaptcha-branding {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}

.ktf-recaptcha-branding a {
    color: #6366f1;
    text-decoration: none;
}

.ktf-recaptcha-branding a:hover {
    text-decoration: underline;
}

/* Form Messages */
.ktf-form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    display: none;
}

.ktf-form-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.ktf-form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Select Dropdown */
.ktf-contact-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

/* Radio & Checkbox Groups */
.ktf-contact-form .ktf-radio-group,
.ktf-contact-form .ktf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ktf-contact-form .ktf-radio-label,
.ktf-contact-form .ktf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #374151;
}

.ktf-contact-form .ktf-radio-label input,
.ktf-contact-form .ktf-checkbox-label input {
    width: auto;
    margin: 0;
    accent-color: #6366f1;
}

.ktf-contact-form .ktf-single-checkbox {
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* Managed Form Footer - Full Width */
.ktf-contact-form.ktf-managed-form .ktf-form-footer,
.ktf-contact-form.ktf-managed-form .ktf-form-message,
.ktf-contact-form.ktf-managed-form .ktf-recaptcha-branding {
    flex: 0 0 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .ktf-map-form-wrapper {
        flex-direction: column !important;
    }

    .ktf-map-section,
    .ktf-form-section {
        flex: 1 1 auto !important;
    }

    .ktf-map-section {
        min-height: 300px;
    }

    .ktf-form-section {
        padding: 30px 20px;
    }

    /* Field widths on mobile */
    .ktf-field-width-50,
    .ktf-field-width-33,
    .ktf-field-width-25 {
        flex: 0 0 100%;
    }
}
