/**
 * CMS Forms - Styling
 * Professional and responsive form styling
 */

.cms-form-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 0;
}

.cms-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-title {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.form-description {
    margin-bottom: 25px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.form-row {
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Width classes for field layout */
.form-width-full {
    width: 100%;
    display: block;
}

.form-width-half {
    width: 48%;
    display: inline-block;
    vertical-align: top;
    margin-right: 2%;
}

.form-width-third {
    width: 31.33%;
    display: inline-block;
    vertical-align: top;
    margin-right: 2%;
}

.form-width-quarter {
    width: 23%;
    display: inline-block;
    vertical-align: top;
    margin-right: 2%;
}

/* Remove right margin from last inline field in a row */
.form-width-half:last-of-type,
.form-width-third:last-of-type,
.form-width-quarter:last-of-type {
    margin-right: 0;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control:hover {
    border-color: #aaa;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Radio and Checkbox styling */
.form-radio,
.form-checkbox {
    display: block;
    margin-bottom: 10px;
    padding-left: 5px;
    font-weight: normal;
    cursor: pointer;
    user-select: none;
}

.form-radio input[type="radio"],
.form-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Select dropdown */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

/* File input */
input[type="file"].form-control {
    padding: 8px 15px;
    cursor: pointer;
}

/* Submit button */
.form-submit-btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background-color: #3498db;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-submit-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.form-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-submit-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Messages */
.form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

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

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

.form-message p {
    margin: 0 0 10px 0;
}

.form-message p:last-child {
    margin-bottom: 0;
}

.form-message ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.form-message li {
    margin-bottom: 5px;
}

.form-loading {
    margin-top: 15px;
    padding: 12px 20px;
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

/* Hint text */
.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* Honeypot field - completely hidden */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Responsive */
@media (max-width: 768px) {
    .cms-form-container {
        margin: 20px auto;
    }

    .cms-form {
        padding: 20px;
    }

    .form-title {
        font-size: 20px;
    }

    .form-submit-btn {
        width: 100%;
        padding: 14px;
    }

    /* Stack fields on mobile */
    .form-width-half,
    .form-width-third,
    .form-width-quarter {
        width: 100% !important;
        display: block !important;
        margin-right: 0 !important;
    }
}

/* Validation states */
.form-control:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

.form-control:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

/* Focus states for accessibility */
.form-control:focus,
.form-submit-btn:focus,
.form-radio input:focus,
.form-checkbox input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}
