:root {
    --primary-color: #FF3600;
    --primary-hover: #FF5722;
    --bg-dark: #0A0A0A;
    --bg-card: #1A1A1A;
    --bg-input: #2A2A2A;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --text-muted: #666666;
    --border-color: #333333;
    --border-focus: #FF3600;
    --danger-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --gradient: linear-gradient(135deg, #FF3600 0%, #FF6B00 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 54, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 54, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 54, 0, 0.08) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    50% { 
        background-position: 100% 100%, 0% 0%, 80% 80%;
    }
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.1;
    animation: float 15s infinite linear;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 80%;
    animation-delay: -5s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    top: 80%;
    left: 20%;
    animation-delay: -10s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    top: 30%;
    left: 70%;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    33% { 
        transform: translateY(-30px) rotate(120deg); 
    }
    66% { 
        transform: translateY(15px) rotate(240deg); 
    }
}

.login-container {
    width: 100%;
    max-width: 440px;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
}

.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.security-indicator {
    background: rgba(255, 54, 0, 0.1);
    border: 1px solid rgba(255, 54, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.security-level {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.level-high {
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.security-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.security-progress {
    width: 100%;
    height: 100%;
    background: var(--gradient);
    border-radius: 2px;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.login-form {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 1.25rem 1rem 1.25rem 3rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(255, 54, 0, 0.1);
    background: var(--bg-card);
}

.form-input:focus + .input-label,
.form-input:not(:placeholder-shown) + .input-label {
    top: -8px;
    left: 3rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    background: var(--bg-card);
    padding: 0 0.5rem;
}

.input-label {
    position: absolute;
    left: 3rem;
    top: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary-color);
    background: rgba(255, 54, 0, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.forgot-password {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-color);
}

.btn-login {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(255, 54, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::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-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 54, 0, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.security-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.feature i {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: var(--bg-card);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast i {
    font-size: 1.25rem;
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.error i {
    color: var(--danger-color);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.success i {
    color: var(--success-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.warning i {
    color: var(--warning-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.75rem;
    }
    
    .security-features {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .login-card {
        padding: 1.5rem 1rem;
    }
    
    .input-field i {
        left: 0.75rem;
    }
    
    .form-input {
        padding-left: 2.5rem;
    }
    
    .btn-login {
        padding: 1rem 1.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #555555;
        --text-secondary: #CCCCCC;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}