* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2f0041, #1a0026, #0d0014);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    background: linear-gradient(135deg, #2f0041, #1a0026, #0d0014);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    box-shadow: none;
    border-radius: 0;
    max-width: none;
}

.header {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    padding: 10px 20px 25px 20px;
    text-align: center;
    position: relative;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.18), 0 6px 12px rgba(0, 0, 0, 0.10);
}

.header::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -16px;
    width: 86%;
    height: 24px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.10) 45%, rgba(0, 0, 0, 0) 70%);
    filter: blur(6px);
    border-radius: 50%;
    pointer-events: none;
}

.logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-radius: 15px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: floatLogo 3.5s ease-in-out infinite;
}

.logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.1);
}

@keyframes floatLogo {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.title {
    color: white;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 3px;
    line-height: 1.0;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.0;
}

#registerForm {
    padding: 20px 16px; /* reduce left/right spacing */
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.1;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    line-height: 1.2;
}

.form-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.7);
    background: rgba(255, 255, 255, 0.2);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-input.error {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.form-input.success {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .form-input {
    padding-right: 45px; /* keep space for password eye on the right */
    padding-left: 48px;  /* add space for left-side icon */
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #a855f7;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 5px 7px;
    line-height: 1;
    pointer-events: none;
}

.password-toggle {
    pointer-events: auto;
    cursor: pointer;
    transition: color 0.3s ease;
    left: auto;
    right: 15px;
    background: transparent;
    color: #a855f7;
    padding: 0;
}

.password-toggle:hover {
    color: #8b5cf6;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.optional-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: normal;
}

.help-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #8b5cf6;
}

.checkbox-label {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.2;
    flex: 1;
}

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

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

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.btn .btn-icon {
    font-size: 16px;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
}



.login-link {
    text-align: center;
    padding: 0 30px 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.login-link a {
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

.loading {
    color: white;
    font-weight: 600;
}

/* Popup Overlay Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(135deg, #2d1b69 0%, #1e0b4b 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: all 0.3s ease;
    position: relative;
}

.popup-overlay.show .popup-content {
    transform: scale(1);
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem 0;
    border-bottom: none;
}

.popup-header h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.popup-body {
    padding: 0.05rem 1rem 0.9rem;
    text-align: center;
}

.success-title-line {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.15rem;
    margin: 0 0 .4rem 0;
}

.popup-footer {
    padding: 0.8rem 1.2rem 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 15px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

/* Success popup enhancements */
.popup-success {
    overflow: hidden;
}

.success-hero {
    position: relative;
    height: 100px;
    background: radial-gradient(80% 100% at 50% 0%, rgba(168, 85, 247, 0.25), rgba(45, 27, 105, 0) 55%);
}

.success-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -45%);
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.45);
}

.success-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -45%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(34, 197, 94, 0.35) 0%, rgba(34, 197, 94, 0.08) 60%, rgba(0,0,0,0) 70%);
    filter: blur(2px);
}

.success-text {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 0.95rem;
    margin-top: 0;
}

.bonus-amount {
    display: inline-block;
    background: #0b3b26; /* dark green */
    color: #d1fae5;
    font-weight: 900;
    font-size: 1.4rem;
    padding: .4rem .9rem;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(6,95,70,.35);
    border: 2px solid rgba(255, 255, 255, 0.7); /* slightly dark white stroke */
    margin: .3rem 0 .45rem;
}

.bonus-amount .bonus-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
}

.bonus-amount .amount-text {
    vertical-align: middle;
}

.bonus-note {
    color: rgba(255,255,255,.9);
    font-size: .95rem;
}

/* Terms and Conditions Popup Styles */
.terms-content {
    max-height: 60vh;
    overflow-y: auto;
}

.terms-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.last-updated {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin: 0;
}

.terms-section {
    margin-bottom: 1.5rem;
}

.terms-section h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.2rem;
    display: inline-block;
    width: 24px;
    text-align: center;
}

.terms-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    text-align: justify;
}

/* Privacy Policy Popup Styles */
.privacy-content {
    max-height: 60vh;
    overflow-y: auto;
}

.privacy-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.privacy-section {
    margin-bottom: 1.5rem;
}

.privacy-section h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.privacy-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    text-align: justify;
}

/* Inward pulse effect for Login button in success popup */
@keyframes pulseIn {
    0% {
        transform: scale(1);
        box-shadow: inset 0 0 0 0 rgba(255,255,255,0), 0 8px 25px rgba(139, 92, 246, 0.4);
        filter: brightness(1);
    }
    50% {
        transform: scale(0.97);
        box-shadow: inset 0 0 0 6px rgba(255,255,255,0.15), 0 8px 25px rgba(139, 92, 246, 0.4);
        filter: brightness(1.05);
    }
    100% {
        transform: scale(1);
        box-shadow: inset 0 0 0 0 rgba(255,255,255,0), 0 8px 25px rgba(139, 92, 246, 0.4);
        filter: brightness(1);
    }
}

.popup-success .btn-primary {
    animation: pulseIn 1.8s ease-in-out infinite;
    will-change: transform, box-shadow, filter;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Popup */
@media (max-width: 480px) {
    .popup-content {
        width: 95%;
        margin: 1rem;
    }
    
    .popup-header {
        padding: 0.5rem 0.8rem 0; /* tighter on small screens */
        border-bottom: none;
    }
    
    .popup-header h3 {
        font-size: 1.1rem;
    }
    
    .popup-body {
        padding: 0.2rem 0.8rem 0.8rem; /* reduce top padding */
    }
    
    .popup-footer {
        padding: 0.8rem 1.2rem 1.2rem;
    }
    
    .btn-primary {
        padding: 0.7rem 1.8rem;
        font-size: 0.9rem;
    }
    
    .terms-content,
    .privacy-content {
        max-height: 50vh;
    }
    
    .terms-section,
    .privacy-section {
        margin-bottom: 1.2rem;
    }
    
    .terms-section h4,
    .privacy-section h4 {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .terms-section p,
    .privacy-section p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .section-icon {
        font-size: 1.1rem;
        width: 22px;
    }
}

