/* ==================== AUTH STYLES ==================== */

/* Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #0a0a0f 0%, 
        #1a1a27 25%, 
        #0f0f1e 50%, 
        #1a1a27 75%, 
        #0a0a0f 100%
    );
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

@keyframes gradientAnimation {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

/* Floating shapes */
.particles-container::before,
.particles-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-primary);
    filter: blur(80px);
    opacity: 0.3;
    animation: floatShapes 20s ease-in-out infinite;
}

.particles-container::before {
    width: 400px;
    height: 400px;
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.particles-container::after {
    width: 500px;
    height: 500px;
    bottom: -250px;
    right: -250px;
    background: var(--gradient-secondary);
    animation-delay: 5s;
}

@keyframes floatShapes {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -50px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

/* Auth Wrapper */
.auth-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-link .logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.6));
    animation: pulse 3s ease-in-out infinite;
}

.logo-link .logo-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Auth Card */
.auth-card {
    background: rgba(26, 26, 39, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.5;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert svg {
    flex-shrink: 0;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input.error {
    border-color: var(--error);
}

.form-input.success {
    border-color: var(--success);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-input:focus + .input-icon {
    color: var(--primary);
}

.input-status {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: none;
}

.input-status::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid currentColor;
}

.form-input.success ~ .input-status {
    display: block;
    color: var(--success);
}

.form-input.success ~ .input-status::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.hidden {
    display: none !important;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-error {
    font-size: 0.85rem;
    color: var(--error);
    display: none;
    animation: shake 0.3s ease;
}

.form-error.show {
    display: block;
}

/* Password Strength */
.password-strength {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    background: var(--error);
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-bar.weak .strength-fill {
    width: 33%;
    background: var(--error);
}

.strength-bar.medium .strength-fill {
    width: 66%;
    background: var(--warning);
}

.strength-bar.strong .strength-fill {
    width: 100%;
    background: var(--success);
}

.strength-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.strength-bar.weak ~ .strength-text {
    color: var(--error);
}

.strength-bar.medium ~ .strength-text {
    color: var(--warning);
}

.strength-bar.strong ~ .strength-text {
    color: var(--success);
}

/* Checkbox */
.checkbox-label,
.checkbox-label-large {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.checkbox:checked ~ .checkbox-custom {
    background: var(--gradient-primary);
    border-color: var(--primary);
}

.checkbox:checked ~ .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox:focus ~ .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.checkbox-label-large {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.link-inline {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-inline:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.5rem;
}

.forgot-link {
    font-size: 0.9rem;
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Button */
.btn-auth {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-auth.loading .btn-text {
    opacity: 0;
}

.btn-auth.loading .btn-loader {
    display: block !important;
}

.spinner {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.spinner-circle {
    stroke: currentColor;
    stroke-linecap: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes dash {
    0% {
        stroke-dashoffset: 60;
    }
    50% {
        stroke-dashoffset: 15;
        transform: rotate(135deg);
    }
    100% {
        stroke-dashoffset: 60;
        transform: rotate(450deg);
    }
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
}

.auth-footer-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: rgba(26, 26, 39, 0.8);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Social Auth */
.social-auth {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.social-vk {
    border-color: rgba(0, 119, 255, 0.3);
}

.social-vk:hover {
    background: rgba(0, 119, 255, 0.1);
    border-color: rgba(0, 119, 255, 0.5);
}

.social-discord {
    border-color: rgba(114, 137, 218, 0.3);
}

.social-discord:hover {
    background: rgba(114, 137, 218, 0.1);
    border-color: rgba(114, 137, 218, 0.5);
}

/* Back Home */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.back-home:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateX(-5px);
}

.back-home svg {
    width: 18px;
    height: 18px;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-wrapper {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .social-auth {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .logo-link .logo-text {
        font-size: 1.5rem;
    }
    
    .logo-link .logo-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .form-input {
        padding: 0.875rem 2.75rem 0.875rem 2.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
