/* Form Container Base */
.araill-form-container {
    background: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: #333333;
    border: 1px solid rgba(0, 0, 0, 0.08); /* Subtle border for crispness */
}

/* For Dark Mode Elementor Theme compatibility (can be overridden by parent if strictly dark mode) */
@media (prefers-color-scheme: dark) {
    .araill-form-container {
        background: #1e1e24; /* Deep premium dark */
        color: #ffffff;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.araill-form-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #5a3ceb; /* Premium Purple accent */
    padding-bottom: 1rem;
}

.araill-form-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: inherit;
}

.araill-zh {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Form Groups */
.araill-form-group {
    margin-bottom: 1.8rem;
}

.araill-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
}

.araill-required {
    color: #e53935;
    margin-left: 4px;
}

/* Inputs */
.araill-form-group input[type="text"],
.araill-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #c2c2c2;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: transparent;
    color: inherit;
    box-sizing: border-box;
}

.araill-form-group input[type="text"]:focus,
.araill-form-group input[type="email"]:focus {
    border-color: #5a3ceb;
    box-shadow: 0 0 0 4px rgba(90, 60, 235, 0.15);
    outline: none;
}

/* Checkbox Buttons Styling */
.araill-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.araill-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400 !important;
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.araill-checkbox-label:hover {
    background: rgba(90, 60, 235, 0.05);
}

.araill-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #a0a0a0;
    border-radius: 4px; /* Square with slightly rounded corners */
    margin-right: 12px;
    position: relative;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.araill-checkbox-label input[type="checkbox"]:checked {
    border-color: #5a3ceb;
    background-color: #5a3ceb;
}

.araill-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 2px;
    left: 6px;
}

/* Other Custom Input Styling */
.araill-other-label {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 4px 6px 4px 12px;
    margin-bottom: 0;
    width: 100%;
}
.araill-other-label:hover {
    background: transparent;
}

.araill-other-input {
    flex: 1 1 auto !important;
    width: auto !important;
    display: block !important;
    min-width: 0;
    margin-top: 0 !important;
    margin-left: 8px;
    padding: 10px 14px;
    border: 1px solid #c2c2c2;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    color: inherit;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.araill-other-input:disabled {
    opacity: 0.6;
    background: transparent;
    border-color: transparent;
    cursor: not-allowed;
    pointer-events: none;
}

.araill-other-input:not(:disabled):focus {
    border-color: #5a3ceb;
    box-shadow: 0 0 0 3px rgba(90, 60, 235, 0.1);
}

@media (prefers-color-scheme: dark) {
    .araill-other-input { background: #2c2c35; border-color: #444; }
    .araill-other-input:not(:disabled):focus { border-color: #8c73ff; }
}

/* Submit Button */
.araill-form-submit {
    margin-top: 2.5rem;
}

.araill-form-submit button {
    width: 100%;
    background: linear-gradient(135deg, #6c5ce7 0%, #5a3ceb 100%);
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.araill-form-submit button:hover {
    box-shadow: 0 8px 20px rgba(90, 60, 235, 0.4);
    transform: translateY(-2px);
}

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

.araill-form-submit button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: translateY(0);
}

/* Spinner (Hidden by default) */
.araill-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Message Box */
.araill-form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    display: none;
}

.araill-form-message.success {
    display: block;
    background: rgba(46, 213, 115, 0.1);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.araill-form-message.error {
    display: block;
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

/* Dark mode tweaks for message box */
@media (prefers-color-scheme: dark) {
    .araill-form-message.success { color: #55ff99; }
    .araill-form-message.error { color: #ff7f8a; }
}
