/**
 * LendCity Contact Form Styles
 * 
 * These styles are designed to inherit and complement GeneratePress theme styling.
 * Uses GP's default form element styling and .button class for consistency.
 */

/* Form Container */
.lendcity-contact-form-wrapper {
    max-width: 100%;
}

.lendcity-contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

/* Field Groups */
.lendcity-cf-field {
    display: flex;
    flex-direction: column;
}

/* Labels - Inherit GP body font styling */
.lendcity-cf-field > label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

/* Required asterisk - Match screenshot red color */
.lendcity-cf-field .required {
    color: #e74c3c;
}

/* Name Fields - Split layout */
.lendcity-cf-name-fields {
    display: flex;
    gap: 1em;
}

.lendcity-cf-name-first,
.lendcity-cf-name-last {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Sub-labels (First, Last) */
.lendcity-cf-sub-label {
    display: block;
    margin-top: 0.35em;
    font-size: 0.875em;
    color: var(--contrast-2, #575760);
}

/**
 * Form Inputs
 * 
 * GeneratePress applies default styling to these selectors:
 * input[type="text"], input[type="email"], input[type="tel"], textarea
 * 
 * We add minimal overrides to match the screenshot while inheriting GP styling.
 */
.lendcity-contact-form input[type="text"],
.lendcity-contact-form input[type="email"],
.lendcity-contact-form input[type="tel"],
.lendcity-contact-form textarea {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

/* Textarea specific sizing */
.lendcity-contact-form textarea {
    min-height: 200px;
    resize: vertical;
}

/**
 * Submit Button
 * 
 * Inherits GP's button styling completely.
 * No color overrides - let the theme handle it.
 */
.lendcity-cf-submit {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.lendcity-cf-submit:active {
    transform: translateY(1px);
}

/* Loading state */
.lendcity-cf-submit.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.lendcity-cf-submit.loading::after {
    content: '...';
}

/* Messages */
.lendcity-cf-messages {
    margin-top: 0.5em;
}

.lendcity-cf-success {
    padding: 1em;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 4px;
}

.lendcity-cf-error {
    padding: 1em;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 4px;
}

/* Field validation error state */
.lendcity-contact-form input:invalid:not(:placeholder-shown),
.lendcity-contact-form textarea:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

/* Focus states - Inherit GP styling, add visible focus for accessibility */
.lendcity-contact-form input:focus,
.lendcity-contact-form textarea:focus {
    outline: 2px solid var(--accent, #1e73be);
    outline-offset: 2px;
}

/* Honeypot field - hidden from users, catches bots */
.lendcity-cf-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .lendcity-cf-name-fields {
        flex-direction: column;
    }
    
    .lendcity-cf-submit {
        width: 100%;
    }
}
