/* ========================================
   REGISTRATION TEMPLATE BASE STYLES
   Shared styles across all registration templates
   ======================================== */

/* ========================================
   BASE FORM STRUCTURE & SPACING
   ======================================== */

form[class*="wpuf-form-layout"] ul.wpuf-form li {
    margin: 0 !important;
    padding: 0 !important;
}

form[class*="wpuf-form-layout"] ul.wpuf-form li.wpuf-el:not(:first-child) {
    margin-top: 40px !important;
}

/* ========================================
   BASE INPUT STYLES (Structure Only)
   ======================================== */

form[class*="wpuf-form-layout"] .wpuf-fields input,
form[class*="wpuf-form-layout"] .wpuf-fields textarea,
form[class*="wpuf-form-layout"] .wpuf-fields select {
    box-sizing: border-box;
    width: 100% !important;
    height: auto !important;
    font-size: 1rem !important;
    box-shadow: none !important;
}

/* Telephone Input - International Tel Input Library Default */
form[class*="wpuf-form-layout"] .wpuf-fields input.wpuf_telephone {
    padding-right: 6px !important;
    padding-left: 52px !important;
}

/* Select Dropdown - Remove Default Appearance */
form[class*="wpuf-form-layout"] .wpuf-fields select {
    -webkit-appearance: none;
    appearance: none;
}

form[class*="wpuf-form-layout"] .wpuf-fields:has(select) {
    position: relative;
}

/* Input Focus State - Remove Default */
form[class*="wpuf-form-layout"] .wpuf-fields input:focus {
    border: none !important;
}

/* Custom multi-select dropdown styles moved to custom-multiselect.css so they
   also load on post forms — the widget script runs on every frontend
   multiselect, not just registration forms. */
/* ========================================
   PASSWORD STRENGTH INDICATOR
   ======================================== */

form[class*="wpuf-form-layout"] ul.wpuf-form li .pass-strength-result {
    border: none !important;
    padding: 10px 32px !important;
    border-radius: 6px !important;
}

/* ========================================
   RADIO BUTTON BASE STRUCTURE
   ======================================== */

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-radio-block {
    display: flex !important;
    align-items: center;
}

form[class*="wpuf-form-layout"] .wpuf-fields input[type="radio"] {
    margin: 0 12px 0 0 !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    position: relative !important;
    padding: 0 !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields input[type="radio"]:focus {
    outline: none !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50% !important;
}

/* Radio field container styling */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-radio-field {
    display: flex !important;
    align-items: center;
    margin-bottom: 8px !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-radio-field input {
    margin-right: 12px !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-radio-field:last-child {
    margin-bottom: 0 !important;
}

/* Radio field label styling */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-radio-field label {
    margin-left: 8px !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.5;
}

/* ========================================
   CHECKBOX BASE STRUCTURE
   ======================================== */

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 12px !important;
    cursor: pointer !important;
    position: relative !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block:last-child {
    margin-bottom: 0 !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    cursor: pointer !important;
    z-index: 1 !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50% !important;
    margin-right: 12px !important;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block input[type="checkbox"]:checked + label::after,
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block:has(input[type="checkbox"]:checked)::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.5 1L3 5.5L0.5 3' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block label {
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.5;
    margin: 0 !important;
    flex: 1;
}

/* Ensure checkbox is accessible for form validation */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block input[type="checkbox"]:focus {
    outline: none !important;
}

/* Terms and Conditions specific styling */
form[class*="wpuf-form-layout"] .wpuf-fields input[name="terms_and_conditions"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    cursor: pointer !important;
    z-index: 1 !important;
}

/* Ensure terms checkbox is properly positioned */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-checkbox-block:has(input[name="terms_and_conditions"]) {
    position: relative !important;
}

/* ========================================
   FILE UPLOAD - IMAGE SELECTOR
   ======================================== */

form[class*="wpuf-form-layout"] .wpuf-fields .file-selector {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    gap: 8px !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .file-selector:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .file-selector:active {
    transform: translateY(1px) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1) !important;
}

/* Upload icon styling */
form[class*="wpuf-form-layout"] .wpuf-fields .file-selector::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

/* Uploaded files container */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-attachment-list {
    margin-top: 12px !important;
    padding: 0 !important;
    list-style: none;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-attachment-list li {
    display: flex;
    align-items: center;
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    gap: 8px;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-attachment-list li:last-child {
    margin-bottom: 0 !important;
}

/* Upload progress styling */
form[class*="wpuf-form-layout"] .wpuf-fields .upload-item {
    margin-top: 12px !important;
    padding: 12px !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .progress {
    height: 4px;
    border-radius: 2px !important;
    overflow: hidden;
}

form[class*="wpuf-form-layout"] .wpuf-fields .progress .bar {
    height: 100%;
    border-radius: 2px !important;
    transition: width 0.3s ease;
}

/* ========================================
   FILE UPLOAD ZONE (Drag & Drop)
   ======================================== */

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-content {
    text-align: center;
    padding: 20px !important;
    max-width: 75%;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-icon svg {
    width: 48px;
    height: 48px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone:hover .wpuf-upload-icon svg {
    opacity: 0.8;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-title {
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    margin-top: 20px !important;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-instructions {
    font-weight: 400;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

/* Hidden trigger that preserves all functionality */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-trigger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    text-decoration: none;
    background: transparent;
    border: none !important;
    cursor: pointer;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-trigger:hover {
    cursor: pointer;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-trigger:focus {
    outline: none !important;
}

/* ========================================
   SUBMIT BUTTON BASE
   ======================================== */

form[class*="wpuf-form-layout"] li.wpuf-submit {
    text-align: center;
}

form[class*="wpuf-form-layout"] li.wpuf-submit input.wpuf-submit-button:hover {
    cursor: pointer;
}


/* ========================================
   FORM CARD WRAPPER
   Default card around the registration form (was an inline style in
   Profile_Form.php). Dark templates draw their own card on the form
   element and suppress this wrapper via their modifier class.
   ======================================== */
.wpuf-reg-form-card {
    /* Figma: registration forms sit flat on the page — no card border on any
       template (node 2766:67478). Wrapper kept only as a styling hook. */
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* Figma typography — Inter (falls back to system sans when not loaded). */
form[class*="wpuf-form-layout"],
form[class*="wpuf-form-layout"] input,
form[class*="wpuf-form-layout"] textarea,
form[class*="wpuf-form-layout"] select,
form[class*="wpuf-form-layout"] button {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Theme reset (Use Theme CSS = off): neutralize theme bleed so the
   template design owns the form. Only neutral props are forced — the
   template's own colors/borders/spacing rules stay in charge. ---- */
form[class*="wpuf-form-layout"] ul.wpuf-form {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
form[class*="wpuf-form-layout"] ul.wpuf-form li {
    list-style: none !important;
    background-image: none !important;
}
form[class*="wpuf-form-layout"] ul.wpuf-form li::before,
form[class*="wpuf-form-layout"] ul.wpuf-form li::marker {
    content: none !important;
}
form[class*="wpuf-form-layout"] .wpuf-fields input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="file"]),
form[class*="wpuf-form-layout"] .wpuf-fields textarea {
    max-width: 100% !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    box-sizing: border-box !important;
}
form[class*="wpuf-form-layout"] .wpuf-label,
form[class*="wpuf-form-layout"] .wpuf-label label {
    letter-spacing: normal !important;
    text-transform: none !important;
    text-shadow: none !important;
}
form[class*="wpuf-form-layout"] li.wpuf-submit input[type="submit"] {
    background-image: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    width: auto !important;
    border-style: solid !important;
    transition: background-color 0.2s ease;
}
