* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    position: relative;
}

/* Particle Background */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Main Container */
.main-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
    z-index: 2;
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Form Section */
.auth-form-section {
    flex: 1;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.auth-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
    z-index: 1;
}

.auth-form-content {
    padding: 40px;
    flex: 1;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Toggle Button Styles */
.toggle-logo {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #1e3c72;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.toggle-logo:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.toggle-logo i {
    font-size: 20px;
    transition: all 0.3s ease;
}

.toggle-logo:hover i {
    transform: rotate(15deg);
}

/* Hidden Logo Panel */
.logo-panel {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 9;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    width: 220px;
    text-align: center;
}

.logo-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.logo-panel h2 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.logo-panel p {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: #64748b;
    margin-bottom: 40px;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Form Groups */
.form-group {
    margin-bottom: 28px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
    color: #1e293b;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: #fff;
}

.password-toggle {
    position: relative;
}

.password-toggle-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.password-toggle-icon:hover {
    color: #667eea;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 16px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.35);
}

.btn-primary::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: all 0.6s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: #f1f5f9;
    color: #667eea;
    border: 2px solid #e2e8f0;
    padding: 18px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 24px;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Checkbox */
.auth-remember {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.auth-remember input {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: #667eea;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.auth-remember input:checked {
    background: #667eea;
    border-color: #667eea;
}

.auth-remember input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.auth-remember label {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}

/* Links */
.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.auth-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: all 0.3s ease;
}

.auth-links a:hover {
    color: #764ba2;
}

.auth-links a:hover::after {
    width: 100%;
}

/* Visual Section */
.auth-visual-section {
    flex: 1;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

/* Modern SVG Illustration */
.auth-illustration {
    width: 100%;
    max-width: 400px;
    height: 400px;
    position: relative;
    z-index: 2;
}

/* Alert Styles */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 28px;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: slideDown 0.5s ease;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-left: 4px solid #16a34a;
}

/* Animations */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDown {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Scrollbar Styling */
.auth-form-section::-webkit-scrollbar {
    width: 6px;
}

.auth-form-section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.auth-form-section::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.auth-form-section::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .auth-container {
        max-width: 100%;
        margin: 0;
    }
    
    .auth-form-content {
        padding: 35px;
    }
}

@media (max-width: 992px) {
    .auth-container {
        flex-direction: column;
        max-width: 600px;
        margin: 0 auto;
        height: 95vh;
    }
    
    .auth-form-section {
        order: 2;
    }
    
    .auth-visual-section {
        min-height: 250px;
        padding: 30px;
        order: 1;
    }
    
    .auth-illustration {
        max-width: 300px;
        height: 300px;
    }
    
    .toggle-logo {
        top: 15px;
        right: 15px;
    }
    
    .logo-panel {
        top: 60px;
        right: 15px;
    }
}

@media (max-width: 768px) {
    .main-wrapper {
        padding: 5px;
    }
    
    .auth-container {
        border-radius: 16px;
        height: 98vh;
    }
    
    /* Hide visual section on mobile */
    .auth-visual-section {
        display: none;
    }
    
    .auth-form-section {
        border-radius: 16px;
    }
    
    .auth-form-content {
        padding: 25px 20px;
    }
    
    .auth-title {
        font-size: 1.8rem;
    }
    
    .auth-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .form-control {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .btn-primary {
        padding: 14px 25px;
        font-size: 1rem;
    }
    
    .btn-secondary {
        padding: 14px 25px;
        font-size: 1rem;
    }
    
    .auth-remember {
        margin-bottom: 20px;
    }
    
    .toggle-logo {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        background: rgba(102, 126, 234, 0.9);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .toggle-logo i {
        font-size: 18px;
        color: white;
    }
    
    .logo-panel {
        top: 60px;
        right: 15px;
        width: 200px;
        padding: 15px;
    }
    
    .logo-panel h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .main-wrapper {
        padding: 0;
    }
    
    .auth-container {
        border-radius: 0;
        height: 100vh;
        max-height: none;
    }
    
    .auth-form-section {
        border-radius: 0;
    }
    
    .auth-form-content {
        padding: 20px 15px;
    }
    
    .auth-title {
        font-size: 1.6rem;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .btn-primary {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .btn-secondary {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .alert {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .toggle-logo {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
    }
    
    .toggle-logo i {
        font-size: 16px;
    }
    
    .logo-panel {
        top: 50px;
        right: 10px;
        width: 180px;
        padding: 12px;
    }
    
    .logo-panel h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .auth-form-content {
        padding: 15px 12px;
    }
    
    .auth-title {
        font-size: 1.4rem;
    }
    
    .auth-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .form-control {
        padding: 11px 14px;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 12px 18px;
        font-size: 0.9rem;
    }
    
    .btn-secondary {
        padding: 12px 18px;
        font-size: 0.9rem;
    }
    
    .auth-remember {
        margin-bottom: 16px;
    }
    
    .logo-panel {
        width: 160px;
        padding: 10px;
    }
    
    .logo-panel h2 {
        font-size: 1.2rem;
    }
    
    .logo-panel p {
        font-size: 0.8rem;
    }
}

/* Mobile Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .form-control, .btn-primary, .btn-secondary, .toggle-logo {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .btn-primary:active, .btn-secondary:active, .toggle-logo:active {
        transform: scale(0.98);
    }
    
    .auth-remember input {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
}

/* Landscape Mode */
@media (max-width: 992px) and (orientation: landscape) {
    .auth-container {
        flex-direction: row;
        max-height: 95vh;
    }
    
    .auth-form-section {
        order: 1;
        overflow-y: auto;
    }
    
    .auth-visual-section {
        order: 2;
        min-height: auto;
        flex: 0.8;
    }
}

/* Small Height Devices */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-form-content {
        padding: 15px 20px;
    }
    
    .auth-visual-section {
        padding: 15px;
    }
    
    .auth-illustration {
        max-width: 150px;
        height: 150px;
    }
    
    .auth-title {
        font-size: 1.2rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .toggle-logo {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }
    
    .toggle-logo i {
        font-size: 14px;
    }
    
    .logo-panel {
        top: 45px;
        right: 10px;
        width: 160px;
        padding: 10px;
    }
    
    .logo-panel h2 {
        font-size: 1.2rem;
    }
    
    .logo-panel p {
        font-size: 0.8rem;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .auth-form-section {
        -webkit-overflow-scrolling: touch;
    }
    
    .form-control {
        font-size: 16px; /* Prevent zoom on focus */
    }
}

/* Android Specific Fixes */
@media screen and (-webkit-device-pixel-ratio) and (min-resolution: 192dpi) {
    .auth-container {
        border-radius: 0;
    }
}