:root {
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    /* Allow natural page scrolling */
}

/* Animated Background Elements - Fixed position */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite linear;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 80%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 15%;
    animation-delay: 4s;
}

.shape:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 30%;
    left: 85%;
    animation-delay: 6s;
}

.shape:nth-child(5) {
    width: 50px;
    height: 50px;
    top: 50%;
    left: 5%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 40px;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.register-breadcrumb {
    position: absolute;
    top: 15px;
    left: 20px;
}

.register-breadcrumb .breadcrumb {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 0;
}

.register-breadcrumb .breadcrumb-item a {
    color: white;
    text-decoration: none;
}

.register-breadcrumb .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.8);
}

.register-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
}

.auth-body {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

.form-control {
    border-radius: 12px;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 1rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}


    color: var(--primary-color);
}

.btn-auth {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-auth:hover::before {
    left: 100%;
}

.btn-auth:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

.btn-social {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    color: #374151;
    position: relative;
    overflow: hidden;
}

.btn-social::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, currentColor 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-social:hover::before {
    opacity: 0.1;
}

.btn-google {
    border-color: #dadce0;
}

.btn-google:hover {
    border-color: #4285f4;
    color: #4285f4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.2);
}

.btn-facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.btn-facebook:hover {
    background: #1877f2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3);
}

.divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
}

.divider-text {
    background: white;
    padding: 0 15px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.referral-banner {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.email-note {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.quick-tips {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.alert {
    border-radius: 12px;
    padding: 15px 20px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.alert a {
    text-decoration: underline;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Form Validation Styles */
.username-feedback {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 20px;
    animation: fadeIn 0.3s ease;
}

.is-valid {
    color: var(--success-color);
    font-weight: 500;
}

.is-invalid {
    color: var(--danger-color);
    font-weight: 500;
}

.loading {
    color: #6c757d;
}

.form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6.4.4.4-.4'/%3e%3cpath d='M6 7v1'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.password-strength {
    height: 6px;
    border-radius: 3px;
    margin-top: 8px;
    background: #e9ecef;
    overflow: hidden;
    position: relative;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.5s ease;
    border-radius: 3px;
}

.strength-weak { 
    background: linear-gradient(90deg, var(--danger-color), #f87171);
    width: 25%; 
}
.strength-fair { 
    background: linear-gradient(90deg, var(--warning-color), #fbbf24);
    width: 50%; 
}
.strength-good { 
    background: linear-gradient(90deg, var(--warning-color), #f59e0b);
    width: 75%; 
}
.strength-strong { 
    background: linear-gradient(90deg, var(--success-color), #34d399);
    width: 100%; 
}

.strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Loading animation for form submission */
.btn-auth.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-auth.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .auth-container {
        margin: 20px auto;
    }
    
    .auth-card {
        margin-bottom: 20px;
    }
    
    .auth-header {
        padding: 30px 20px;
    }
    
    .auth-body {
        padding: 30px 20px;
    }
    
    .register-breadcrumb {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 15px;
    }
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* SEO: Improve accessibility for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
.btn-auth:focus,
.btn-social:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improved Input Wrapper Design */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-left {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.input-wrapper .form-control {
    padding-left: 50px;
    padding-right: 50px;
}

.input-wrapper.focused .input-icon-left {
    color: var(--primary-color);
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.password-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Remove old input-icon styles */

/* Enhanced form control for better spacing with icons */
.form-control {
    height: 52px;
    font-size: 1rem;
    font-weight: 500;
}

.form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-control:focus::placeholder {
    color: #d1d5db;
}

/* Adjust password strength bar for new layout */
.password-strength {
    margin-top: 10px;
}

/* Form text adjustments */
.form-text {
    margin-top: 8px;
    display: block;
}

small.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Enhanced Create Account Button Design */
#submitBtn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    border: none;
    border-radius: 14px;
    padding: 18px 30px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4),
                0 5px 15px rgba(124, 58, 237, 0.3);
    cursor: pointer;
    text-transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#submitBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.7s;
}

#submitBtn:hover::before {
    left: 100%;
}

#submitBtn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(79, 70, 229, 0.5),
                0 8px 20px rgba(124, 58, 237, 0.4),
                0 0 30px rgba(6, 182, 212, 0.3);
}

#submitBtn:active {
    transform: translateY(-2px) scale(0.98);
}

#submitBtn.loading {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    cursor: wait;
    pointer-events: none;
}

#submitBtn i {
    font-size: 1.2rem;
    margin-right: 10px;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Ripple effect for button */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Ensure proper icon positioning in all input fields */
.input-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.input-icon-left {
    position: absolute;
    left: 16px !important;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.15rem;
    z-index: 3;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-wrapper .form-control {
    width: 100%;
    padding-left: 48px !important;
    padding-right: 48px !important;
    height: 54px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.input-wrapper .form-control:focus {
    border-color: var(--primary-color);
    padding-left: 48px !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-wrapper .form-control:focus ~ .input-icon-left,
.input-wrapper:hover .input-icon-left {
    color: var(--primary-color);
}

/* Password toggle button - ensure it stays visible */
.password-toggle {
    position: absolute;
    right: 12px !important;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 3;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-color);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.9);
}

/* CRITICAL FIX: Password field icon positioning */
.form-group .input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.form-group .input-wrapper .input-icon-left {
    position: absolute !important;
    left: 16px !important;
    top: 27px !important;
    transform: none !important;
    color: #6c757d;
    font-size: 1.15rem;
    z-index: 10;
    pointer-events: none;
}

.form-group .input-wrapper .form-control {
    position: relative;
    width: 100%;
    padding-left: 48px !important;
    padding-right: 48px !important;
    height: 54px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.form-group .input-wrapper .password-toggle {
    position: absolute !important;
    right: 12px !important;
    top: 8px !important;
    transform: none !important;
    z-index: 10;
}

/* Ensure password strength bar doesn't interfere */
.password-strength {
    position: relative;
    margin-top: 10px;
    z-index: 1;
}

/* Fix for all input wrappers to ensure proper structure */
div.input-wrapper {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

div.input-wrapper > i.input-icon-left {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

div.input-wrapper > input.form-control {
    margin: 0 !important;
    display: block !important;
}

div.input-wrapper > button.password-toggle {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}
