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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    color: #334155;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

/* Simplified Background Animation - Performance Optimized */
.simple-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Static Gradient Overlay */
.gradient-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 60% 10%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite;
}

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

/* Floating Circles - Reduced quantity */
.floating-circles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: simpleFloat 15s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes simpleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px) scale(1.1);
        opacity: 0.5;
    }
    50% {
        transform: translateY(0) translateX(20px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translateY(15px) translateX(-5px) scale(1.05);
        opacity: 0.6;
    }
}

/* Main Register Wrapper */
.register-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.register-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.register-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
}

/* Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin: 0 auto 16px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    /* Simplified animation */
    animation: simplePulse 3s infinite ease-in-out;
}

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

.brand-title {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #1e293b, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

/* Register Form Container */
.register-form-container {
    position: relative;
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    border: 1px solid #fecaca;
}

.success-message {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Form Styles */
.register-form {
    margin-bottom: 24px;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-label i {
    color: #6366f1;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

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

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
}

.strength-meter {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-bar.weak {
    background: #ef4444;
}

.strength-bar.medium {
    background: #f59e0b;
}

.strength-bar.strong {
    background: #3b82f6;
}

.strength-bar.very-strong {
    background: #6366f1;
}

.strength-text {
    font-size: 12px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.strength-text.weak {
    color: #ef4444;
}

.strength-text.medium {
    color: #f59e0b;
}

.strength-text.strong {
    color: #3b82f6;
}

.strength-text.very-strong {
    color: #6366f1;
}

/* Password Match Indicator */
.password-match {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.password-match.match {
    color: #10b981;
}

.password-match.no-match {
    color: #ef4444;
}

/* Checkbox Styles */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 1px;
}

.checkbox-input:checked + .checkbox-custom {
    background: #6366f1;
    border-color: #6366f1;
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    color: #64748b;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    color: white;
}

.btn-social {
    background: white;
    color: #374151;
    border: 2px solid #e2e8f0;
    margin-bottom: 8px;
}

.btn-social:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.google-btn:hover {
    border-color: #ea4335;
    color: #ea4335;
}

.register-btn {
    margin-bottom: 8px;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    animation: ripple-animation 0.6s ease-out;
}

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

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

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

.divider span {
    background: white;
    padding: 0 16px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

/* Social Register */
.social-register {
    margin-bottom: 20px;
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.login-link p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.link-primary {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.link-primary:hover {
    color: #2563eb;
    text-decoration: none;
}

/* Focus Animations */
.form-group.focused .form-label {
    color: #6366f1;
}

.form-group.focused .form-label i {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .register-wrapper {
        padding: 16px;
    }
    
    .register-container {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .brand-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .brand-title {
        font-size: 24px;
    }
    
    .form-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .register-container {
        padding: 24px 20px;
    }
    
    .brand-header {
        margin-bottom: 24px;
    }
    
    .brand-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .brand-title {
        font-size: 20px;
    }
    
    .brand-subtitle {
        font-size: 13px;
    }
    
    .form-title {
        font-size: 18px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
}

/* Additional Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: fadeInUp 0.6s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

.btn { animation: fadeInUp 0.6s ease-out 0.6s both; }
.divider { animation: fadeInUp 0.6s ease-out 0.7s both; }
.social-register { animation: fadeInUp 0.6s ease-out 0.8s both; }
.login-link { animation: fadeInUp 0.6s ease-out 0.9s both; }

/* Custom Scrollbar for better UX */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}