/* Frontend main form styles for FormNest */

.formnest-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.formnest-form-title h3 {
    margin-bottom: 10px;
    color: #333;
}

.formnest-form-description p {
    margin-bottom: 20px;
    color: #666;
}

/* Table form styling */
.formnest-form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.formnest-form-row {
    border-bottom: 1px solid #eee;
}

.formnest-form-label {
    width: 30%;
    padding: 15px 10px 15px 0;
    text-align: left;
    vertical-align: middle;
    font-weight: bold;
    color: #333;
}

.formnest-form-field {
    width: 70%;
    padding: 15px 0;
    vertical-align: middle;
}

.formnest-required {
    color: #e74c3c;
    font-size: 0.9em;
    margin-left: 5px;
}

.formnest-input,
.formnest-textarea,
.formnest-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.formnest-input:focus,
.formnest-textarea:focus,
.formnest-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.formnest-field-error {
    margin-top: 5px;
    color: #e74c3c;
    font-size: 12px;
}

/* Submit area */
.form_submit_btn_area {
    text-align: center;
    margin-top: 20px;
}

.formnest-submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease-in-out;
    position: relative;
    min-width: 140px;
}

.formnest-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.formnest-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.formnest-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Messages */
.formnest-messages {
    margin-bottom: 20px;
}

.formnest-success-message,
.formnest-error-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.formnest-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.formnest-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Success modal styles */
.formnest-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.formnest-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.formnest-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.formnest-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.formnest-modal-header h4 {
    margin: 0;
    color: #333;
}

.formnest-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.formnest-modal-body {
    padding: 20px;
}

.formnest-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.formnest-modal-ok {
    background-color: #0073aa;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.formnest-modal-ok:hover {
    background-color: #005a87;
}

/* Honeypot field (hidden) */
.formnest-honey-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .formnest-form-table {
        display: block;
    }

    .formnest-form-row {
        display: block;
        margin-bottom: 15px;
        border-bottom: none;
        border: 1px solid #eee;
        padding: 15px;
        border-radius: 4px;
    }

    .formnest-form-label {
        display: block;
        width: 100%;
        padding: 0 0 10px 0;
        margin-bottom: 10px;
    }

    .formnest-form-field {
        display: block;
        width: 100%;
        padding: 0;
    }
}

/* reCAPTCHA center alignment */
.formnest-field--recaptcha {
    text-align: center;
    margin: 20px 0;
}

.formnest-field--recaptcha .formnest-field__input {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.formnest-field--recaptcha .formnest-field__input > div:first-child {
    margin: 0 auto;
}

/* reCAPTCHA error message - display below widget */
.formnest-field--recaptcha .formnest-field__error {
    margin-top: 10px;
    margin-bottom: 0;
    width: 100%;
    text-align: center;
}