/* KSM Forms - Frontend Styles */

/* Form Wrapper */
#ksm-contact-form {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Form Container */
.ksm-contact-form {
    max-width: 100%;
    padding: 20px;
}

/* Form Fields */
.ksm-contact-form__field {
    margin-bottom: 20px;
}

.ksm-contact-form__field--name,
.ksm-contact-form__field--email,
.ksm-contact-form__field--phone,
.ksm-contact-form__field--message {
    /* Individual field styling can be added here */
}

/* Labels */
.ksm-contact-form__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.ksm-contact-form__required {
    color: #d63638;
}

/* Input Fields */
.ksm-contact-form__input,
.ksm-contact-form__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.ksm-contact-form__input:focus,
.ksm-contact-form__textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.ksm-contact-form__input::placeholder,
.ksm-contact-form__textarea::placeholder {
    color: #999;
}

/* Textarea specific */
.ksm-contact-form__textarea {
    resize: vertical;
    min-height: 120px;
}

/* Honeypot Field - Hidden from users */
.ksm-contact-form__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Submit Button */
.ksm-contact-form__submit {
    margin-top: 24px;
}

.ksm-contact-form__button {
    background-color: #0073aa;
    color: #fff;
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    display: inline-block;
}

.ksm-contact-form__button:hover {
    background-color: #005a87;
}

.ksm-contact-form__button:active {
    transform: translateY(1px);
}

.ksm-contact-form__button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Messages */
.ksm-contact-form__message {
    margin-top: 20px;
    padding: 16px;
    border-radius: 4px;
    font-size: 15px;
}

.ksm-contact-form__message--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ksm-contact-form__message--error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.ksm-contact-form.loading .ksm-contact-form__button {
    position: relative;
    color: transparent;
}

.ksm-contact-form.loading .ksm-contact-form__button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ksm-form-spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .ksm-contact-form {
        padding: 15px;
    }
    
    .ksm-contact-form__input,
    .ksm-contact-form__textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}
