/**
 * Frontend Styles
 * Path: assets/frontend-style.css
 */

.custom-form-wrapper {
    max-width: 600px;
    margin: 20px auto;
}

.custom-form-wrapper * {
    box-sizing: border-box;
}

.custom-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.custom-form .form-field {
    margin-bottom: 20px;
    display: block;
    clear: both;
}

.custom-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.custom-form .required {
    color: #d63638;
}

.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form input[type="number"],
.custom-form input[type="date"],
.custom-form input[type="time"],
.custom-form input[type="url"],
.custom-form input[type="password"],
.custom-form textarea,
.custom-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    display: block;
    background-color: #fff;
    color: #333;
    font-family: inherit;
    line-height: 1.5;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Select dropdown arrow */
.custom-form select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%207l5%205%205-5z%22%20fill%3D%22%23333%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

.custom-form input:focus,
.custom-form textarea:focus,
.custom-form select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.custom-form textarea {
    min-height: 120px;
    resize: vertical;
}

.custom-form input[type="radio"],
.custom-form input[type="checkbox"] {
    margin-right: 8px;
}

.custom-form input[type="radio"] + label,
.custom-form input[type="checkbox"] + label {
    display: inline;
    font-weight: normal;
    margin-left: 5px;
}

.custom-form button[type="submit"],
.custom-form .form-submit-btn {
    background: #2271b1;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.custom-form button[type="submit"]:hover,
.custom-form .form-submit-btn:hover {
    background: #135e96;
}

.custom-form button[type="submit"]:disabled,
.custom-form .form-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Messages */
.form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.form-messages.success {
    background: #d7f0db;
    color: #1e4620;
    border: 1px solid #00a32a;
}

.form-messages.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #d63638;
}

.form-messages:empty {
    display: none;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .custom-form-wrapper {
        max-width: 100%;
        margin: 10px;
    }
    
    .custom-form {
        padding: 20px;
    }
    
    .custom-form input[type="text"],
    .custom-form input[type="email"],
    .custom-form input[type="tel"],
    .custom-form input[type="number"],
    .custom-form input[type="date"],
    .custom-form textarea,
    .custom-form select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Theme Compatibility - AGGRESSIVE overrides to force display */
.custom-form input,
.custom-form select,
.custom-form textarea,
.custom-form-wrapper input,
.custom-form-wrapper select,
.custom-form-wrapper textarea {
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 45px !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    margin: 0 0 0 0 !important;
    text-indent: 0 !important;
}

/* Special handling for different input types */
.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form input[type="number"],
.custom-form input[type="date"],
.custom-form input[type="time"],
.custom-form input[type="url"],
.custom-form input[type="password"],
.custom-form-wrapper input[type="text"],
.custom-form-wrapper input[type="email"],
.custom-form-wrapper input[type="tel"],
.custom-form-wrapper input[type="number"],
.custom-form-wrapper input[type="date"],
.custom-form-wrapper input[type="time"],
.custom-form-wrapper input[type="url"],
.custom-form-wrapper input[type="password"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 45px !important;
    padding: 12px !important;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
    font-size: 14px !important;
}

.custom-form select,
.custom-form-wrapper select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 45px !important;
    padding: 12px !important;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
    font-size: 14px !important;
}

.custom-form textarea,
.custom-form-wrapper textarea {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 120px !important;
    padding: 12px !important;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
    font-size: 14px !important;
}

/* Radio and checkbox exceptions */
.custom-form input[type="radio"],
.custom-form input[type="checkbox"],
.custom-form-wrapper input[type="radio"],
.custom-form-wrapper input[type="checkbox"] {
    width: auto !important;
    min-height: auto !important;
    display: inline-block !important;
    margin-right: 8px !important;
}

/* Hidden inputs should stay hidden */
.custom-form input[type="hidden"],
.custom-form-wrapper input[type="hidden"] {
    display: none !important;
}

/* Ensure labels are visible */
.custom-form label,
.custom-form-wrapper label {
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    display: block !important;
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    width: auto !important;
}

/* Reset any theme-specific hiding */
.custom-form p,
.custom-form-wrapper p {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative !important;
    clip: auto !important;
    clip-path: none !important;
}

/* Override common theme patterns that hide inputs */
body .custom-form-wrapper .custom-form .form-field input[type="text"],
body .custom-form-wrapper .custom-form input[type="text"],
.custom-form-wrapper .form-field input[type="text"],
body.page .custom-form input[type="text"],
body.single .custom-form input[type="text"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: 45px !important;
    min-height: 45px !important;
    padding: 12px !important;
    background: #ffffff !important;
    border: 1px solid #ddd !important;
    position: static !important;
    clip: auto !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
}