/**
 * NS Profile Builder - Expert Registration Form Styles
 * Redesigned to match live website design
 * Version: 1.1.5 - High specificity to override theme styles
 */

/* ==========================================================================
   CSS Variables - Color System
   ========================================================================== */

:root {
    --ns-primary-blue: #2196f3;
    --ns-success-green: #4caf50;
    --ns-danger-red: #f44336;
    --ns-bg-light: #f5f5f5;
    --ns-section-bg: #ffffff;
    --ns-section-header-bg: #ebebeb;
    --ns-input-border: #dddddd;
    --ns-text-primary: #333333;
    --ns-text-secondary: #666666;
    --ns-text-light: #999999;
    --ns-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --ns-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Registration Wrapper - High Specificity
   ========================================================================== */

.ns-register-wrapper.ns-register-wrapper {
    max-width: 600px !important;
    margin: 0 auto !important;
    background: var(--ns-bg-light) !important;
    padding: 20px !important;
}

.ns-expert-register-wrapper.ns-expert-register-wrapper {
    max-width: 1000px !important;
    margin: 0 auto !important;
    background: var(--ns-bg-light) !important;
    padding: 20px !important;
}

.ns-register-form.ns-register-form,
.ns-expert-register-form.ns-expert-register-form {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Sections - High Specificity
   ========================================================================== */

.ns-expert-register-wrapper .ns-expert-section {
    background: var(--ns-section-bg) !important;
    border-radius: 10px !important;
    padding: 30px !important;
    margin-bottom: 20px !important;
    box-shadow: var(--ns-shadow-sm) !important;
    border: none !important;
}

.ns-expert-register-wrapper .ns-expert-section:last-of-type {
    margin-bottom: 30px !important;
}

/* Section Titles - High Specificity */
.ns-expert-register-wrapper .ns-section-title {
    background: var(--ns-section-header-bg) !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    margin: -30px -30px 20px -30px !important;
    font-weight: 700 !important;
    color: var(--ns-text-primary) !important;
    text-align: right !important;
    border: none !important;
}

/* ==========================================================================
   Profile Picture Upload Section
   ========================================================================== */

.ns-expert-register-wrapper .ns-profile-picture-section {
    margin-bottom: 25px !important;
    padding: 25px !important;
    background: #fafafa !important;
    border: 2px dashed var(--ns-input-border) !important;
    border-radius: 10px !important;
    text-align: center !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.ns-expert-register-wrapper .ns-avatar-preview {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    border: 3px solid var(--ns-input-border) !important;
    background: #ffffff !important;
}

.ns-expert-register-wrapper .ns-avatar-preview__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-btn {
    display: inline-block !important;
    padding: 10px 24px !important;
    background: var(--ns-success-green) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    font-weight: 600 !important;
    border: none !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-btn:hover {
    background: #45a049 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3) !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-input {
    display: none !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-status {
    min-height: 20px !important;
    font-weight: 500 !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-status.success {
    color: var(--ns-success-green) !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-status.error {
    color: var(--ns-danger-red) !important;
}

.ns-expert-register-wrapper .ns-avatar-upload-status.loading {
    color: var(--ns-primary-blue) !important;
}

/* ==========================================================================
   Form Fields - High Specificity
   ========================================================================== */

.ns-expert-register-wrapper .ns-form-field {
    margin-bottom: 0 !important;
}

.ns-expert-register-wrapper .ns-form-field label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: var(--ns-text-primary) !important;
    text-align: right !important;
}

.ns-expert-register-wrapper .ns-form-field label .required {
    color: var(--ns-danger-red) !important;
    margin-right: 3px !important;
}

.ns-expert-register-wrapper .ns-form-field input,
.ns-expert-register-wrapper .ns-form-field select,
.ns-expert-register-wrapper .ns-form-field textarea {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid var(--ns-input-border) !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: var(--ns-text-primary) !important;
    transition: all 0.2s ease !important;
    font-family: "Alexandria", Sans-serif !important;
    box-shadow: none !important;
}

.ns-expert-register-wrapper .ns-form-field input::placeholder,
.ns-expert-register-wrapper .ns-form-field textarea::placeholder {
    color: var(--ns-text-light) !important;
}

.ns-expert-register-wrapper .ns-form-field input:focus,
.ns-expert-register-wrapper .ns-form-field select:focus,
.ns-expert-register-wrapper .ns-form-field textarea:focus {
    outline: none !important;
    border-color: var(--ns-primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1) !important;
}

.ns-expert-register-wrapper .ns-form-field textarea {
    resize: vertical !important;
    min-height: 100px !important;
}

.ns-expert-register-wrapper .ns-form-field input[type="checkbox"] {
    width: auto !important;
    margin-left: 8px !important;
}

/* Field errors */
.ns-expert-register-wrapper .ns-field-error {
    display: block !important;
    color: var(--ns-danger-red) !important;
    margin-top: 5px !important;
    text-align: right !important;
}

/* Grid Layouts */
.ns-expert-register-wrapper .ns-two-col-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

.ns-expert-register-wrapper .ns-two-col-grid .ns-form-field.ns-full {
    grid-column: 1 / -1 !important;
}

@media (max-width: 992px) {
    .ns-expert-register-wrapper .ns-two-col-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ns-expert-register-wrapper .ns-two-col-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Tables - High Specificity
   ========================================================================== */

.ns-expert-register-wrapper .ns-table-wrap {
    overflow-x: auto !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    margin-bottom: 15px !important;
}

.ns-expert-register-wrapper .ns-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #ffffff !important;
    min-width: 700px !important;
}

.ns-expert-register-wrapper .ns-table thead {
    background: #f5f5f5 !important;
}

.ns-expert-register-wrapper .ns-table th,
.ns-expert-register-wrapper .ns-table td {
    padding: 12px 15px !important;
    text-align: right !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.ns-expert-register-wrapper .ns-table th {
    font-weight: 700 !important;
    color: var(--ns-text-primary) !important;
}

.ns-expert-register-wrapper .ns-table tbody tr:last-child td {
    border-bottom: none !important;
}

.ns-expert-register-wrapper .ns-table input,
.ns-expert-register-wrapper .ns-table select,
.ns-expert-register-wrapper .ns-table textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid var(--ns-input-border) !important;
    border-radius: 4px !important;
}

.ns-expert-register-wrapper .ns-table input[type="checkbox"] {
    width: auto !important;
}

/* ==========================================================================
   Buttons - High Specificity
   ========================================================================== */

.ns-expert-register-wrapper .ns-btn {
    border: none !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: all 0.3s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ns-expert-register-wrapper .ns-btn-success {
    background: var(--ns-success-green) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 10px 24px !important;
}

.ns-expert-register-wrapper .ns-btn-success:hover {
    background: #45a049 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3) !important;
}

.ns-expert-register-wrapper .ns-btn-danger {
    background: var(--ns-danger-red) !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    min-width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ns-expert-register-wrapper .ns-btn-danger:hover {
    background: #da190b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3) !important;
}

/* Button positioning below tables */
.ns-expert-register-wrapper .ns-expert-section>.ns-btn-success {
    margin-top: 15px !important;
}

/* ==========================================================================
   Publications List
   ========================================================================== */

.ns-expert-register-wrapper .ns-publications-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

.ns-expert-register-wrapper .ns-pub-row {
    display: grid !important;
    grid-template-columns: 1fr 40px !important;
    gap: 12px !important;
    align-items: start !important;
}

.ns-expert-register-wrapper .ns-pub-row textarea {
    width: 100% !important;
    border: 1px solid var(--ns-input-border) !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
    resize: vertical !important;
    min-height: 80px !important;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.ns-expert-register-wrapper .ns-register-actions {
    margin-top: 30px !important;
}

.ns-expert-register-wrapper .ns-register-submit {
    width: 100% !important;
    padding: 15px 30px !important;
    background: var(--ns-primary-blue) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
}

.ns-expert-register-wrapper .ns-register-submit:hover {
    background: #1976d2 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4) !important;
}

.ns-expert-register-wrapper .ns-register-submit:disabled {
    background: #cccccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.ns-expert-register-wrapper .ns-register-message {
    margin-top: 20px !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-weight: 500 !important;
}

.ns-expert-register-wrapper .ns-register-message.success {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.ns-expert-register-wrapper .ns-register-message.error {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ns-expert-register-wrapper.ns-expert-register-wrapper {
        padding: 15px !important;
    }

    .ns-expert-register-wrapper .ns-expert-section {
        padding: 20px !important;
        margin-bottom: 15px !important;
    }

    .ns-expert-register-wrapper .ns-section-title {
        margin: -20px -20px 15px -20px !important;
        padding: 10px 15px !important;
    }

    .ns-expert-register-wrapper .ns-two-col-grid {
        gap: 15px !important;
    }

    .ns-expert-register-wrapper .ns-register-submit {
        padding: 14px 24px !important;
    }

    .ns-expert-register-wrapper .ns-table-wrap {
        margin-bottom: 10px !important;
    }

    /* CRITICAL: Ensure labels are visible on mobile */
    .ns-expert-register-wrapper .ns-form-field label {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-bottom: 10px !important;
        font-weight: 700 !important;
        color: var(--ns-text-primary) !important;
        text-align: right !important;
        line-height: 1.4 !important;
    }

    /* Increase input field sizes for better mobile UX */
    .ns-expert-register-wrapper .ns-form-field input,
    .ns-expert-register-wrapper .ns-form-field select,
    .ns-expert-register-wrapper .ns-form-field textarea {
        padding: 14px 16px !important;
        min-height: 48px !important;
        border-width: 2px !important;
    }

    /* Ensure form fields have proper spacing */
    .ns-expert-register-wrapper .ns-form-field {
        margin-bottom: 20px !important;
    }
}

@media (max-width: 480px) {
    .ns-expert-register-wrapper.ns-expert-register-wrapper {
        padding: 10px !important;
    }

    .ns-expert-register-wrapper .ns-expert-section {
        padding: 15px !important;
    }

    .ns-expert-register-wrapper .ns-section-title {
        margin: -15px -15px 12px -15px !important;
        padding: 8px 12px !important;
    }

    /* Extra emphasis on label visibility for small screens */
    .ns-expert-register-wrapper .ns-form-field label {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-bottom: 12px !important;
        font-weight: 700 !important;
        color: #000 !important;
        text-align: right !important;
        line-height: 1.5 !important;
        background: transparent !important;
    }

    /* Larger touch targets for mobile */
    .ns-expert-register-wrapper .ns-form-field input,
    .ns-expert-register-wrapper .ns-form-field select,
    .ns-expert-register-wrapper .ns-form-field textarea {
        padding: 16px 18px !important;
        min-height: 52px !important;
        border-width: 2px !important;
    }

    /* Better spacing on small screens */
    .ns-expert-register-wrapper .ns-form-field {
        margin-bottom: 24px !important;
    }

    /* Ensure required asterisk is visible */
    .ns-expert-register-wrapper .ns-form-field label .required {
        color: #ff0000 !important;
        font-weight: 700 !important;
        margin-right: 4px !important;
    }
}