/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Theme Colors with Blue Accent */
    --bg-primary: #0a0b0f;
    --bg-secondary: #151821;
    --bg-tertiary: #1e2332;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-muted: #7a8396;
    --accent-primary: #00b4ff;
    --accent-secondary: #0088cc;
    --accent-tertiary: #2196f3;
    --accent-light: #64b5f6;
    --border-color: #2d3748;
    --gradient-1: linear-gradient(135deg, #00b4ff 0%, #0066cc 100%);
    --gradient-2: linear-gradient(135deg, #2196f3 0%, #1565c0 100%);
    --gradient-3: linear-gradient(135deg, #00b4ff 0%, #2196f3 50%, #1565c0 100%);
    --gradient-dark: linear-gradient(135deg, #151821 0%, #0a0b0f 100%);
    --shadow: 0 10px 30px rgba(0, 180, 255, 0.15);
    --shadow-blue: 0 10px 40px rgba(0, 180, 255, 0.2);
    --shadow-dark: 0 5px 20px rgba(0, 0, 0, 0.4);
    --success-color: #00c851;
    --error-color: #ff4444;
    --warning-color: #ffbb33;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

body.loaded {
    overflow: auto;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    background: var(--gradient-dark);
}

/* Background Elements */
.auth-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 180, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.bg-circle-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 400px;
    height: 400px;
    bottom: -200px;
    left: -200px;
    animation-delay: 7s;
}

.bg-circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: 10%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.5;
    }
}

/* Back to Home */
.back-home {
    position: fixed;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 100;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-home:hover {
    color: var(--accent-primary);
    transform: translateX(-3px);
    background: rgba(0, 180, 255, 0.1);
}

/* Auth Form Container */
.auth-form-container {
    background: rgba(30, 35, 50, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-dark);
    position: relative;
    overflow: hidden;
}

.auth-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-3);
    border-radius: 24px 24px 0 0;
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.auth-logo-img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 180, 255, 0.3));
}

.auth-logo-text {
    height: 24px;
    width: auto;
}

/* Auth Form */
.auth-form {
    width: 100%;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

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

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    z-index: 2;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.form-input:focus + .input-icon,
.form-input:not(:placeholder-shown) + .input-icon {
    color: var(--accent-primary);
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--accent-primary);
    background: rgba(0, 180, 255, 0.1);
}

/* Password Strength */
.password-strength {
    margin-top: 0.75rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.password-strength.active {
    opacity: 1;
    transform: translateY(0);
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    background: var(--error-color);
    transition: all 0.3s ease;
    width: 0%;
}

.strength-fill.weak { 
    background: var(--error-color); 
    width: 25%; 
}

.strength-fill.medium { 
    background: var(--warning-color); 
    width: 50%; 
}

.strength-fill.good { 
    background: var(--accent-primary); 
    width: 75%; 
}

.strength-fill.strong { 
    background: var(--success-color); 
    width: 100%; 
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 1px;
    background: rgba(255, 255, 255, 0.03);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: var(--gradient-1);
    border-color: var(--accent-primary);
}

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

.terms-link {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.terms-link:hover {
    text-decoration: underline;
    color: var(--accent-light);
}

/* Forgot Password */
.forgot-password {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    margin-bottom: 1.5rem;
}

.auth-btn--primary {
    background: var(--gradient-3);
    color: white;
    box-shadow: var(--shadow-blue);
}

.auth-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.5s ease;
}

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

.auth-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 180, 255, 0.3);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Button Loader */
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* Form Validation */
.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.form-input.success {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(0, 200, 81, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.success-message {
    color: var(--success-color);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-form-container {
        padding: 2rem 1.5rem;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .back-home {
        top: 1rem;
        left: 1rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .bg-circle {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-form-container {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
    }
    
    .form-input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
        font-size: 0.9rem;
    }
    
    .auth-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Preloader Styles for Auth Pages */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
}

.preloader__container {
    text-align: center;
    position: relative;
}

.preloader__ninja {
    width: 200px;
    height: auto;
    animation: preloaderFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(0, 180, 255, 0.4));
}

@keyframes preloaderFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    50% {
        transform: translateY(-20px) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-1deg);
    }
}

/* Auth Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.auth-divider span {
    background: var(--bg-primary);
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* Telegram Button */
.auth-btn--telegram {
    background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
    color: white;
    border: none;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
    position: relative;
    overflow: hidden;
}

.auth-btn--telegram::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;
}

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

.auth-btn--telegram:hover {
    background: linear-gradient(135deg, #006699 0%, #1a8bc8 100%);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4);
    transform: translateY(-2px);
}

.auth-btn--telegram:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
}

.auth-btn--telegram svg {
    margin-right: 0.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.auth-btn--telegram:hover svg {
    transform: scale(1.1);
}

