/**
 * Custom Form Styles for Dedicate a Donation page
 * Matches the styling from expressions.bible/en/dedicate-donation
 */

/* RSForm container */
.rsform {
    max-width: 100%;
}

/* Form labels */
.rsform .formLabel,
.rsform label {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

/* Required field asterisk */
.formRequired {
    color: #d9534f;
    margin-left: 3px;
}

/* Text inputs and textareas */
.rsform input[type="text"],
.rsform input[type="email"],
.rsform input[type="number"],
.rsform textarea,
input.rsform-input-box,
textarea.rsform-text-box {
    width: 100% !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: rgba(78,83,107,.04) !important;
    background-clip: padding-box !important;
    border: 1px solid #a4a4a4 !important;
    border-radius: 4px !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
}

/* Focus state for inputs */
.rsform input[type="text"]:focus,
.rsform input[type="email"]:focus,
.rsform input[type="number"]:focus,
.rsform textarea:focus,
input.rsform-input-box:focus,
textarea.rsform-text-box:focus {
    color: #495057 !important;
    background-color: #fff !important;
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Textareas */
.rsform textarea {
    min-height: 80px;
    resize: vertical;
}

/* Select dropdowns */
.rsform select,
select.rsform-select-box {
    width: 100% !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: rgba(78,83,107,.04) !important;
    background-clip: padding-box !important;
    border: 1px solid #a4a4a4 !important;
    border-radius: 4px !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 8px 10px !important;
    padding-right: 35px !important;
    height: 50px !important;
    font-family: inherit !important;
}

/* Focus state for select */
.rsform select:focus,
select.rsform-select-box:focus {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Custom Radio buttons */
.rsform input[type="radio"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 1px solid #a4a4a4 !important;
    border-radius: 50% !important;
    background-color: #fff !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
    position: relative !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

.rsform input[type="radio"]:hover {
    border-color: #666 !important;
}

.rsform input[type="radio"]:checked {
    border-color: #4e536b !important;
    background-color: #fff !important;
}

.rsform input[type="radio"]:checked::before {
    content: '' !important;
    display: block !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background-color: #4e536b !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.rsform .formRadioTable label,
.rsform .formRadioTable .formBody {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 20px !important;
    margin-bottom: 12px !important;
    cursor: pointer !important;
    font-weight: normal !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
}

.rsform .formRadioTable label:hover {
    color: #333 !important;
}

/* Checkboxes */
.rsform input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* Form control containers */
.rsform .formBody {
    margin-bottom: 20px;
}

.rsform .formControls {
    margin-bottom: 25px;
}

/* Error messages */
.rsform .formError,
.rsform .formValidation {
    color: #d9534f;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Success messages */
.rsform .formSuccess {
    color: #28a745;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Help text */
.rsform .formDescription {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

/* Submit button */
.rsform button[type="submit"],
.rsform input[type="submit"],
.rsform .rsform-submit-button {
    display: inline-block;
    font-weight: 500;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: #007bff;
    border: 1px solid #007bff;
    padding: 12px 30px;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.rsform button[type="submit"]:hover,
.rsform input[type="submit"]:hover,
.rsform .rsform-submit-button:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.rsform button[type="submit"]:focus,
.rsform input[type="submit"]:focus,
.rsform .rsform-submit-button:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Disabled state */
.rsform input:disabled,
.rsform select:disabled,
.rsform textarea:disabled {
    background-color: #e9ecef;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Placeholder text */
.rsform input::placeholder,
.rsform textarea::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Form sections/fieldsets */
.rsform fieldset {
    border: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.rsform legend {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rsform input[type="text"],
    .rsform input[type="email"],
    .rsform input[type="number"],
    .rsform textarea,
    .rsform select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .rsform button[type="submit"],
    .rsform input[type="submit"] {
        width: 100%;
    }
}

/* Card selection radio buttons styling */
.rsform .formRadioTable.rsform-card-selection label {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    padding: 12px 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    background-color: #fff !important;
}

.rsform .formRadioTable.rsform-card-selection label:hover {
    border-color: #a4a4a4 !important;
    background-color: rgba(78,83,107,.02) !important;
}

.rsform .formRadioTable.rsform-card-selection input[type="radio"]:checked + label,
.rsform .formRadioTable.rsform-card-selection label:has(input[type="radio"]:checked) {
    border-color: #4e536b !important;
    background-color: rgba(78,83,107,.04) !important;
}

/* Character counter for textareas */
.rsform .rsform-counter {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    text-align: right;
}

/* Form validation styling */
.rsform input.rsform-error,
.rsform select.rsform-error,
.rsform textarea.rsform-error {
    border-color: #d9534f;
}

.rsform input.rsform-error:focus,
.rsform select.rsform-error:focus,
.rsform textarea.rsform-error:focus {
    border-color: #d9534f;
    box-shadow: 0 0 0 0.2rem rgba(217, 83, 79, 0.25);
}

/* Loading state for submit button */
.rsform button[type="submit"].loading,
.rsform input[type="submit"].loading {
    opacity: 0.7;
    cursor: wait;
}

.rsform-block.rsform-block-select-a-card-memory {
    display: block !important;
}

.hikashop_product_characteristics_table select, .hikashop_product_options_table select {
    padding: 4px 2px !important;
}
