/* Form Container */
.am-form {
    margin: 0 auto !important;
    padding: 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    color: #333 !important;
}

/* Form Rows */
.am-row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-bottom: 20px !important;
    align-items: flex-start !important;
}

/* Element Titles (Labels) */
.am-element-title {
    flex: 0 0 100% !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.am-element-title label {
    display: block !important;
    margin-bottom: 4px !important;
}

/* Required Field Indicator */
.required {
    color: #dd4814 !important;
}

/* Form Elements */
.am-element {
    flex: 0 0 100% !important;
    position: relative !important; /* Establish positioning context */
    z-index: auto !important; /* Reset stacking context */
}

/* Input Fields */
input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100% !important;
    padding: 12px !important;
    margin-bottom: 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
    transition: border-color 0.3s ease !important;
}

/* Dropdown fields */
select {
    height: auto !important; /* Allow natural height */
    min-height: 46px !important; /* Match input field height */
    padding: 10px !important; /* Slightly reduce padding */
    line-height: 1.4 !important; /* Better text spacing */
    overflow-y: visible !important; /* Ensure options aren't clipped */
}

/* Dropdown options styling */
select option {
    padding: 8px 12px !important; /* Comfortable option spacing */
    line-height: 1.5 !important; /* Better vertical spacing */
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: #dd4814 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(221, 72, 20, 0.2) !important;
}

/* Radio Button Options */
.am-element label.radio,
.am-element label[for^="product-"] {
    display: block !important;
    padding: 12px !important;
    margin-bottom: 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.am-element label.radio:hover,
.am-element label[for^="product-"]:hover {
    border-color: #dd4814 !important;
    background-color: #f9f9f9 !important;
}

.am-element label.radio input[type="radio"],
.am-element label[for^="product-"] input[type="radio"] {
    margin-right: 10px !important;
}

/* Product Option Styling */
.am-product-title {
    font-weight: 600 !important;
    display: block !important;
    margin-bottom: 4px !important;
}

.am-product-terms {
    color: #dd4814 !important;
    font-weight: 500 !important;
    display: block !important;
    margin-bottom: 4px !important;
}

.am-product-desc {
    color: #666 !important;
    font-size: 0.9em !important;
    display: block !important;
}

/* Payment System Options */
.am-paysystem-title {
    font-weight: 600 !important;
}

.am-paysystem-desc {
    color: #666 !important;
    font-size: 0.9em !important;
    margin-left: 5px !important;
}

/* Grouped Inputs (Name, State) */
.am-element.group {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.am-element.group input {
    flex: 1 1 calc(50% - 5px) !important;
    min-width: 120px !important;
}

/* Fieldset Styling */
fieldset {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
}

fieldset legend {
    padding: 0 10px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

/* Comments/Help Text */
.comment {
    color: #666 !important;
    font-size: 0.85em !important;
    margin-top: 4px !important;
    line-height: 1.4 !important;
}

/* Submit Button */
.am-cta-signup {
    background-color: #dd4814 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: background-color 0.3s ease !important;
}

.am-cta-signup:hover {
    background-color: #c23e11 !important;
}

/* Responsive Adjustments */
@media (min-width: 600px) {
    .am-row {
        flex-wrap: nowrap !important;
    }
    
    .am-element-title {
        flex: 0 0 200px !important;
        padding-right: 20px !important;
        text-align: right !important;
    }
    
    .am-element {
        flex: 1 !important;
    }
    
    .am-cta-signup {
        width: auto !important;
        min-width: 150px !important;
    }
}

/* Mobile-specific dropdown styling */
@media (max-width: 599px) {
    select {
        font-size: 16px !important; /* Prevent iOS zooming */
    }
}

/* Error States (for validation) */
.error {
    border-color: #d9534f !important;
}

.error-message {
    color: #d9534f !important;
    font-size: 0.85em !important;
    margin-top: 5px !important;
}