/**
 * Login/Register Page Styles
 * Cybersecurity-themed authentication UI
 */

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0f 0%, #0d1117 50%, #0a0a0f 100%);
}

/* Cyber Grid Background */
.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    animation: gridPulse 10s ease-in-out infinite;
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* Floating Particles */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 15s ease-in-out infinite;
}

.floating-particles::before {
    background: rgba(0, 212, 255, 0.15);
    top: 10%;
    left: 10%;
}

.floating-particles::after {
    background: rgba(139, 92, 246, 0.15);
    bottom: 10%;
    right: 10%;
    animation-delay: -7s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 50px) scale(0.9);
    }

    75% {
        transform: translate(-50px, -20px) scale(1.05);
    }
}

/* Auth Box */
.auth-box {
    width: 100%;
    max-width: 440px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    z-index: 1;
    box-shadow:
        0 0 40px rgba(0, 212, 255, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), transparent, rgba(139, 92, 246, 0.3));
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-box:hover::before {
    opacity: 1;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
}

.auth-tab {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    color: var(--bg-primary);
}

.tab-icon {
    font-size: 1.1rem;
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.label-icon {
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

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

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--primary-cyan);
}

/* Form Error */
.form-error {
    color: #ff5f57;
    font-size: 0.875rem;
    margin-bottom: 15px;
    min-height: 20px;
    text-align: center;
}

.form-error:empty {
    display: none;
}

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    border: none;
    border-radius: 12px;
    color: var(--bg-primary);
    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;
    text-decoration: none;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn.loading .btn-text {
    opacity: 0;
}

.auth-btn.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-footer a {
    color: var(--primary-cyan);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.form-footer a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* OTP Input Group */
.otp-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-cyan);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.otp-input.filled {
    border-color: var(--accent-green);
    background: rgba(0, 212, 170, 0.1);
}

/* OTP Timer */
.otp-timer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.otp-timer strong {
    color: var(--primary-cyan);
    font-family: 'Fira Code', monospace;
}

/* Success Screen */
.success-content {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 0.5s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.success-content h2 {
    font-size: 1.75rem;
    margin-bottom: 10px;
}

.success-content p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Security Features */
.security-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.security-icon {
    font-size: 1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: rgba(0, 212, 170, 0.5);
}

.toast.error {
    border-color: rgba(255, 95, 87, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-box {
        padding: 30px 20px;
        margin: 0 10px;
    }

    .auth-tabs {
        flex-direction: column;
    }

    .otp-input {
        width: 42px;
        height: 52px;
        font-size: 1.25rem;
    }

    .security-features {
        flex-direction: column;
        gap: 15px;
    }
}

/* 2FA Setup Styles */
.qr-container {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #ffffff;
    border-radius: 12px;
    display: inline-block;
}

.qr-container img {
    max-width: 200px;
    height: auto;
}

.secret-key {
    text-align: center;
    margin-bottom: 20px;
}

.secret-key p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.secret-key code {
    display: block;
    background: rgba(0, 212, 255, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    color: var(--primary-cyan);
    font-size: 0.9rem;
    word-break: break-all;
    border: 1px solid rgba(0, 212, 255, 0.3);
}