/**
 * LeadMachine Connector - Frontend Styles
 */

.leadmachine-form-container {
    width: 100%;
    max-width: 100%;
    padding: 30px;
    background: transparent;
    border-radius: 8px;
    box-shadow: none;
    box-sizing: border-box;
}

/* Optional: constrained width variant */
.leadmachine-form-container.leadmachine-form-constrained {
    max-width: 600px;
    margin: 0 auto;
}

.leadmachine-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.leadmachine-form-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #333;
}

.leadmachine-form-description {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.leadmachine-form-row {
    margin-bottom: 20px;
}

.leadmachine-form-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Newsletter form: inline layout on desktop */
.leadmachine-newsletter-container .leadmachine-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: start;
}

.leadmachine-newsletter-container .leadmachine-form-row {
    margin-bottom: 0;
}

.leadmachine-newsletter-container .leadmachine-form-group {
    text-align: left;
}

.leadmachine-newsletter-container .leadmachine-form-group label {
    text-align: left;
    display: block;
}

.leadmachine-newsletter-container .leadmachine-form-messages {
    grid-column: 1 / -1;
}

.leadmachine-newsletter-container .leadmachine-form-row.leadmachine-optin-row {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.leadmachine-newsletter-container .leadmachine-button-row {
    align-self: end;
}

.leadmachine-newsletter-container .leadmachine-submit-button {
    height: fit-content;
    padding: 12px 30px;
    white-space: nowrap;
    margin-bottom: 0;
}

.leadmachine-form-group {
    display: flex;
    flex-direction: column;
}

.leadmachine-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.leadmachine-required {
    color: #d63638;
}

.leadmachine-form-group input[type="text"],
.leadmachine-form-group input[type="email"],
.leadmachine-form-group input[type="tel"],
.leadmachine-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    background-color: #ffffff;
    color: #333333;
}

.leadmachine-form-group input:focus,
.leadmachine-form-group textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.leadmachine-form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.leadmachine-submit-button {
    width: 100%;
    padding: 15px;
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.leadmachine-submit-button:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.leadmachine-submit-button:active {
    transform: translateY(0);
}

.leadmachine-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.leadmachine-button-spinner {
    display: inline-block;
}

.leadmachine-form-messages {
    margin-bottom: 20px;
}

.leadmachine-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.leadmachine-message-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.leadmachine-message-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.leadmachine-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

/* Checkbox Styles */
.leadmachine-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}

.leadmachine-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.leadmachine-checkbox-text {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.leadmachine-checkbox-text a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

.leadmachine-checkbox-text a:hover {
    opacity: 0.8;
}

.leadmachine-text-muted {
    opacity: 0.7;
    font-size: 13px;
}

/* Honeypot field - hidden from users, visible to bots */
.leadmachine-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .leadmachine-form-container {
        padding: 20px;
    }

    .leadmachine-form-title {
        font-size: 24px;
    }

    .leadmachine-form-description {
        font-size: 14px;
    }

    .leadmachine-form-row-split {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Newsletter form: stack on mobile */
    .leadmachine-newsletter-container .leadmachine-form {
        grid-template-columns: 1fr;
    }

    .leadmachine-newsletter-container .leadmachine-form-row {
        margin-bottom: 15px;
    }

    .leadmachine-newsletter-container .leadmachine-submit-button {
        width: 100%;
    }
}
