/* Sponsor UI - Same Layout for All Devices */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #1c1230;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 16px;
}

.form-container {
    background: #2a1b4a;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 720px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

p {
    font-size: 0.85rem;
    color: #d1c4e9;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

p a {
    color: #bb86fc;
    text-decoration: none;
    font-weight: 500;
}

p a:hover {
    text-decoration: underline;
}

.error,
.success {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-align: left;
}

.error {
    background: #ff6b6b;
    color: #fff;
}

.success {
    background: #4caf50;
    color: #fff;
}

input[type=text],
input[type=email],
input[type=password],
select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 8px;
    background: #3c2f5f;
    color: #fff;
    font-size: 1rem;
    transition: box-shadow .25s ease, background-color .25s ease;
}

input::placeholder {
    color: #b0a8d1;
}

input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(187, 134, 252, .35);
}

.single-row {
    margin-bottom: 0.5rem;
}

.password-container {
    position: relative;
    margin-bottom: 1rem;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #bb86fc;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    z-index: 2;
}

.toggle-password:hover {
    color: #fff;
}

select {
    appearance: none;
    background: #3c2f5f url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23bb86fc" height="18" width="18"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 12px center;
    background-size: 14px;
}

/* Same Grid Layout for All Devices */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* Mobile adjustments - Keep grid but adjust spacing */
@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }
    
    .form-container {
        padding: 1.25rem;
    }
    
    .form-grid-2col {
        gap: 0.75rem;
    }
    
    input[type=text],
    input[type=email],
    input[type=password],
    select {
        padding: 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
        margin-bottom: 0.875rem;
    }
    
    h1 {
        font-size: 1.4rem;
    }
}

/* Very small screens - Keep grid but adjust further */
@media (max-width: 360px) {
    .form-container {
        padding: 1rem;
    }
    
    .form-grid-2col {
        gap: 0.5rem;
    }
    
    input[type=text],
    input[type=email],
    input[type=password],
    select {
        padding: 0.75rem;
    }
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #d1c4e9;
    margin: 1rem 0;
    text-align: left;
    line-height: 1.4;
}

.checkbox a {
    color: #bb86fc;
    text-decoration: none;
}

.checkbox a:hover {
    text-decoration: underline;
}

/* green tick */
.checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    appearance: none;
    border-radius: 4px;
    border: 2px solid #6b6b6b;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.checkbox input[type="checkbox"]:checked {
    background: #2ecc71;
    border-color: #2ecc71;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.12);
}

.checkbox input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #fff;
    position: absolute;
    left: 2px;
    top: -1px;
    font-size: 12px;
}

button[type=submit] {
    width: 100%;
    padding: 0.875rem;
    background: #bb86fc;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .2s ease, transform .08s ease;
    margin-top: 0.5rem;
}

button[type=submit]:hover {
    background: #9f4ce8;
    transform: translateY(-1px);
}

button[type=submit]:active {
    transform: translateY(0);
}

#loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 18, 48, .9);
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    border: 4px solid #3c2f5f;
    border-top: 4px solid #bb86fc;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0)
    }

    100% {
        transform: rotate(360deg)
    }
}

/* Center floating toast */
.toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.98);
    background: #333;
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: all .28s cubic-bezier(.2, .9, .2, 1);
    z-index: 9999;
    min-width: 280px;
    max-width: 90vw;
    text-align: center;
    font-size: 0.9rem;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.muted {
    color: #bfb3e6;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* Enhanced Select2 Styles with Different Colors */
.select2-container--default .select2-selection--single {
    height: 47px !important;
    background-color: #3c2f5f !important;
    border: none !important;
    border-radius: 8px !important;
    transition: box-shadow .25s ease, background-color .25s ease;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
    line-height: 45px !important;
    padding-left: 15px !important;
    font-size: 1rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 45px !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #bb86fc transparent transparent transparent !important;
    border-width: 6px 6px 0 6px !important;
}

/* Dropdown Container */
.select2-container--default .select2-dropdown {
    background-color: #2a1b4a !important;
    border: 2px solid #bb86fc !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Force Select2 dropdowns to open downward */
.select2-container--open .select2-dropdown {
    top: 100% !important;
    bottom: auto !important;
    transform: none !important;
}
        /* Add some styles for Select2 to work well */
        .select2-container { width: 100% !important; }
        .select2-container .select2-selection--single { height: 40px; border: 1px solid #ccc; border-radius: 4px; }
        .select2-container .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-left: 12px; }
        .select2-container .select2-selection--single .select2-selection__arrow { height: 38px; }
        
        /* Loading overlay for AJAX */
        #loading-overlay { 
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
            background: rgba(255,255,255,0.7); z-index: 1000;
            align-items: center; justify-content: center;
        }
        .spinner {
            border: 4px solid #f3f3f3; border-top: 4px solid #3498db;
            border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Dropdown Results */
.select2-container--default .select2-results > .select2-results__options {
    max-height: 200px;
    background: #2a1b4a;
}

/* Individual Option Items */
.select2-container--default .select2-results__option {
    padding: 12px 16px !important;
    color: #d1c4e9 !important;
    background-color: #2a1b4a !important;
    border-bottom: 1px solid #3c2f5f !important;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

/* Hover State - Purple */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #bb86fc !important;
    color: #1c1230 !important;
    font-weight: 500;
}

/* Selected State - Green */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #2ecc71 !important;
    color: #fff !important;
    font-weight: 500;
}

/* Loading State */
.select2-container--default .select2-results__option--loading {
    background-color: #3c2f5f !important;
    color: #bb86fc !important;
    font-style: italic;
}

/* No Results Message */
.select2-container--default .select2-results__option--no-results {
    background-color: #3c2f5f !important;
    color: #ff6b6b !important;
    text-align: center;
    padding: 20px !important;
}

/* Focus State for Selection */
.select2-container--default.select2-container--focus .select2-selection--single {
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.35) !important;
}

/* Disabled State */
.select2-container--default .select2-selection--single[aria-disabled=true] {
    background-color: #2a1b4a !important;
    opacity: 0.6;
}

.select2-container--default .select2-selection--single[aria-disabled=true] .select2-selection__rendered {
    color: #b0a8d1 !important;
}

/* Container when open */
.select2-container--default.select2-container--open .select2-selection--single {
    background-color: #4a3a7a !important;
}

/* Scrollbar Styling for Webkit browsers */
.select2-container--default .select2-results__options::-webkit-scrollbar {
    width: 8px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-track {
    background: #2a1b4a;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-thumb {
    background: #bb86fc;
    border-radius: 4px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #9f4ce8;
}

/* Ensure dropdown stays within viewport on mobile */
@media (max-width: 480px) {
    .select2-container--open .select2-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        max-width: 400px !important;
        border-radius: 12px 12px 0 0 !important;
    }
    
    .select2-container--open .select2-dropdown .select2-results {
        max-height: 60vh !important;
    }
}



    