/* 
OmniNotify Form Styles - v2
- Removed all `!important` tags to allow for easy theme overrides.
- Simplified selectors for better specificity control.
- Added a `.omninotify-form-unstyled` class to completely remove styling for advanced users.
*/

/* Default Form Container */
.omninotify-form {
    width: 100%;
    margin: 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    box-sizing: border-box;
    display: flex; /* Make it a flex container */
    flex-wrap: wrap; /* Allow items to wrap */
    align-items: stretch; /* Stretch items to fill height */
    gap: 12px; /* Gap between items */
}

/* Form Fields */
.omninotify-form .form-field {
    margin-bottom: 0; /* Remove bottom margin as flex gap handles spacing */
    flex: 1; /* Allow input field to grow */
}

.omninotify-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: inherit;
}

/* Input Fields */
.omninotify-form input[type="text"],
.omninotify-form input[type="email"],
.omninotify-form input[type="tel"],
.omninotify-form textarea {
    flex: 1; /* Allow input field to grow */
    padding: 15px 20px; /* Match CF7 padding */
    border: 2px solid #e1e5e9; /* Match CF7 border */
    border-radius: 8px; /* Match CF7 border-radius */
    font-size: 16px; /* Match CF7 font-size */
    color: #333; /* Match CF7 color */
    background-color: white; /* White background */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    width: auto; /* Let flexbox handle width */
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4; /* Match CF7 line-height */
}

.omninotify-form input[type="text"]:focus,
.omninotify-form input[type="email"]:focus,
.omninotify-form input[type="tel"]:focus,
.omninotify-form textarea:focus {
    border-color: #154284; /* Match CF7 focus border */
    box-shadow: 0 0 0 3px rgba(21, 66, 132, 0.1); /* Match CF7 focus shadow */
}

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

/* Checkbox Styling */
.omninotify-form .form-field-checkbox {
    display: flex;
    align-items: center;
}

.omninotify-form input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.omninotify-form .checkbox-label {
    display: inline;
    font-weight: normal;
}

/* Submit Button */
.omninotify-form input[type="submit"] {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: inherit;
    font-weight: bold;
    font-family: inherit;
    transition: background-color 0.3s ease;
    width: auto;
    display: inline-block;
}

.omninotify-form input[type="submit"]:hover {
    background: #005a87;
}

/* --- Utility Classes --- */

/* For completely unstyled forms that inherit everything */
.omninotify-form-unstyled {
    margin: unset;
    padding: unset;
    border: unset;
    background: unset;
    font-family: unset;
    font-size: unset;
    line-height: unset;
    color: unset;
}

.omninotify-form-unstyled .form-field {
    margin-bottom: unset;
}

.omninotify-form-unstyled label {
    display: unset;
    margin-bottom: unset;
    font-weight: unset;
    color: unset;
}

.omninotify-form-unstyled input[type="text"],
.omninotify-form-unstyled input[type="email"],
.omninotify-form-unstyled input[type="tel"],
.omninotify-form-unstyled textarea {
    width: unset;
    padding: unset;
    border: unset;
    border-radius: unset;
    font-size: unset;
    box-sizing: unset;
    font-family: unset;
    background: unset;
    color: unset;
    transition: unset;
}

.omninotify-form-unstyled input[type="text"]:focus,
.omninotify-form-unstyled input[type="email"]:focus,
.omninotify-form-unstyled input[type="tel"]:focus,
.omninotify-form-unstyled textarea:focus {
    outline: unset;
    border-color: unset;
    box-shadow: unset;
}

.omninotify-form-unstyled textarea {
    min-height: unset;
    resize: unset;
}

.omninotify-form-unstyled .form-field-checkbox {
    display: unset;
    align-items: unset;
}

.omninotify-form-unstyled input[type="checkbox"] {
    margin-right: unset;
    width: unset;
}

.omninotify-form-unstyled .checkbox-label {
    display: unset;
    font-weight: unset;
}

.omninotify-form-unstyled input[type="submit"] {
    background: unset;
    color: unset;
    padding: unset;
    border: unset;
    border-radius: unset;
    cursor: unset;
    font-size: unset;
    font-weight: unset;
    font-family: unset;
    transition: unset;
    width: unset;
    display: unset;
}

.omninotify-form-unstyled input[type="submit"]:hover {
    background: unset;
}

/* No Labels - relies on placeholders */
.omninotify-form.no-labels label {
    display: none;
}

/* Horizontal Layout */
.omninotify-form.horizontal-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    border: none;
    background: transparent;
    padding: 0;
}

.omninotify-form.horizontal-layout .form-field {
    flex: 1 1 auto;
    margin-bottom: 0;
}

.omninotify-form.horizontal-layout .form-field-submit {
    flex: 0 1 auto;
}

/* --- Messages --- */
.onf-success,
.onf-error,
.onf-info {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: inherit;
}

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

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

.onf-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}