/* ==========================================================================
   REGISTRATION FORM STYLES - BASIC THEME
   OPTIMIZED: Mobile-first, Design Tokens, 4 Breakpoints
   ========================================================================== */

/* Registration Section Container */
.registration-section {
    position: relative;
    width: 100%;
    min-height: 667px;
    background: var(--color-black);
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8) 0;
    /* 32px mobile */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Mobile Only: Use bg-register-form image */
@media (max-width: 767px) {
    .registration-section {
        background: url('../images/bg-register-form.png') center/cover no-repeat !important;
    }

    /* Override .registration-bg background for mobile */
    .registration-bg {
        background: url('../images/bg-register-form.png') center/cover no-repeat !important;
    }

    /* Hide desktop pseudo-element backgrounds on mobile */
    .registration-bg::before,
    .registration-bg::after {
        display: none !important;
        content: none !important;
    }
}

/* Background overlay - REMOVED to show clear background image */
/* .registration-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-black-20);
    z-index: 1;
    pointer-events: none;
} */

/* .registration-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
} */

/* Inner Container - Mobile-first */
.registration-container {
    max-width: var(--container-max-width);
    /* 1440px */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: left;
    position: relative;
    z-index: 2;
    padding: 0 var(--spacing-4);
    /* 16px mobile */
}

/* Form Card Container - Mobile-first */
.form-card {
    position: relative;
    width: 100%;
    max-width: 530px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    /* 16px */
    padding: var(--spacing-6) var(--spacing-5);
    /* 24px 20px mobile */
    box-shadow: var(--shadow-card);
    z-index: 2;
}

/* Form Title - Mobile-first */
.form-title {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-20);
    /* 20px mobile */
    line-height: var(--line-height-tight);
    color: var(--color-gray-700);
    text-align: center;
    margin-bottom: var(--spacing-1);
    /* 4px */
}

/* Form Subtitle - Mobile-first */
.form-subtitle {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-10);
    /* 10px mobile */
    line-height: var(--line-height-normal);
    color: var(--color-gray-400);
    text-align: center;
    margin-bottom: var(--spacing-4);
    /* 16px */
}

/* Form Layout */
.form-row {
    display: flex;
    flex-direction: column;
    /* Stack on mobile */
}

.form-row>.form-group {
    flex: 1;
    min-width: 0;
}

.form-row>.form-group:last-child {
    margin-bottom: 0;
    /* No margin on last item */
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group .form-label {
    margin-bottom: 4px;
    /* Space between label and input */
}

.form-group.full-width {
    margin-top: var(--spacing-3);
    /* 8px */
    width: 100%;
}

/* Form Labels */
.form-label {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-16);
    color: var(--color-gray-600);
    display: flex;
    align-items: center;
}

.required {
    color: var(--color-error);
    font-weight: var(--font-weight-regular);
    margin-left: 4px;
    /* Space before asterisk - Safari compatible */
}

/* Input Fields - Mobile-first */
.input-field {
    display: flex;
    align-items: center;
    width: 100%;
    /* Ensure it respects parent width */
    padding: var(--spacing-3) var(--spacing-3);
    /* 12px mobile */
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    /* 12px */
    background: var(--color-white);
    transition: var(--transition-normal);
    min-height: 48px;
    /* Mobile size */
    box-sizing: border-box;
    margin-top: 4px;
}

.input-field:focus-within {
    border-color: var(--color-primary);
    box-shadow: none;
    outline: none;
}

.input-field input,
.input-field select {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-primary);
    font-size: var(--font-size-14);
    /* 14px mobile */
    background: transparent;
    color: var(--color-gray-600);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.input-field input::placeholder {
    color: var(--color-gray-400);
    font-size: var(--font-size-14);
}

.input-field select {
    cursor: pointer;
}

/* Submit Button - Mobile-first */
.submit-button {
    background: var(--color-primary-gradient);
    color: var(--color-white);
    padding: var(--spacing-3) var(--spacing-5);
    /* 12px 20px mobile */
    border-radius: var(--radius-lg);
    /* 12px */
    width: 100%;
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-14);
    /* 14px mobile */
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    margin-top: var(--spacing-6);
    /* 8px */
    box-shadow: var(--shadow-button);
}

.submit-button:hover {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-hover);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    background: var(--color-gray-400);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* Privacy Notice - Mobile-first */
.privacy-notice {
    font-family: var(--font-primary);
    font-size: var(--font-size-11);
    /* 11px mobile */
    color: var(--color-gray-400);
    text-align: center;
    /* Căn giữa trên mobile */
    margin-top: var(--spacing-3);
    /* 12px */
    line-height: var(--line-height-normal);
}

.privacy-notice .bold {
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-400);
}

.privacy-notice a,
.privacy-notice__link {
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-400);
    text-decoration: none;
}

.privacy-notice a:hover,
.privacy-notice__link:hover {
    text-decoration: underline;
}

/* Hero Image - Hidden on mobile */
.hero-image {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    max-width: 50%;
    height: auto;
    object-fit: cover;
    z-index: 1;
    display: none;
}

/* Form Validation States */
.input-field.error {
    border-color: var(--color-error);
    background-color: #fff5f5;
}

.input-field.error:focus-within {
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.input-field.success {
    border-color: var(--color-success);
    background-color: #f0fdf4;
}

.error-message {
    color: var(--color-error);
    font-size: var(--font-size-12);
    margin-top: var(--spacing-1);
    /* 4px */
    font-weight: var(--font-weight-medium);
    display: block;
}

/* Loading Spinner */
.loading-spinner {
    width: var(--spacing-4);
    /* 16px */
    height: var(--spacing-4);
    border: 2px solid var(--color-white-20);
    border-top: 2px solid currentColor;
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: var(--spacing-2);
}

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

/* Button States */
.submit-button.success {
    background: var(--color-success);
}

.submit-button.error {
    background: var(--color-error);
}

/* ==========================================================================
   SELECT2 CUSTOM STYLING
   ========================================================================== */

/* Select2 Container - Mobile-first */
.select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
    padding: 12px var(--spacing-md, 16px);
    border: 1px solid var(--color-border, #E0E0E0) !important;
    /* ← Border xám rõ ràng */
    border-radius: 12px;
    background: var(--color-white, #FFFFFF);
    height: auto;
    min-height: 48px;
    transition: all 0.3s ease;
    position: relative;
    box-sizing: border-box;
}

.select2-container--default .select2-selection--single:hover {
    border-color: var(--color-border-hover, #D1D5DB) !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--color-secondary, #0077B6) !important;
    /* ← Border xanh khi focus/open */
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
    outline: none;
}

/* Select2 Text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-family: var(--font-primary);
    font-size: var(--font-size-14);
    /* 14px mobile */
    color: var(--color-gray-600);
    line-height: var(--line-height-normal);
    padding: 0;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--color-gray-400);
    font-size: var(--font-size-14);
}

/* Custom Arrow Icon */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    position: absolute;
    height: 100%;
    top: 0;
    right: var(--spacing-4);
    /* 16px */
    width: var(--spacing-5);
    /* 20px */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none;
    /* Hide default */
}

/* Down arrow (closed state) */
.select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: '';
    position: absolute;
    width: var(--spacing-4);
    /* 16px */
    height: var(--spacing-4);
    background-image: url('../images/ic-arrow-down.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: var(--transition-fast);
}

/* Up arrow (open state) */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow::after {
    background-image: url('../images/ic-arrow-up.png');
}

/* Dropdown */
.select2-container--default .select2-dropdown {
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-top: var(--spacing-1);
}

/* Search Field */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    padding: var(--spacing-2) var(--spacing-3);
    font-family: var(--font-primary);
    font-size: var(--font-size-14);
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--color-secondary);
    outline: none;
}

/* Options */
.select2-container--default .select2-results__option {
    padding: var(--spacing-2) var(--spacing-3);
    font-family: var(--font-primary);
    font-size: var(--font-size-14);
    color: var(--color-gray-700);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--color-gray-100);
    color: var(--color-gray-700);
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

/* Clear button */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--color-gray-400);
    font-size: var(--font-size-18);
    margin-right: var(--spacing-2);
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--color-error);
}

/* Loading & No results */
.select2-container--default .select2-results__option--loading,
.select2-container--default .select2-results__message {
    color: var(--color-gray-400);
    padding: var(--spacing-2) var(--spacing-3);
    font-size: var(--font-size-14);
}

/* Input field with Select2 */
.input-field.select2-container--default {
    padding: 0;
    border: none;
}

.input-field .select2-container {
    width: 100% !important;
}

/* Hide original select */
.input-field select.select2-hidden-accessible {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN - MOBILE-FIRST
   ========================================================================== */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .registration-section {
        padding: var(--spacing-10) 0;
        /* 40px tablet+ */
    }

    .registration-container {
        padding: 0 var(--spacing-5);
        /* 20px tablet */
    }

    .form-card {
        padding: var(--spacing-6) var(--spacing-6);
        /* 24px 24px */
    }

    .form-title {
        font-size: var(--font-size-24);
        /* 24px tablet */
        margin-bottom: var(--spacing-2);
        /* 8px */
    }

    .form-subtitle {
        font-size: var(--font-size-11);
        /* 11px tablet */
        margin-bottom: var(--spacing-5);
        /* 20px */
    }

    .form-row {
        flex-direction: row;
        /* Side by side on tablet+ */
        gap: 0;
        /* Remove gap for Safari compatibility */
    }

    .form-row>.form-group {
        margin-right: var(--spacing-4);
        /* 16px spacing between fields */
    }

    .form-row>.form-group:last-child {
        margin-right: 0;
        /* No margin on last item */
    }

    .input-field {
        padding: var(--spacing-3) var(--spacing-4);
        /* 12px 16px */
        min-height: 48px;
    }

    .input-field input,
    .input-field select {
        font-size: var(--font-size-14);
    }

    .input-field input::placeholder {
        font-size: var(--font-size-14);
    }

    .submit-button {
        padding: var(--spacing-3) var(--spacing-6);
        /* 12px 24px */
        font-size: var(--font-size-15);
    }

    .privacy-notice {
        font-size: var(--font-size-12);
        text-align: start;
        /* Căn trái trở lại trên tablet+ */
    }

    /* Select2 tablet */
    .select2-container--default .select2-selection--single {
        padding: var(--spacing-3) var(--spacing-10) var(--spacing-3) var(--spacing-4);
        min-height: 48px;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered,
    .select2-container--default .select2-selection--single .select2-selection__placeholder {
        font-size: var(--font-size-14);
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        right: var(--spacing-4);
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .registration-container {
        padding: 0 var(--spacing-6);
        /* 24px desktop */
    }

    .form-card {
        padding: var(--spacing-8) var(--spacing-10);
        /* 32px 40px */
    }

    .form-title {
        font-size: var(--font-size-32);
        /* 32px desktop */
    }

    .form-subtitle {
        font-size: var(--font-size-12);
        /* 12px desktop */
        margin-bottom: var(--spacing-6);
        /* 24px */
    }

    .input-field {
        min-height: 50px;
        /* Larger on desktop */
    }

    .input-field input,
    .input-field select,
    .input-field input::placeholder {
        font-size: var(--font-size-16);
        /* 16px desktop */
    }

    .submit-button {
        font-size: var(--font-size-16);
    }

    /* Select2 desktop */
    .select2-container--default .select2-selection--single {
        padding: var(--spacing-3) var(--spacing-10) var(--spacing-3) var(--spacing-4);
        min-height: 50px;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered,
    .select2-container--default .select2-selection--single .select2-selection__placeholder {
        font-size: var(--font-size-16);
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        right: var(--spacing-4);
        width: var(--spacing-5);
    }
}

/* Wide: 1440px+ */
@media (min-width: 1440px) {
    .registration-container {
        padding: 0 var(--spacing-8);
        /* 32px wide */
    }

    .hero-image {
        display: block;
        /* Show hero image on wide screens */
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.input-field:focus-visible,
.submit-button:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* ==========================================================================
   CUSTOM DROPDOWN INTEGRATION IN REGISTRATION FORM
   ========================================================================== */

/* Custom Dropdown in Form Group */
.form-group .custom-dropdown {
    margin-top: 4px;
    /* 8px - consistent with .form-group gap */
    position: relative;
    /* Create stacking context */
    z-index: 1;
    /* Default z-index */
}

/* When dropdown is open, increase z-index to overlay other elements */
.form-group .custom-dropdown.open {
    z-index: 100;
    /* Higher than other form elements */
}

/* Ensure custom dropdown has proper focus states */
.form-group .custom-dropdown__trigger:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Dropdown menu positioning within registration form */
.form-group .custom-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    /* Relative to parent dropdown */
}

.registration-theme-basic .select2-theme-basic {
    padding: 0;
    border: 0;
}
.registration-theme-basic .select2-container--default .select2-selection--single .select2-selection__arrow::after {
    background-image: url('../images/arrow-down-16.svg');
}
.custom-dropdown__icon.arrow-down-16 {
    width: 16px;
    height: 16px;
    background-image: url('../images/arrow-down-16.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.modal-theme-basic .select2-container--default .select2-selection--single .select2-selection__arrow::after{
    display: none;
}
.location-popup form.modal-theme-basic button[type=submit], .location-popup form button.btn-submit {
    outline: none;
    border: none;
    background: #35B003;
}
.modal-theme-basic #select2-location_province-results .select2-results__option--highlighted[aria-selected] {
    background: #40C804;
    color: #fff;
}
.registration-theme-basic .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: #40C804;
}
.registration-theme-basic .select2-container--default .select2-results__option--selected {
    background-color: #E8F9E5;
}
