/**
 * Registration Form Styles for NAFCO Gems
 */

/* Form Container Fixes */
#jeweler-registration {
    overflow: visible !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 15px;
    padding-right: 15px;
}

#content {
    overflow: visible !important;
}

.col-lg-4 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Prevent jQuery UI slider handles from appearing on registration form */
#jeweler-registration .ui-slider-handle,
#content .ui-slider-handle,
.reg ~ .ui-slider-handle,
select.ui-slider-handle,
#state .ui-slider-handle,
#ship_state .ui-slider-handle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide any rogue slider elements */
#jeweler-registration .ui-slider,
#content .ui-slider,
select.ui-slider,
.ui-slider-horizontal {
    display: none !important;
    visibility: hidden !important;
}

/* Remove any ::before or ::after pseudo-elements that might be the blue dot */
#state::before,
#state::after,
#ship_state::before,
#ship_state::after,
select.reg::before,
select.reg::after {
    display: none !important;
    content: none !important;
}

/* Ensure no slider styles apply to select elements */
select#state,
select#ship_state {
    cursor: default !important;
}

select#state *,
select#ship_state * {
    cursor: default !important;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    margin-bottom: 8px;
    clear: both;
    width: 100%;
    max-width: 330px;
}

.strength-bar {
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
    width: 100%;
}

.strength-bar-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
    background-color: #d32f2f;
}

.strength-label {
    font-size: 12px;
    color: #666;
}

.strength-text {
    font-weight: 600;
}

/* Field Validation States */
input.reg.error,
select.reg.error,
textarea.reg.error {
    border: 2px solid #d32f2f !important;
    background-color: #ffe6e6 !important;
    color: #333 !important; /* Keep text visible */
}

/* Error state placeholder - keep visible */
input.reg.error::placeholder,
textarea.reg.error::placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

/* Don't apply error styling on focus */
input.reg.error:focus,
select.reg.error:focus,
textarea.reg.error:focus {
    border-color: #1565c0 !important;
    background-color: white !important;
}

.reg.valid {
    border: 2px solid #388e3c !important;
}

.error-message {
    display: block;
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Required Field Indicator */
.required,
.colorRed {
    color: #d32f2f;
    font-weight: bold;
}

/* Form Sections */
.colorBlue {
    color: #1565c0;
}

.fs14 {
    font-size: 14px;
}

.bold {
    font-weight: 600;
}

.pt10 {
    padding-top: 10px;
}

/* Input Improvements */
input.reg,
select.reg,
textarea.reg {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 5px;
    margin-left: 0 !important; /* Prevent negative margins */
    margin-right: 0 !important;
    position: static !important; /* Prevent any position issues */
    background-color: white !important;
    color: #333 !important;
    box-sizing: border-box !important; /* Include padding in width */
    left: auto !important; /* Reset any left positioning */
    right: auto !important; /* Reset any right positioning */
}

/* Placeholder styling */
input.reg::placeholder,
textarea.reg::placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

input.reg::-webkit-input-placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

input.reg::-moz-placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

input.reg:-ms-input-placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

/* Override for inline inputs (like MI) */
input.reg[style*="width: 100px"],
input.reg[id="mi"] {
    display: inline-block;
    width: 100px !important;
}

.reg:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.reg:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Button Styles */
#submit-registration {
    background: #000;
    color: #fff;
    padding: 12px 32px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#submit-registration:hover {
    background: #333;
    transform: translateY(-1px);
}

#submit-registration:active {
    transform: translateY(0);
}

#submit-registration:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#generate-password {
    background: #1565c0;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#generate-password:hover {
    background: #0d47a1;
}

/* Password Toggle */
.showPass,
.hidePass {
    display: inline-block;
    margin-left: 8px;
    color: #1565c0;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    user-select: none;
}

.showPass:hover,
.hidePass:hover {
    color: #0d47a1;
}

/* Generated Password Display */
#generated-password {
    font-size: 14px;
    margin-left: 8px;
}

#generated-password strong {
    color: #388e3c;
    font-family: 'Courier New', monospace;
    background: #e8f5e9;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Validation Errors Summary */
.validation-errors {
    background: #ffebee;
    border: 2px solid #d32f2f;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
}

.validation-errors h3 {
    color: #d32f2f;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
}

.validation-errors li {
    margin-bottom: 6px;
    color: #666;
}

/* Registration Success */
.registration-success {
    text-align: center;
    padding: 40px 20px;
}

.registration-success h2 {
    color: #388e3c;
    margin-bottom: 16px;
}

.registration-success p {
    color: #666;
    font-size: 14px;
}

/* Conditional Fields Animation */
#ship_address,
#JBT,
#noJBT {
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Radio Button Groups - Consistent Styling */
input[type="radio"] {
    /* Reset default styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Custom styling */
    width: 18px;
    height: 18px;
    min-width: 18px; /* Prevent shrinking */
    min-height: 18px;
    border: 2px solid #666;
    border-radius: 50%;
    margin-right: 6px;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    cursor: pointer;
    display: inline-block !important; /* Keep inline with text */
    vertical-align: middle;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Don't shrink in flex containers */
    position: relative !important; /* Need this for ::before positioning */
    float: none !important; /* Prevent floating */
}

input[type="radio"]:hover {
    border-color: #1565c0;
}

input[type="radio"]:checked {
    border-color: #1565c0;
    background-color: #fff;
}

input[type="radio"]:checked::before {
    content: '';
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #1565c0;
    pointer-events: none; /* Don't interfere with clicks */
}

input[type="radio"]:focus {
    outline: 2px solid #1565c0;
    outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .col-lg-4 {
        padding: 0 15px;
        margin-bottom: 30px;
    }

    .reg {
        width: 100% !important;
    }

    .w330,
    .w150,
    .w130 {
        width: 100% !important;
    }

    #submit-registration {
        width: 100%;
    }
}

/* Accessibility Improvements */
.reg:focus-visible {
    outline: 2px solid #1565c0;
    outline-offset: 2px;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #1565c0;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Info Text */
.fs12 {
    font-size: 12px;
}

.color4 {
    color: #666;
}

/* Section Spacing */
.mt5 {
    margin-top: 5px;
}

.mt15 {
    margin-top: 15px;
}

.mt30 {
    margin-top: 30px;
}

.mb30 {
    margin-bottom: 30px;
}

/* Text Alignment */
.tAlignLeft {
    text-align: left;
}

.tAlignRight {
    text-align: right;
}

/* Clearfix */
.clear {
    clear: both;
}

.fLeft {
    float: left;
    width: 100%;
}
